NetworkingPeer.Disconnect C# (CSharp) Method

Disconnect() public method

Complete disconnect from photon (and the open master OR game server)
public Disconnect ( ) : void
return void
    public override void Disconnect()
    {
        if (this.PeerState == PeerStateValue.Disconnected)
        {
            if (!PhotonHandler.AppQuits)
            {
                Debug.LogWarning(string.Format("Can't execute Disconnect() while not connected. Nothing changed. State: {0}", this.State));
            }
            return;
        }

        this.State = global::PeerState.Disconnecting;
        base.Disconnect();

        //this.LeftRoomCleanup();
        //this.LeftLobbyCleanup();
    }

Usage Example

Exemplo n.º 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();
     }
 }
All Usage Examples Of NetworkingPeer::Disconnect
NetworkingPeer