PhotonCloud Server List Problems [SOLVED]

BassaForte
edited May 2017 in Photon Bolt
Hello all, back again with another strange problem.

So I started working on setting up a server list for my WIP game, and I'm running into some strange problems.. I followed the NEW-PhotonCloud example in the samples folder and got it to work... sorta.

When the client starts for the first time and gets the session list, it finds my test server and I'm able to connect to it perfectly. However, if I disconnect from the server (or the server shuts down), the client gets sent back to my menu scene (as it should), but this is where the problems begin.

First, when it pulls the session list back, there are servers in the list that shouldn't be there: http://puu.sh/vC6QC/5376d1e248.png

"Test" is my server, but it's also no longer running, so why is it in the list?

I have the PhotonConfig set up to use my specific PhotonCloud app id, yet it's showing servers from other games?

Also, when I restart my test server and try to join it, I get a "Can't call BoltNetwork.Connect when not in lobby" error in the Unity console. What lobby? There's no documentation on this error anywhere... And none of it makes sense.

I am calling BoltLauncher.StartClient again when coming back to the menu scene, and calling BoltLauncher.ShutDown says it can't shut down because it's not running, even when I check that it's running before calling ShutDown.

Does anyone have any idea what's going on?

Best Answer

Answers

  • BassaForte
    edited May 2017
    Great, I'm glad to see there is a fix for it. I implemented the quick fix and it works perfectly. I will keep an eye out for the proper fix. Thanks!
  • "Also, when I restart my test server and try to join it, I get a "Can't call BoltNetwork.Connect when not in lobby" error in the Unity console. What lobby? There's no documentation on this error anywhere... And none of it makes sense."

    Can you try this again? We have made some changes on our side. Or was this fixed with what I replied with?
  • stanchion said:

    Someone else posted this earlier with a fix, we are looking into making a proper fix.

    "I think there's an issue where PhotonPoller doesn't go back to the lobby state (ClientState.JoinedLobby), even though we are in the lobby. I see this issue when joining a session, then disconnecting (or shutting down), then calling BoltNetwork.StartClient() again and after that trying to join another session with BoltNetwork.Connect(): BoltLog.Error("Can't call BoltNetwork.Connect when not in lobby"); - but i'm pretty sure that we are in the lobby, because i can receive the current SessionList.

    Also, regarding our lobby data discussion from yesterday, if i understand correctly, then the Room Token is actually part of the photon CustomRoomPropertiesForLobby - see line 567 in PhotonPoller.


    So what i mean is that the CustomRoomPropertiesForLobby can be updated in PUN after session creation.


    I think i just fixed a bunch of issues that were occurring by simply deleting the PhotonPoller GameObject as soon as bolt shuts down (it's recreated automatically when StartClient() is called). The issues were: 1) after a client disconnects, his slot is still occupied in the room info, forever 2) unable to join a session > disconnect > join another session (see my message above) and 3) (I mentioned this a few days ago) where the new host doesn't create a new lobby session, he somehow takes over the old session.


      public override void BoltShutdownBegin(AddCallback registerDoneCallback)
      {
        base.BoltShutdownBegin(registerDoneCallback);
        Destroy(PhotonPoller.Instance.gameObject);
      }
    "
    Any solution for Bolt?
  • Solution for what specifically?
  • stanchion said:

    Solution for what specifically?

    So i added the BoltShutdownBegin function. I am printing the sessionList count in the Log. Its 0 when no servers are On. Its 1 when i switch on server. When i quit the server, its still printing 1.