0.15.21.0
This commit is contained in:
@@ -9,7 +9,7 @@ namespace Barotrauma.Networking
|
||||
static class NetIdUtils
|
||||
{
|
||||
/// <summary>
|
||||
/// Is newID more recent than oldID
|
||||
/// Is newID more recent than oldID, i.e. newId > oldId accounting for ushort rollover
|
||||
/// </summary>
|
||||
public static bool IdMoreRecent(ushort newID, ushort oldID)
|
||||
{
|
||||
@@ -22,6 +22,12 @@ namespace Barotrauma.Networking
|
||||
(id2 > id1) && (id2 - id1 > ushort.MaxValue / 2);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// newId >= oldId accounting for ushort rollover (newer or equals)
|
||||
/// </summary>
|
||||
public static bool IdMoreRecentOrMatches(ushort newId, ushort oldId)
|
||||
=> !IdMoreRecent(oldId, newId);
|
||||
|
||||
public static ushort Difference(ushort id1, ushort id2)
|
||||
{
|
||||
int diff = id2 > id1 ? id2 - id1 : id1 - id2;
|
||||
|
||||
Reference in New Issue
Block a user