Leaving a room problem.

Options
I have players in a room and call PhotonNetwork.LeaveRoom(); expecting the call back to OnPlayerLeftRoom. It never gets called. I built the asteroids demo and that seems to be working fine.

I have no idea what to try next. Any ideas ?

internal void leaveRoom()
    {
        PhotonNetwork.LeaveRoom();
    }

    
    public override void OnLeftRoom()
    {
        Debug.Log("OnLeftRoom()");
        PhotonNetwork.Disconnect();
    }

This is the logs from photon :
(Filename: Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs Line: 2130)

Resending: CMD(5 ch#/sq#/usq#: 255/33/0 r#/st/tt:7/48713/53804). times out after: 4400 sent: 48713 now: 53126 rtt/var: 247/7 last recv: 9928
UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
Photon.Realtime.LoadBalancingClient:DebugReturn(DebugLevel, String) (at Assets\Photon\PhotonRealtime\Code\LoadBalancingClient.cs:2130)
ExitGames.Client.Photon.EnetPeer:SendOutgoingCommands() (at C:\Dev\photon-sdk-dotnet\PhotonDotnet\EnetPeer.cs:808)
ExitGames.Client.Photon.PhotonPeer:SendOutgoingCommands() (at C:\Dev\photon-sdk-dotnet\PhotonDotnet\PhotonPeer.cs:1555)
Photon.Pun.PhotonHandler:LateUpdate() (at Assets\Photon\PhotonUnityNetworking\Code\PhotonHandler.cs:170)
 
(Filename: Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs Line: 2130)

Timeout-disconnect! Command: CMD(5 ch#/sq#/usq#: 255/33/0 r#/st/tt:8/53127/53804) now: 61959 challenge: 1c906944
UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:LogWarning(Object)
Photon.Realtime.LoadBalancingClient:DebugReturn(DebugLevel, String) (at Assets\Photon\PhotonRealtime\Code\LoadBalancingClient.cs:2126)
ExitGames.Client.Photon.EnetPeer:SendOutgoingCommands() (at C:\Dev\photon-sdk-dotnet\PhotonDotnet\EnetPeer.cs:775)
ExitGames.Client.Photon.PhotonPeer:SendOutgoingCommands() (at C:\Dev\photon-sdk-dotnet\PhotonDotnet\PhotonPeer.cs:1555)
Photon.Pun.PhotonHandler:LateUpdate() (at Assets\Photon\PhotonUnityNetworking\Code\PhotonHandler.cs:170)
 
(Filename: Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs Line: 2126)

Comments

  • Tobias
    Options
    OnPlayerLeftRoom is "Called when a remote player left the room or became inactive".
    OnLeftRoom() should be called when you leave.
    Make sure the script / instance is registering for callbacks (in PUN 2). If you use MonoBehaviourPunCallbacks, make sure to not simply override OnEnable and OnDisable, as those methods register for callbacks.
  • Tobias
    Options
    The timeout from the logs looks as if you lost connection before properly disconnecting. This should not happen every time. If it does, we could use a repro case.
    Do any of our demos fail this way, too?