Reapply "OBT1.1.0 Merge branch 'dev_pte' into dev"

This reverts commit 046483b9da.
This commit is contained in:
NotAlwaysTrue
2026-04-30 21:59:54 +08:00
parent 02689d0d86
commit 25683dcf39
85 changed files with 2413 additions and 779 deletions
@@ -1,6 +1,7 @@
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.Threading;
namespace Barotrauma.Networking
{
@@ -183,10 +184,19 @@ namespace Barotrauma.Networking
{
protected const int MaxSubNameLengthInErrorMessages = 16;
private int lastClientListUpdateID;
public UInt16 LastClientListUpdateID
{
get;
set;
get => (UInt16)Interlocked.CompareExchange(ref lastClientListUpdateID, 0, 0);
set => Interlocked.Exchange(ref lastClientListUpdateID, value);
}
/// <summary>
/// Thread-safe increment of LastClientListUpdateID
/// </summary>
public void IncrementLastClientListUpdateID()
{
Interlocked.Increment(ref lastClientListUpdateID);
}
public abstract bool IsServer { get; }