public void Shutdown()
{
// Stop accepting new connections
base.IgnoreNewConnections = true;
// Unregister events so we dont get a shit ton of calls
GpspClient.OnDisconnect -= GpspClient_OnDisconnect;
// Disconnected all connected clients
foreach (GpspClient C in Clients.Values)
C.Dispose(true);
// clear clients
Clients.Clear();
// Shutdown the listener socket
base.ShutdownSocket();
// Tell the base to dispose all free objects
base.Dispose();
}
/// <summary> /// Shutsdown all of the Gamespy Servers /// </summary> public static void Shutdown() { // Shutdown Login Servers ClientManager.Shutdown(); SearchProvider.Shutdown(); MasterServer.Shutdown(); CDKeyServer.Shutdown(); // Update status bIsRunning = false; // Trigger the OnShutdown Event Stopped(); }