leaveroom don't work

Options
when i call leaveroom, i cant get any callback
this happen when i load other scene
i explain you my game logic

joinroom(scene 1 == waiting scene) -> load scene2(map scene) -> play game -> game end -> load scene1(waiting scen) -> leaveroom

when i call leaveroom after load scene1, leave room don't work. i cant get any callback(unity wasnt freeze)
PhotonNetwork.connectionStateDetailed is joined
PhotonNetwork.connectionState is connected
although i call leave room

when i call leaveroom before load map scene, it work.....

i dont know why this happen ......
difference between two situation is just i just loaded other scene, but result is diffrent

Comments

  • and when i call disconnect , photon freezen in disconnecting
  • Hi @SungJinKang,

    please increase the log level of Pun Logging and Network Logging in the PhotonServerSettings. You can set them both to Info or All. Afterwards rerun the test and see if there is anything useful logged to the console.

    OnJoinedRoom is only called, if the related script is attached to an object which is in the current scene. PhotonNetwork.connectionState and PhotonNetwork.connectionStateDetailed should be set properly in any case.
  • when i call leave room

    i got this log

    Cannot send op: 254 Not connected. PeerState: Disconnected
    UnityEngine.Debug:LogError(Object)
    NetworkingPeer:DebugReturn(DebugLevel, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1574)
    ExitGames.Client.Photon.EnetPeer:EnqueueOperation(Dictionary`2, Byte, Boolean, Byte, Boolean, EgMessageType)
    ExitGames.Client.Photon.PeerBase:EnqueueOperation(Dictionary`2, Byte, Boolean, Byte, Boolean)
    ExitGames.Client.Photon.PhotonPeer:OpCustom(Byte, Dictionary`2, Boolean, Byte)
    ExitGames.Client.Photon.PhotonPeer:OpCustom(Byte, Dictionary`2, Boolean)
    LoadBalancingPeer:OpLeaveRoom(Boolean) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/LoadbalancingPeer.cs:363)
    PhotonNetwork:LeaveRoom(Boolean) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonNetwork.cs:2171)
    LobbyManagerEditor:OnInspectorGUI() (at Assets/02.Scripts/LobbyManager.cs:511)
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

    OnStatusChanged: SendError current State: Disconnecting
    UnityEngine.Debug:Log(Object)
    NetworkingPeer:OnStatusChanged(StatusCode) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:2063)
    ExitGames.Client.Photon.EnetPeer:EnqueueOperation(Dictionary`2, Byte, Boolean, Byte, Boolean, EgMessageType)
    ExitGames.Client.Photon.PeerBase:EnqueueOperation(Dictionary`2, Byte, Boolean, Byte, Boolean)
    ExitGames.Client.Photon.PhotonPeer:OpCustom(Byte, Dictionary`2, Boolean, Byte)
    ExitGames.Client.Photon.PhotonPeer:OpCustom(Byte, Dictionary`2, Boolean)
    LoadBalancingPeer:OpLeaveRoom(Boolean) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/LoadbalancingPeer.cs:363)
    PhotonNetwork:LeaveRoom(Boolean) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonNetwork.cs:2171)
    LobbyManagerEditor:OnInspectorGUI() (at Assets/02.Scripts/LobbyManager.cs:511)
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)


    ----------------------------------------
    PhotonNetwork.connectionStateDetailed is Disconnecting
    PhotonNetwork.connectionState is Disconnected

    i cant got onjoinedlobby

  • The error message states, that you are not inside a room when calling PhotonNetwork.LeaveRoom. You can check the messages logged to the console. One of them should be about the disconnect (OnDisconnectedFromPhoton). See when it gets logged.