Offline to online JoinRandom fail

Options
Hi,
I'm having a really weird bug. Just recently I changed the game flow to start offlineMode = true, and later offlineMode = false and connect.
I've searched around and did everything I can find.

1. Start game offlineMode = true. Spawn player
2. At some point, destroy the player in local, and have tried all (combination) of the following, in various order:
PhotonNetwork.LeaveRoom();
PhotonNetwork.Disconnect();
PhotonNetwork.offlineMode = false;
PhotonNetwork.networkingPeer.State = ClientState.Disconnected;
3. Then a button to call ConnectUsingSetting or ConnectToRegion(what it was originally).

4. In OnConnectedToMaster, I have a coroutine to debug a few things:
Debug.Log(PhotonNetwork.countOfRooms);
Debug.Log("Room list count: " + PhotonNetwork.GetRoomList().Length);
Debug.Log("InRoom: " + PhotonNetwork.inRoom);
Debug.Log("State: " + PhotonNetwork.connectionStateDetailed);
This is the weird part: countOfRooms is 1, while GetRoomList.Length is 0 (Another client is already online and joined room. The countOfRoom 1 is definitely that one, because it's 0 when there's no other client). Btw, inRoom is false, State: ConnectedToMaster

5. When JoinRandomRoom is called, it fails with message: No Match found. It seems it doesn't consider countOfRooms, instead only GetRoomList. Why are they not the same in the first place?

If I never set offlineMode and adjusted the flow to straight away connect, everything works as expected.
I've been on this problem for a few hours, don't know what else to do but ask here...

Cheers

Comments

  • delgelato
    delgelato
    edited August 2018
    Options
    Update. I thought it didn't have anything to do with it but, when I was offline at start, I'm connected to PhotonChat, but a modified Connect for offline.
    Anyways, took out ChatGui.Connect and somehow it works...
    Is there a way around it if I want to connect to Chat throught offline/online?

    edit:
    Fixed. apparently my Chat.Connect was using a different app game version..
    So this turned out to be a silly mistake on my end, but now I learned the Chat connects the app the same way, somehow, prohibiting the Pun.Connect using its own game version..
    This thread can be closed
    Cheers
This discussion has been closed.