public void FrmLogin_UnLoad(object sender, EventArgs e) { if (E_NetworkConfig.Socket != null && E_NetworkConfig.Socket.IsConnected) { E_NetworkSend.SendLeaveGame(); } E_Loop.CloseEditor(); }
public static void CloseEditor() { E_NetworkSend.SendLeaveGame(); E_Globals.GameDestroyed = true; E_Globals.GameStarted = false; Application.Exit(); }
internal static void DestroyNetwork() { // Calling a disconnect is not necessary when using destroy network as // Dispose already calls it and cleans up the memory internally. // But if our Socket is alive, lets try to send one last thing to the server if (Socket != null && Socket.IsConnected) { E_NetworkSend.SendLeaveGame(); } Socket.Dispose(); }
public static void CloseEditor() { if (E_NetworkConfig.Socket != null && E_NetworkConfig.Socket.IsConnected) { E_NetworkSend.SendLeaveGame(); } E_Globals.GameDestroyed = true; E_Globals.GameStarted = false; Application.Exit(); }