TimeoutDisconnect ignores PlayerTTL?

Hi,

I am working on a game using Photon Plugin that requires reconnect. I set playerTTL = -1, and if the client (unity) calls disconnect, the room can still see the actor within the list and see that it is inactive. However, if the disconnect is caused by TimeoutDisconnect (by putting the android app to the background for example), then the actor will be completely removed from the list instead of staying in the inactive list. Is that the expected behaviour? And if so, how should i handle reconnect for players disconnected by server timeout?
Would greatly appreciate your help.

Comments

  • hi, @ltx

    we introduced player ttl and Inactive players in order to solve 'tunel' issue. when players suddenly get in to to tunnel and lose connection. in this way you will get classic Timeout Disconnect. And in this case players stay in game for sure.

    Could you provide more details? What version of server are you using? logs?

    best,
    ilya
  • ltx
    ltx
    edited May 2018
    Hi @chvetsov ,

    Thanks for the reply.
    I am running Photon v 4-0-29-11263 locally, creating a new plugin
    Here is my OnLeave method in the plugin. (Using LogError for all the wrong reasons for the moment)
           
     public override void OnLeave(ILeaveGameCallInfo info)
            {
                PluginHost.LogError("On leave called!!!!!!!!!!!!!!!!");
                PluginHost.LogError(info.ActorNr);
                PluginHost.LogError(info.IsInactive);
                PluginHost.LogError(info.Reason);
                PluginHost.LogError(info.Details);
    
                info.Continue();
     
               PluginHost.LogError("check actors");
                foreach (IActor actor in PluginHost.GameActors)
                {
                    PluginHost.LogError(actor);
                    PluginHost.LogError(actor.ActorNr);
                }
            }
    
    now in the log:
    case 1, when I call OpLeave, i don't have an actor as expected :

    2018-05-15 22:19:33,766 [6] ERROR Photon.Hive.HiveGame.HiveHostGame.Plugin - On leave called!!!!!!!!!!!!!!!!
    2018-05-15 22:19:33,771 [6] ERROR Photon.Hive.HiveGame.HiveHostGame.Plugin - 1
    2018-05-15 22:19:33,777 [6] ERROR Photon.Hive.HiveGame.HiveHostGame.Plugin - False
    2018-05-15 22:19:33,782 [6] ERROR Photon.Hive.HiveGame.HiveHostGame.Plugin - 101
    2018-05-15 22:19:33,788 [6] ERROR Photon.Hive.HiveGame.HiveHostGame.Plugin -
    2018-05-15 22:19:33,801 [6] ERROR Photon.Hive.HiveGame.HiveHostGame.Plugin - check actors



    case 2, when I call disconnect, I have an inactive actor as expected

    2018-05-15 22:20:10,484 [21] ERROR Photon.Hive.HiveGame.HiveHostGame.Plugin - On leave called!!!!!!!!!!!!!!!!
    2018-05-15 22:20:10,490 [21] ERROR Photon.Hive.HiveGame.HiveHostGame.Plugin - 1
    2018-05-15 22:20:10,495 [21] ERROR Photon.Hive.HiveGame.HiveHostGame.Plugin - True
    2018-05-15 22:20:10,501 [21] ERROR Photon.Hive.HiveGame.HiveHostGame.Plugin - 0
    2018-05-15 22:20:10,506 [21] ERROR Photon.Hive.HiveGame.HiveHostGame.Plugin -
    2018-05-15 22:20:10,514 [21] ERROR Photon.Hive.HiveGame.HiveHostGame.Plugin - check actors
    2018-05-15 22:20:10,519 [21] ERROR Photon.Hive.HiveGame.HiveHostGame.Plugin - Actor: 1; Peer:'', DeactivationTime:'5/15/2018 10:20:10 PM', UserId:'114',nick:'auser'
    2018-05-15 22:20:10,526 [21] ERROR Photon.Hive.HiveGame.HiveHostGame.Plugin - 1


    !!!case 3, the case i am having problem with, when my phone connection is lost (losing wifi, going into background etc.), I don't have an actor

    2018-05-15 22:35:27,240 [14] ERROR Photon.Hive.HiveGame.HiveHostGame.Plugin - On leave called!!!!!!!!!!!!!!!!
    2018-05-15 22:35:27,246 [14] ERROR Photon.Hive.HiveGame.HiveHostGame.Plugin - 1
    2018-05-15 22:35:27,251 [14] ERROR Photon.Hive.HiveGame.HiveHostGame.Plugin - False
    2018-05-15 22:35:27,256 [14] ERROR Photon.Hive.HiveGame.HiveHostGame.Plugin - 4
    2018-05-15 22:35:27,260 [14] ERROR Photon.Hive.HiveGame.HiveHostGame.Plugin -
    000000000861C1C0 Sent: 178385203 now: 178415984 (diff: 30781 >= max: 30000) new rtt timeout: 3200 since last touch:31797
    Disc: Seq: 5 CH: 255 RTT: 173 VAR: 151 Now: 178415984 Sent: 178385203 Diff: 30781 Resends: 8
    Resend: Seq: 5 CH: 255 RTT: 173 VAR: 151 Now: 178411921 Timeout: 3200 Resend: 8
    Resend: Seq: 5 CH: 255 RTT: 173 VAR: 151 Now: 178407859 Timeout: 3200 Resend: 7
    Resend: Seq: 5 CH: 255 RTT: 173 VAR: 151 Now: 178403796 Timeout: 3200 Resend: 6
    Resend: Seq: 5 CH: 255 RTT: 173 VAR: 151 Now: 178399734 Timeout: 3200 Resend: 5
    Resend: Seq: 5 CH: 255 RTT: 173 VAR: 151 Now: 178395671 Timeout: 3200 Resend: 4
    Resend: Seq: 5 CH: 255 RTT: 173 VAR: 151 Now: 178391609 Timeout: 3200 Resend: 3
    Resend: Seq: 5 CH: 255 RTT: 173 VAR: 151 Now: 178387546 Timeout: 3108 Resend: 2
    Resend: Seq: 5 CH: 255 RTT: 173 VAR: 151 Now: 178385984 Timeout: 1554 Resend: 1
    ACK: Seq: 4 CH: 255 RTT: 173 VAR: 151 Now: 178384125 Sent: 178384093 Diff: 32
    ACK: Seq: 3 CH: 255 RTT: 193 VAR: 154 Now: 178382937 Sent: 178382875 Diff: 62
    ACK: Seq: 2 CH: 255 RTT: 211 VAR: 162 Now: 178381859 Sent: 178381828 Diff: 31
    ACK: Seq: 1 CH: 255 RTT: 236 VAR: 155 Now: 178379921 Sent: 178379687 Diff: 234
    ACK: Seq: 6 CH: 0 RTT: 236 VAR: 206 Now: 178377703 Sent: 178377656 Diff: 47
    ACK: Seq: 5 CH: 0 RTT: 262 VAR: 212 Now: 178377703 Sent: 178377656 Diff: 47
    ACK: Seq: 4 CH: 0 RTT: 292 VAR: 211 Now: 178377703 Sent: 178377656 Diff: 47
    ACK: Seq: 3 CH: 0 RTT: 327 VAR: 200 Now: 178377625 Sent: 178377546 Diff: 79
    ACK: Seq: 2 CH: 0 RTT: 362 VAR: 184 Now: 178377531 Sent: 178377453 Diff: 78
    ACK: Seq: 1 CH: 0 RTT: 402 VAR: 150 Now: 178377437 Sent: 178377359 Diff: 78
    ACK: Seq: 0 CH: 255 RTT: 448 VAR: 92 Now: 178377343 Sent: 178377265 Diff: 78
    Init: RTT: 500
    2018-05-15 22:35:27,264 [14] ERROR Photon.Hive.HiveGame.HiveHostGame.Plugin - check actors
  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @ltx,

    Thank you for choosing Photon and for reporting this!

    I think this could be due to a bug that is already fixed on Photon Cloud which runs newer version of Photon Server.

    Workaround: use int.MaxValue instead of -1 of PlayerTTL.
  • Hi @JohnTube ,

    I tried that as well, seem to have the same problem. I can double confirm tomorrow. When will the next version of photon server be available for download?

    Ting
  • JohnTube
    JohnTube ✭✭✭✭✭
    I tried that as well, seem to have the same problem.
    hmm. Could you try a strictly positive value between (inclusive) 1 and int.MaxValue - 1?

    When will the next version of photon server be available for download?
    Soon but not ETA sorry.
  • Hi @JohnTube ,

    That worked!!! so I tried 3600000 (an hour) and it worked as expected. So only -1 and int.MaxValue are failing. Well that's good enough for me. Better make a note somewhere tho. Thanks again for the help

    cheers,
    Ting