Setting player TTL at a higher value to avoid being kickout due to scene loading and leave 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.

Setting player TTL at a higher value to avoid being kickout due to scene loading and leave room

hdavid_bpg
2022-03-24 15:30:59

We are working on a VR multiplayer game where matchmaking is done in a virtual office/hangar and once all the room is chosen or a quick match is set is then transported to the mission scene.

The problems I am encountering are:

  • Setting a higher player TTL will delay the notification that a player has left the room which is needed to determine if the player aircraft will be removed. LeaveRoom is already called to not become inactive. This causes awkward delays where the aircraft hangs in the air.

  • Setting a lower player TTL will potentially cause players to leave the room with or without the disconnected notification or the left room will be notified or a random off force kick out, especially for rejoining players.

  • Also some combination of room and player ttl could cause ghost rooms even if the matchmaking connections are already forced removed and disconnected for the server, lobby and room.

Are there workarounds here or can I force the local leaving player (like on the quest where players can quit the app) to announce that he left the game or through disconnection etc. so that it would immediately be communicated to the server and master client and any game logic like cleanup and removal will immediately be called?

Thank you for the assistance and your time.

Comments

Tobias
2022-03-24 16:37:37

When someone leaves the room, this will send a message to the server about that. No timeout needed.

The timeout you can set is client side (except you run servers, which means you could define a timeout there as well). If someone leaves a room (calling LeaveRoom()), there is no timeout (much less a local client one).

Depending on how the client leaves, there is only one attempt of informing the server about leaving. Meaning, if that datagram does not arrive, it won't be repeated (as the client may be gone).

Maybe you need to figure out if you are sending a lot of data and if there is a delay of messages anyways?

In doubt: If your clients notice that there are no more updates for a plane, make it disappear. Cheat.

Back to top