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(); } }
public static void GameLogout(ZoneClient client) { client.Disconnect(); }