Players with bad connection

OneManArmy
OneManArmy ✭✭✭
How to deal with players who has bad connection? High ping is not problem in most cases, but when player teleports constantly (is not sending/receiving for a second, or even more) it leads to problems (at least in my case).
Maybe there is a way to constantly check connection on client?

Comments

  • I'm also facing something similar, which is causing disconnects. one of the most useful things im searching for is the ability to get the disconnect cause (when its me playing and from unity) then I can find out what's going on.

    i'm watching this thread
  • This topic is not about disconnects.
    When player loses connection on short periods of time, he will not be disconnected from game. Player still can trigger events, but RPC's will be sent as soon as connection establishes. I want to prevent even triggering events.

    I had few ideas (use master, include time in RPC's), but it will not solve problem in my case.
    Is there way for client to check connection with server?
  • Hi @OneManArmy,

    at first you can take a look at PhotonNetwork.GetPing() to get the round trip time to the server. The RTT is the time it takes the client from sending something to the server and receiving any kind of answer from the server.

    You can have another look at PhotonNetwork.ResentReliableCommands which counts the amount of reliable commands that had to be sent again. With this information, you might find a good value for PhotonNetwork.MaxResendsBeforeDisconnect. This value defines the number of times a reliable message can be resent without getting an ACK from the server. If this value is exceeded, the client gets disconnected.

    You can also add the PhotonStatsGui component to any object in the scene. This component visualizes some of the network stats mentioned above and others.
  • Seems that PhotonNetwork.ResentReliableCommands is what i was looking for.
    Thanks Christian.