TTL problems
Working on rejoin logic. I set TTL for the room to 5 minutes.
Works correctly if a player crashes or loses internet connection. But if they actually choose to quit the level and PhotonNetwork.Disconnect() is called, they stay in the level for 5 minutes still? That has to be a bug right? If not, i don't understand, how do i get the player to leave a level immediately? TTL should just be for handling unwanted disconnects right? Not intended disconnects?
PUN1 Latest, near to latest Unity.
Answers
-
Hi @Statigar,
If you want to leave the room for good even if PlayerTTL != 0, then call
PhotonNetwork.LeaveRoom(false)
instead ofPhotonNetwork.LeaveRoom()
orPhotonNetwork.LeaveRoom(true)
orPhotonNetwork.Disconnect()
.0 -
I'm using PhotonNetwork.Disconnect(), but it's still taking 5 minutes to leave the room.
I also tried PhotonNetwork.LeaveRoom(true) and PhotonNetwork.LeaveRoom(false) but it has the same problem.
How would i tell if Photon is experiencing any difficulty leaving the room? maybe it can't process the leaving correctly so it's counting it as an unintended disconnect?
0 -
Unexpected disconnects,
PhotonNetwork.Disconnect()
,PhotonNetwork.LeaveRoom()
andPhotonNetwork.LeaveRoom(true)
will not remove the actor from the room if PlayerTTL != 0. Instead the actor will become inactive first.You need to use
PhotonNetwork.LeaveRoom(false)
which works as expected.If you also want to disconnect (why?) call
PhotonNetwork.Disconnect()
insideOnLeftRoom()
callback.0