OnLeftRoom called when MasterClient force-disconnects

Minneth
Minneth
edited December 2020 in DotNet
Hi all, this is my first post so apologies in advance if I get the format wrong.

I'm developing an app for Quest and I'm seeing some strange behaviour.

User 1 joins a room - User 1 is now the masterclient.
User 2 joins the same room.
User 1 now force-closes the application.
User 2 receives an OnPlayerLeftRoom as expected but I also then see an OnRoomLeft being called immediately after even though this isn't the player that disconnected. Its happening due to a Disconnected event being received in LoadBalancingClient.OnStatusChanged() on the following lines:

if (this.Server == ServerConnection.GameServer && wasInRoom)
{
this.MatchMakingCallbackTargets.OnLeftRoom();
}

I can see that OnMasterClientSwitched is called in the Client first and I would've expected this user to become the master but then the OnRoomLeft is called which is unexpected.

Is this normal?

Thanks in advance!

Comments

  • Hello @Minneth ,

    Yes, it's expected.

    Photon Bolt does not support host migration, so, if the Game Server goes offline, all clients will shut down after it leaves the session.

    --
    Ramon Melo
    Photon Bolt Team
  • ramonmelo wrote: »
    Hello @Minneth ,

    Yes, it's expected.

    Photon Bolt does not support host migration, so, if the Game Server goes offline, all clients will shut down after it leaves the session.

    --
    Ramon Melo
    Photon Bolt Team

    Thanks for the reply but it seems we're using Photon Unity Networking 2 (version 2.18) not Photon BOLT.
  • As an amendment to my above, it turns out we're actually using Photon Realtime.
  • PUN 2 uses the Realtime API layer to connect and send messages, etc. It handles the servers for the Unity-specific code of PUN 2.

    What you describe is not the intended workflow, so we have to debug. This is a unique case, so I have to assume it's related to your code.

    Please try 2 things:
    a) Try to reproduce this issue with your demos (e.g. Asteroids). If this doesn't produce the issue, it's specific to your project. You can decide how to debug this or:
    b) Create a repro case without UI and stuff. Just some code, that produces the issue. Send this via mail to: developer@photonengine.com.

    During the christmas time, we are probable unable to look into matters right away. It may be early next year, before we can check this out (it is really really likely your project / code).