Ejemplo n.º 1
0
        // ================= Update ==================

        public void Update()
        {
            if (state == RawClient.State.Terminated)
            {
                return;
            }

            if (LastPingSendTtime.AddSeconds(10) < DateTime.Now && !PingStopwatch.IsRunning)
            {
                AsyncFullPing();
            }

            if (!SyncMessagesToProcess.IsEmpty)
            {
                while (SyncMessagesToProcess.TryDequeue(out ClientSyncMessageCall mess))
                {
                    mess.Call();
                }
            }

            foreach (KeyValuePair <ushort, ClientMessagePartsActive> ActiveMessage in ActiveMessageParts)
            {
                if (ActiveMessage.Value.Process())
                {
                    ActiveMessageParts.Remove(ActiveMessage.Key);
                    break;
                }
            }
        }
Ejemplo n.º 2
0
        // ================== Update ===================


        public void Update()
        {
            if (!rawClient.Connected)
            {
                return;
            }

            if (LastPingSendTtime.AddSeconds(10) < DateTime.Now && !PingStopwatch.IsRunning)
            {
                AsyncFullPing();
            }

            if (!SyncMessagesToProcess.IsEmpty)
            {
                while (SyncMessagesToProcess.TryDequeue(out ClientSyncMessageCall mess))
                {
                    mess.Call();
                }
            }
        }