Create Room sometimes doesn't join the room

The whole answer can be found below.

Please note: The Photon forum is closed permanently. After many dedicated years of service we have made the decision to retire our forum and switch to read-only: we've saved the best to last! And we offer you support through these channels:

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).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

Create Room sometimes doesn't join the room

Alarack
2021-07-01 21:41:42

Hey folks, I'm having a really hard time figuring out what's going on here.

I've got a lobby where users can create rooms. Each room has a max users of 2.

When a room is created, that user loads a waiting scene after OnJoinedRoom is called. Then, when a second user joins, their game begins.

The problem is that infrequently, maybe 1 in 10 times, when a user creates a room, they just don't join it.

OnJoinedRoom is never called, nor is OnJoinedRoomFailed, or OnCreateRoomFailed.

Nothing happens, and eventually that user times out and disconnects.

Can anyone help me out?

Comments

SteelWindows
2021-07-02 00:39:13

I'm noticing this same behavior. Very infrequently A client will call Join Random Room. If no room exists, then it should create one. So I act on the PUN callback for Join Random Room Failed and call Create Room from the API. But then I get no callback for On Created Room, and nothing connects.

Alarack
2021-07-02 04:50:02

A bit more information on this issue.

It looks like not only does the user who creates the room not join it, but I don't think the room even gets created to begin with. I was watching the lobby on another client while the first client attempted to create a room. No rooms appeared in the lobby at all when this issue happened.

No callbacks of any kind occur, but code inside of the an if (PhotonNetwork.CreateRoom()) block will fire.

It's almost as if it's getting a false positive.

This seems like it might be a bug on the Photon side of things.

If anyone has any more insight, I'm still quite troubled by this.

Tobias
2021-07-02 10:36:27

I posted a reply for this in the other thread. Let's use that one to analyze this / discuss.

CreateRoom only returns a value indicating if the client thinks it will be able to call the operation on the currently connected-to server. It's not a guarantee anything happens yet.
We'll need to figure out what happens.
SupportLogger logs and Wireshark captures will help tremendously. Also knowing your AppId may help, so please mail it to us via: [email protected] (don't post it in the forum).

Edit: Update PUN 2 to the latest version, if you didn't yet. Let us know the platform you build for.

legend411
2021-07-02 13:33:48

I think I'm having the same issue, maybe one in 5 times that I click create room, it just sits on "OnConnectedToGameserver" for about 30 seconds, then disconnects due to timeout. This even happens in the asteroids demo.

I do believe I'm using an older version of PUN2 though. I'm going to try updating and see if that fixes it.

Tobias
2021-07-06 11:13:20

It's great you used the Asteroids demo to reproduce this.
Please use the latest version and let us know which Unity version this is. Also: On which platforms do you run into the issue?

Back to top