Ver Fonte

修复kcp的一个隐藏bug

tanghai há 7 anos atrás
pai
commit
1f1e547a97

+ 0 - 9
Server/Hotfix/Module/Message/NetInnerComponentSystem.cs

@@ -11,15 +11,6 @@ namespace ETHotfix
 			self.Awake();
 		}
 	}
-	
-	[ObjectSystem]
-	public class NetInnerComponentStartSystem : StartSystem<NetInnerComponent>
-	{
-		public override void Start(NetInnerComponent self)
-		{
-			self.Start();
-		}
-	}
 
 	[ObjectSystem]
 	public class NetInnerComponentAwake1System : AwakeSystem<NetInnerComponent, IPEndPoint>

+ 0 - 9
Server/Hotfix/Module/Message/NetOuterComponentSystem.cs

@@ -20,15 +20,6 @@ namespace ETHotfix
 			self.Awake(a);
 		}
 	}
-	
-	[ObjectSystem]
-	public class NetOuterComponentStartSystem : StartSystem<NetOuterComponent>
-	{
-		public override void Start(NetOuterComponent self)
-		{
-			self.Start();
-		}
-	}
 
 	[ObjectSystem]
 	public class NetOuterComponentUpdateSystem : UpdateSystem<NetOuterComponent>

+ 0 - 9
Unity/Assets/Scripts/Module/Message/NetOuterComponent.cs

@@ -8,15 +8,6 @@
 			self.Awake();
 		}
 	}
-	
-	[ObjectSystem]
-	public class NetOuterComponentStartSystem : StartSystem<NetOuterComponent>
-	{
-		public override void Start(NetOuterComponent self)
-		{
-			self.Start();
-		}
-	}
 
 	[ObjectSystem]
 	public class NetOuterComponentUpdateSystem : UpdateSystem<NetOuterComponent>

+ 2 - 1
Unity/Assets/Scripts/Module/Message/Network/KCP/KChannel.cs

@@ -224,6 +224,7 @@ namespace ETModel
 				this.KcpSend(buffer, index, length);
 				return;
 			}
+			
 			this.sendBuffer.Enqueue(new WaitSendBuffer(buffer, index, length));
 		}
 
@@ -231,7 +232,7 @@ namespace ETModel
 		{
 			ushort size = (ushort)buffers.Select(b => b.Length).Sum();
 			byte[] bytes;
-			if (!this.isConnected)
+			if (this.isConnected)
 			{
 				bytes = this.cacheBytes;
 			}

+ 4 - 0
Unity/Assets/Scripts/Module/Message/NetworkComponent.cs

@@ -34,6 +34,8 @@ namespace ETModel
 				}
 
 				this.Service.AcceptCallback += this.OnAccept;
+				
+				this.Start();
 			}
 			catch (Exception e)
 			{
@@ -58,6 +60,8 @@ namespace ETModel
 				}
 				
 				this.Service.AcceptCallback += this.OnAccept;
+				
+				this.Start();
 			}
 			catch (Exception e)
 			{