Search Unity

Third Party [PHOTON] How to handle a temporary connection drop?

Discussion in 'Multiplayer' started by Doug_B, Dec 30, 2017.

  1. Doug_B

    Doug_B

    Joined:
    Jun 4, 2017
    Posts:
    1,596
    I'm trying to handle a connection glitch - for example, when using a mobile over a wifi connection. The use case looks like this:
    1. Two players connect to Photon, join a room and start play.
    2. Each player constructs a hierarchy of Photon instantiated GameObjects.
    3. A network glitch / delay occurs. (For testing, this means stopping the wifi; both players are running on the same PC.)
    4. Wait for each session to detect the dropped connection.
    5. Resolve the network connection. (For testing, this means restarting the wifi connection.)
    6. Play to resume seamlessly for both players.
    At step (1), both the Player and Room are given a Ttl (time to live) of 1 minute ( 60,000 ms ) :
    Code (CSharp):
    1.         m_roomOptions = new RoomOptions()
    2.             { IsVisible = true
    3.             , IsOpen = true
    4.             , MaxPlayers = 2
    5.             , PlayerTtl = 60000
    6.             , EmptyRoomTtl = 60000
    7.             };
    8.         PhotonNetwork.CreateRoom(sRoomName, m_roomOptions, TypedLobby.Default)
    However, at step (4), the Photon instantiated objects are all being destroyed. This is happening well before the 60s Ttl expires.

    How can this scenario be handled so that the GameObjects still exist at step (6) within the Ttl time frame?
     
  2. herenow

    herenow

    Joined:
    Jan 11, 2017
    Posts:
    3
    Ever figure this out? Having the same issue.
     
  3. Doug_B

    Doug_B

    Joined:
    Jun 4, 2017
    Posts:
    1,596
  4. julesradu

    julesradu

    Joined:
    Nov 9, 2017
    Posts:
    6