Assigning Persistent Player Number
Options
This is the scenario, I have 4 players in a room. I want a player to keep it's player number when it disconnects and reconnects. How do I do that?
I remember reading something about this in the forums but I can't find it anymore.
I remember reading something about this in the forums but I can't find it anymore.
0
Comments
-
Hi @johnny_tictoc,
In Photon Unity SDK:
Please create rooms withPlayerTTL != 0
andCheckUserOnJoin = true
.
This way actors can persist in the room's ActorList as inactive when they leave usingOpLeave(true)
and return to room with same ActorNr usingOpReJoinRoom(roomName)
.
In PUN:
I think some of the features are not enabled yet.
What you can do is:
- create rooms withPlayerTTL != 0
.
- make use ofReconnectAndRejoin()
for quick rejoin orReJoinRoom(roomName)
.0 -
@JohnTube That is very helpful! Thank you!0
-
@JohnTube But what if the player got disconnected unintentionally (e.g. lost connection or crash)? He won't be able to call
OpLeave(true)
.0 -
Unintentional/unexpected/implicit disconnects should count as temporary leave.0