Delay between OnCreatedRoom and OnJoinedRoom

Options
Hi,
Could someone help me with the reasons I'd get a 10 second delay between these two events firing?

In my situation, I have two (sometimes more) players in a room and at a certain point I send all of them to a different room (it works well mostly). I send one player first, so that they initiate the creation of the new room. Then I send everyone else and they join that same new room.

The issue is that, when I debug the first player's events I get something like (time: event):

0 OnConnectedToMaster
0.1 OnPhotonRandomJoinFailed
0.2 OnCreatedRoom
10 OnJoinedRoom
10.1 CreatePlayerObject
etc.

The numbers are just to illustrate that most things chain quickly EXCEPT the gap between OnCreatedRoom and OnJoinRoom.

OnCreatedRoom does call PhotonNetwork.LoadLevel but this executes very quickly so I assume it's doing async loading (also PhotonNetwork.automaticallySyncScene = true).

The issue is that, if I send the other players before OnJoinedRoom fires for the FIRST player, they don't join the new room :-( Just seems to hang.

Any help would be brilliant!

Thanks!

Comments

  • Hi @NotQuiteSmith,

    I have tried to reproduce this behaviour, but my tests worked fine. I had a similar setup to the one you have described. Can you create a repro case for me so that I can take a closer look at the problem?

    A question in general: can you explain, why you want to move each client from one room to another? Wouldn't it be easier to simply load another scene? You could do this even without using automaticallySyncScene, if you don't want to have, that all clients are loading the scene at the same time.
  • Hi,
    Thanks for looking at this. I can't put together a test case just now unfortunately - if I get the release out this weekend and this is still an issue I'll definitely get back if that's OK.
    I wasn't clear orignally - I don't move ALL the players in a room, just some of them. So the remaining players need to stay in the original room. I needed more than just "lobby" functionality but it's that kind of thing.

    What does photon do betern OnCreatedRoom and OnJoinedRoom that maybe I should investigate? I thought it may be the level loading (they do take about 10 seconds to load). I'd hoped that this wouldn't impact the process though - i.e. the room is created "instantly" when the first player goes and then I could wait just a few seconds and send everyone else, then EVERYONE just waits for the level to load/sync/etc.

    Thanks!
  • NotQuiteSmith
    edited November 2018
    Options
    "betern" should say "between"!