// 心跳循环内容 public static void HeartbeatExecute() { foreach (var session in BaseServerInfo.AllSessions.Values) { if (session != null && session.Connected) { while (session.ListReq.TryDequeue(out var msg)) { Dispatcher.ProcessMessage(session, msg); } } } foreach (var item in GateServerLinkManager.DictServerLinkLogin.Values) { //if(item!=null &&item.) while (item.ListReq.TryDequeue(out var msg)) { ClientDispatcher.ProcessMessage(msg); } } foreach (var item in GateServerLinkManager.DictServerLinkGame.Values) { //if(item!=null &&item.) while (item.ListReq.TryDequeue(out var msg)) { ClientDispatcher.ProcessMessage(msg); } } }
private void timer1_Tick_1(object sender, EventArgs e) { if (ClientNetSingle.LinkState) { if (ClientNetSingle.ListReq.Count > maxnum) { maxnum = ClientNetSingle.ListReq.Count; Debug($"{uidButton.Count}:{maxnum}"); } while (ClientNetSingle.ListReq.TryDequeue(out var msg)) { ClientDispatcher.ProcessMessage(msg); } //if (pCursorOffset.X == 0 && pCursorOffset.Y == 0) //{ // return; //} //var Req = new E2G_Game_PlayerXY() //{ // PlayerXY = new CLS_PlayerXY() { Top = BtnPlayer.Top, Left = BtnPlayer.Left } //}; //ClientNetSingle.Send(Req); } }