예제 #1
0
        public void PingCheck()
        {
            lock (clientsByName)
            {
                foreach (var kvp in clientsByName)
                {
                    var client = kvp.Value;
                    if (!client.Authenticated)
                    {
                        continue; //they don't have ping shit, since they don't even send a response.
                    }
                    if (client.HasPong)
                    {
                        Handler2.SendPing(client);
                        client.HasPong = false;
                    }
                    else
                    {
                        pingTimeouts.Add(kvp.Key);
                        Log.WriteLine(LogLevel.Debug, "Ping timeout from {0} ({1})", client.Username, client.Host);
                    }
                }

                foreach (var client in pingTimeouts)
                {
                    ZoneClient derp = null;
                    clientsByName.TryRemove(client, out derp);
                    derp.Disconnect();
                }

                pingTimeouts.Clear();
            }
        }
예제 #2
0
 public static void GameLogout(ZoneClient client)
 {
     client.Disconnect();
 }