OpLeave









How do I use Op Leave
Below are practical examples compiled from projects for learning and reference purposes

Featured Snippets


File name: LoadbalancingPeer.cs Copy
71         public virtual bool OpLeaveLobby()
72         {
73             if (this.DebugOut >= DebugLevel.INFO)
74             {
75                 this.Listener.DebugReturn(DebugLevel.INFO, "OpLeaveLobby()");
76             }
77
78             return this.OpCustom(OperationCode.LeaveLobby, null, true);
79         }
File name: NetworkingPeer.cs Copy
986     public virtual bool OpLeave()
987     {
988         if (this.State != global::PeerState.Joined)
989         {
990             Debug.LogWarning("Not sending leave operation. State is not 'Joined': " + this.State);
991             return false;
992         }
993
994         return this.OpCustom((byte)OperationCode.Leave, null, true, 0);
995     }
File name: PhotonNetwork.cs Copy
1821     public static bool LeaveLobby()
1822     {
1823         if (PhotonNetwork.connected && PhotonNetwork.Server == ServerConnection.MasterServer)
1824         {
1825             return networkingPeer.OpLeaveLobby();
1826         }
1827
1828         return false;
1829     }
File name: PhotonNetwork.cs Copy
1838     public static bool LeaveRoom()
1839     {
1840         if (offlineMode)
1841         {
1842             offlineModeRoom = null;
1843             NetworkingPeer.SendMonoMessage(PhotonNetworkingMessage.OnLeftRoom);
1844         }
1845         else
1846         {
1847             if (room == null)
1848             {
1849                 Debug.LogWarning("PhotonNetwork.room is null. You don't have to call LeaveRoom() when you're not in one. State: " + PhotonNetwork.connectionStateDetailed);
1850             }
1851             return networkingPeer.OpLeave();
1852         }
1853
1854         return true;
1855     }

OpLeave 185 lượt xem

Gõ tìm kiếm nhanh...