Quantcast
Channel: Recent Discussions — Photon Engine
Viewing all articles
Browse latest Browse all 15755

High RoomTtl + high PlayerTtl = joining the room with copies of yourself

$
0
0
HI everybody!

I'm loosing a fight with PUN again!

In my game I have a lobby where if you click "Play online", the game is trying to join a random room. If such room doesn't exist, the game creates a new one with the following options:
roomOptions.RoomTtl = 120;
roomOptions.PlayerTtl = 120;
Now if the player decides to disconnect (by clicking "Cancel matchmaking") and then clicks "Play online" again, a bug happens. The player joins previously created room, the number of players in a room becomes 2, and online match starts. Looks like the abandoned room still stores player's actorID and when he tries to join a random room again, he gets into the same room but with a new actorID.

This way one player can fill several slots in the same room and his game will start with the player being his own disconnected opponent. How can I prevent this from happening?

Thank you!

Viewing all articles
Browse latest Browse all 15755

Trending Articles