Is there a more responsive way to find if opponent left the room with playerTTL != 0

OnPlayerLeftRoom(Player otherPlayer) has some delay to actual opponent disconnect time. Any suggestions to find about an opponent left room status more instantly? We are trying to implement rejoining and we need to know very quickly if the opponent left room so that we can switch physics simulation done on remote to local player.

Comments

  • Hi @vksamhith,

    Thank you for choosing Photon!

    Make use of player.IsInactive.
    if it's true then player soft disconnected (player TTL did not expire yet).
    if it's false then the player hard disconnected and left the room for good, either because of player TTL expiration or because playerTTL == 0 or because the player simply left explicitly.
  • Hi @JohnTube ,

    I found that there is a OnPhotonPlayerActivityChanged (PhotonPlayer otherPlayer) callbacks in Photon Networking, but I don't find any callbacks in PUN. Is there a callback in PUN when players' IsInActive change?
  • Hi @Yan,

    In OnPlayerLeftRoom(Player player) callback check player.IsInactive inside.
Sign In or Register to comment.