public static void Exit(bool restarting, string msg) { Player[] players = PlayerInfo.Online.Items; foreach (Player p in players) { p.save(); } foreach (Player p in players) { p.Leave(msg); } if (APIServer != null) { APIServer.Stop(); } if (InfoServer != null) { InfoServer.Stop(); } Player.connections.ForEach(p => p.Leave(msg)); Plugin.Unload(); if (listen != null) { listen.Close(); } try { IRC.Disconnect(restarting ? "Server is restarting." : "Server is shutting down."); } catch { } }
public void Disconnect() { IRC?.Disconnect(); IRC?.Dispose(); }