WIP Make networking code thread-safe and refactor update ID
Replaces direct increments of LastClientListUpdateID with a thread-safe IncrementLastClientListUpdateID method and uses Interlocked for atomic operations. Refactors EntitySpawner to lock access to the spawn/remove queue for thread safety. Updates INetSerializableStruct to use concurrent collections for cached variables and type behaviors, improving thread safety in networking code.
This commit is contained in:
@@ -163,7 +163,7 @@ namespace Barotrauma
|
||||
{
|
||||
client.Character.CharacterHealth.ApplyAffliction(null, new Affliction(herpesAffliction, herpesStrength));
|
||||
GameServer.Log($"{GameServer.ClientLogName(client)} has contracted space herpes due to low karma.", ServerLog.MessageType.Karma);
|
||||
GameMain.NetworkMember.LastClientListUpdateID++;
|
||||
GameMain.NetworkMember.IncrementLastClientListUpdateID();
|
||||
}
|
||||
else if (existingAffliction != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user