mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-10 06:34:16 +00:00
detect dead connections
This commit is contained in:
parent
d022f6bb41
commit
5d2363d7fa
2 changed files with 15 additions and 2 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
|
||||
- fix connection timeout bug
|
||||
|
||||
- add current date to logs
|
||||
|
||||
|
||||
- create weapon prefab ; add it to spawnable prefabs list ;
|
||||
|
||||
|
|
Loading…
Reference in a new issue