private static void LogicRun() { g_client = new Dictionary <IntPtr, Session>(); for (int i = startId; i < endId; i++) { TcpClientEx client = new TcpClientEx("127.0.0.1", 13006, 5, OnSocket); Session s = new Session(client); if (client.Connect(true)) { s.SocketState = SocketState.CHECKING; s.ID = i; s.SendFirstSelfSalt(); //s.LoginGame("soul" + i.ToString(), "0000", "魔域"); g_client[client.ConnectionId] = s; } } while (true) { Dictionary <IntPtr, Session> dic = new Dictionary <IntPtr, Session>(g_client); foreach (Session client in dic.Values) { client.Run(); } System.Threading.Thread.Sleep(4); } }
public void Run() { m_Client.Run(); this.ProcessNetData(); }