increase interval for detecting dead connections to 20 seconds

This commit is contained in:
in0finite 2022-05-01 07:06:36 +02:00
parent 3ba5057798
commit 3b89d15e4c

View file

@ -151,7 +151,9 @@ namespace SanAndreasUnity.Net
// Telepathy does not detect dead connections, so we'll have to detect them ourselves
if (NetStatus.IsServer && !this.isLocalPlayer)
{
if (Time.time - this.connectionToClient.lastMessageTime > 6f)
// use 20 seconds to allow slow clients (eg. mobile phones) to initialize scene or do some other
// blocking operation
if (Time.time - this.connectionToClient.lastMessageTime > 20f)
{
// disconnect client
Debug.LogFormat("Detected dead connection for player {0}", this.DescriptionForLogging);