Question about PlayerTtl

Options
Regarding PlayerTTL, the documentation states that

"If a client disconnects, this actor is inactive first and removed after this timeout. In milliseconds."

So my question are
1) does the application need to perform anything when the actor become "inactive"? Or this is transparent and either everything returns to normal after the client "reconnect", or the MasterClient will receive a OnPlayerDisconnected after the time out?

2) Does the disconnect client need to do anything in order to attempt the "reconnect" in question 1?

Thanks
David

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    edited July 2017
    Options
    Hi @cmy,

    Thank you for choosing Photon!

    1) I didn't really understand the question.
    • Player can be come inactive due to unexpected disconnect or explicitly by calling e.g. OpLeaveRoom(true).
    • MasterClient can be the actor becoming inactive.
    • When an actor becomes inactive or active again there is a callback for that: OnPhotonPlayerActivityChanged (PhotonPlayer otherPlayer).
    • If the room is still alive and PlayerTTL expires you should get a callback OnPhotonPlayerDisconnected (PhotonPlayer otherPlayer).
    2) Yes within the PlayerTTL period/window the player can rejoin to become active again. after PlayerTTL expiration he can join as a new actor.
    • Sometimes if EmptyRoomTTL < PlayerTTL when last player leaves, the room can be closed before PlayerTTL expiration.
    • PlayerTTL = -1 or int.MaxValue mean infinite.