public static void Disconnect() { if (offlineMode) { offlineMode = false; offlineModeRoom = null; networkingPeer.State = PeerStates.Disconnecting; networkingPeer.OnStatusChanged(StatusCode.Disconnect); } else if (networkingPeer != null) { networkingPeer.Disconnect(); } }
public static void SwitchToProtocol(ConnectionProtocol cp) { if (networkingPeer.UsedProtocol != cp) { try { networkingPeer.Disconnect(); networkingPeer.StopThread(); } catch { } networkingPeer = new NetworkingPeer(photonMono, string.Empty, cp); Debug.Log("Protocol switched to: " + cp); } }
public static void Disconnect() { if (offlineMode) { offlineMode = false; offlineModeRoom = null; networkingPeer.State = PeerState.Disconnecting; networkingPeer.OnStatusChanged(StatusCode.Disconnect); return; } if (networkingPeer == null) { return; } networkingPeer.Disconnect(); }
/// <summary> /// Disconnect from the photon server (also quits your multiplayer game, if any) /// </summary> public static void Disconnect() { if (networkingPeer == null) { return; // Surpress error when quitting game } networkingPeer.Disconnect(); }