Przeglądaj źródła

TService中的action队列多余,删掉

tanghai 8 lat temu
rodzic
commit
1968ec1b84

+ 1 - 1
Unity/Assets/Scripts/Base/Network/KNet/KService.cs

@@ -88,7 +88,7 @@ namespace Model
 				// accept
 				uint conn = BitConverter.ToUInt32(udpReceiveResult.Buffer, 0);
 				
-				// conn从1000开始,如果为1,2则是特殊包
+				// conn从1000开始,如果为1,2,3则是特殊包
 				if (conn == KcpProtocalType.SYN)
 				{
 					this.HandleAccept(udpReceiveResult);

+ 1 - 8
Unity/Assets/Scripts/Base/Network/TNet/TService.cs

@@ -12,8 +12,6 @@ namespace Model
 		private TcpListener acceptor;
 
 		private readonly Dictionary<long, TChannel> idChannels = new Dictionary<long, TChannel>();
-
-		private readonly EQueue<Action> actions = new EQueue<Action>();
 		
 		/// <summary>
 		/// 即可做client也可做server
@@ -87,14 +85,9 @@ namespace Model
 			this.idChannels.Remove(id);
 			channel.Dispose();
 		}
-		
+
 		public override void Update()
 		{
-			while (this.actions.Count > 0)
-			{
-				Action action = this.actions.Dequeue();
-				action();
-			}
 		}
 	}
 }