Server doesn't attempt to resend unacked EntityEvents until Connection.AverageRoundTripTime has passed

This commit is contained in:
Regalis
2016-11-13 14:45:00 +02:00
parent 498c72c64a
commit 724172fe7c
5 changed files with 47 additions and 3 deletions

View File

@@ -26,6 +26,28 @@ namespace Barotrauma.Networking
{
this.Data = data;
}
public bool IsDuplicate(NetEntityEvent other)
{
if (other.Entity != this.Entity) return false;
if (Data != null && other.Data != null)
{
if (Data.Length == other.Data.Length)
{
for (int i = 0; i<Data.Length; i++)
{
if (Data[i] != other.Data[i]) return false;
}
}
else
{
return false;
}
}
return Data == other.Data;
}
}
class ServerEntityEvent : NetEntityEvent