detect dead connections

This commit is contained in:
in0finite 2019-07-09 02:28:09 +02:00
parent d022f6bb41
commit 5d2363d7fa
2 changed files with 15 additions and 2 deletions

View file

@ -98,6 +98,21 @@ namespace SanAndreasUnity.Net
m_ownedPed = m_ownedGameObject != null ? m_ownedGameObject.GetComponent<Ped>() : null;
}
void Update()
{
// 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)
{
// disconnect client
this.connectionToClient.Disconnect();
}
}
}
}
}

View file

@ -16,8 +16,6 @@
- fix connection timeout bug
- add current date to logs
- create weapon prefab ; add it to spawnable prefabs list ;