Disconnect() public method

Complete disconnect from photon (and the open master OR game server)
public Disconnect ( ) : void
return void
示例#1
0
 public static void Disconnect()
 {
     if (offlineMode)
     {
         offlineMode          = false;
         offlineModeRoom      = null;
         networkingPeer.State = PeerStates.Disconnecting;
         networkingPeer.OnStatusChanged(StatusCode.Disconnect);
     }
     else if (networkingPeer != null)
     {
         networkingPeer.Disconnect();
     }
 }
示例#2
0
 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);
     }
 }
示例#3
0
 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();
 }
示例#4
0
    /// <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();
    }