Need help with little disconnections from Mobile Connections

Options
I'm developing a turn based game with PUN, sometimes the connection with the Photon Network goes down for just few seconds and the only thing i'm able to do right now is to check on the other client the disconnection and let him win. Is there a way to hold the client to wait more for a reconnection? If i try to reconnecto to server -> lobby -> room it says that game does not exist.

Comments

  • deldam
    Options
    i had lot of disconnection, like after 20 sec joining a room, then i reduced the amount of data sync and sent by rpc, now diconnection are very rare on IOS platform
  • jeanfabre
    Options
    Hi,

    You need to increase the PlayerTtl ( Player Time to Live) so that when player disconnects they get a chance to reconnect.

    Bye,

    Jean
  • Shark812
    Options
    jeanfabre said:

    Hi,

    You need to increase the PlayerTtl ( Player Time to Live) so that when player disconnects they get a chance to reconnect.

    Bye,

    Jean

    Thanks for the tip, can you help me to set that parameter with Pun?
  • jeanfabre
    Options
    Hi,

    yes, it's when you create the room that you set this value, for example:
    PhotonNetwork.CreateRoom(null, new RoomOptions() { maxPlayers = 2, PlayerTtl = 5000 }, null);
    PlayerTtl is in milliseconds, so here Player will be kept for 5 seconds after disconnection, so it has time to reconnect and nothing will be lost for that player.

    Bye,

    Jean
  • Shark812
    Options
    jeanfabre said:

    Hi,

    yes, it's when you create the room that you set this value, for example:

    PhotonNetwork.CreateRoom(null, new RoomOptions() { maxPlayers = 2, PlayerTtl = 5000 }, null);
    PlayerTtl is in milliseconds, so here Player will be kept for 5 seconds after disconnection, so it has time to reconnect and nothing will be lost for that player.

    Bye,

    Jean

    I get this error


  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    @Shark812 please try playerTtl. If it's not there then you need to update PUN.

    Also, in Unity/Mono, please do not use object initializers as they have few issues.
  • Shark812
    Options
    JohnTube said:

    @Shark812 please try playerTtl. If it's not there then you need to update PUN.

    Also, in Unity/Mono, please do not use object initializers as they have few issues.

    I had an old version, now i can set the ttl, but just to be sure to use it properly:

    i set the ttl at 5000 for example -> when a client leave i see this on the console:

    Debug.LogWarning("HandleEventLeave for player ID: " + actorID + " isInactive: " + player.isInactive + ". Stopping handling if inactive.");

    1 - How can i catch this to pause the game?
    2 - Will i need to reconnect to photon -> enter lobby -> enter room again after reconenction?
    3 - I see that the still-in-room client takes too much time to catch the inactive status of the other, is there a way to catch it asap? (to prevent him making action that the other will not sync)
  • jeanfabre
    Options
    Hi,

    ah yes, there is a fix pending for this. I'll send you a notice when the fix will be included ( next update)

    Bye,

    Jean