How to manage all players disconnection ?

Options
I am making multiplayer game for 2 players.
i am working on disconnection issues for the game like goes on background reconnect and all.
so i am facing issue that if 2 player disconnect from photon then how to reconnect them into same room ?
how can i store my all data before disconnect ? so whenever i reconnect then i can send my data like position, rotation and other stuff ?

Comments

  • Ameee_SSJ3
    Options
    @Tobias can you help with this ?
  • Tobias
    Options
    We don't have a sample for this at the moment, sorry.

    To allow players to rejoin a room, you should set a Player Time To Live. So whenever you create a room, set RoomOptions.PlayerTtl = <milliseconds to stay in the room as inactive>.

    Call PhotonNetwork.ReconnectAndRejoin, when a client dropped out of a game. This gets you back in, provided there is a PlayerTtl.

    You have to decide if you try to keep objects around or if you re-instantiate them on join. This is another setting in the RoomOptions: CleanupCacheOnLeave.

    The latest PUN and Realtime versions got a Player.HasRejoined bool, which help you identify if a player does a rejoin or enters the room for the first time (depending on this, that player may instantiate objects or use the objects that "stayed" in the room).

    Hope this helps.
  • Since 2 days we are experiencing an issue that every game play gets terminated due to players disconnection.
    We are using 20 CCU pack. To analyse the issue, we checked our CCU and MAU as well. But total registered players are only 219, total games played are only 1015 and CCU as shown on Photon dashboard is 8 max.
    Please suggest if this is the case of CCU burst (which is not monitored by data stats) or some technical issue.