Problem with Joining (players are joined, but apparently not in same room)
The whole answer can be found below.
Try Our
Documentation
Please check if you can find an answer in our extensive documentation on PUN.
Join Us
on Discord
Meet and talk to our staff and the entire Photon-Community via Discord.
Read More on
Stack Overflow
Find more information on Stack Overflow (for Circle members only).
Problem with Joining (players are joined, but apparently not in same room)
Dave_A
2021-05-07 17:09:55
My app is a meeting place (social app). All players are given a room name to join. I have set up my dashboard with app id, and PhotonNetwork.ConnectUsingSettings(). Often this works, but sometimes players appear to have joined (IsConnected is true, but they are not seeing each other, no RPCs working. OnRoomListUpdate is not updating. I have a lobby, because the meeting should not begin until a certain player arrives. So others who join before this are in the Lobby. And this also works often, but sometimes they are parked in the lobby and their are zero rooms. Could it be it's connecting different users to different regions or something?
Comments
Hi @Dave_A,
Check out our "Matchmaking Checklist".
Clients need to be connected to the same server (region) and virtual application (AppId, AppVersion).
OnRoomListUpdate works only for default lobby type.
Thanks. I have not set any lobby, which if I'm not mistaken, should use the 'default' lobby. Or would it be better if I created a typed-lobby of type 'default'?
Using default lobby is fine.
I may have a clue: My code was 'when joining, CreateRoom' but should have been 'JoinOrCreateRoom'. Right? And it's webGL, so some folks had a cached older version. Those with new code worked, those with old code would 're-create' the room and bump everyone else out. Does that sound like like what would happen? How did it ever work with just 'CreateRoom'?!
Kaiserludi
2021-05-10 19:54:33
Hi @Dave_A.
Those with new code worked, those with old code would 're-create' the room and bump everyone else out.
That sounds like an appVersion mismatch.
With PUN the appVersion consists of the game Version + the PUN version. So if the older version of your game uses a different PUN version or a different game version string than the older version, then those versions run in separate isolated environments on Photon Cloud and the clients from one version won't be seeing anything that is going on in the other version, just as if it were two different appIDs.
I don't think that's it though. I'm building webGL, so it doesn't have to publish incrementing versions, always the same. And I haven't changed PUN versions. I just build it.
More data: I see that my game is connected for a few mintutes, then disconnects (from inactivity?) In any case, I attempt ReconnectAndJoin which returns success, but it doesn't happen. I don't get the OnConnected callback. If I call Reconnect, I do get that. Then I call 'RejoinRoom' which calls back to failure. So now I'm trying to detect that and JoinOrCreate instead.
Hi @Dave_A,
Enable SupportLogger and check logs or implement failure callbacks and see why the call to ReconnectAndRejoin, RejoinRoom or JoinOrCreate is failing.
I get failure callbacks for JoinRoomFailed: 'Game does not exist' and sometimes 'User does not exist' or something like that. I'll take a look at that support Logger.
@JohnTube : Can I pay you to help us in the next 48 hours?
Kaiserludi
2021-05-11 16:07:57
Hi @Dave_A.
Are you using the 'best region' feature? On WebGL the best region detection is notoriously bad and two clients from the same location might easily end up connecting to different regions. Connection to a fixed region is the solution in this case.
@Kaiserludi wrote: »
Hi @Dave_A.
Are you using the 'best region' feature? On WebGL the best region detection is notoriously bad and two clients from the same location might easily end up connecting to different regions. Connection to a fixed region is the solution in this case.
I'm using fixed region usw
No, I've whitelisted one region, and I display that on-screen to verify it. I put some 'retry' code into CreateRoomFailed and JoinRoomFailed which is helping. Not sure it's the best way though.
Back to top