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
@@ -327,7 +327,7 @@ namespace Barotrauma.Networking
}
}
LastClientListUpdateID++;
IncrementLastClientListUpdateID();
if (newClient.Connection == OwnerConnection && OwnerConnection != null)
{
@@ -3212,7 +3212,7 @@ namespace Barotrauma.Networking
initiatedStartGame = false;
GameMain.ResetFrameTime();
LastClientListUpdateID++;
IncrementLastClientListUpdateID();
roundStartTime = DateTime.Now;
@@ -3511,7 +3511,7 @@ namespace Barotrauma.Networking
{
var coolDownRemaining = Client.NameChangeCoolDown - timeSinceNameChange;
SendDirectChatMessage($"ServerMessage.NameChangeFailedCooldownActive~[seconds]={(int)coolDownRemaining.TotalSeconds}", c);
LastClientListUpdateID++;
IncrementLastClientListUpdateID();
//increment the ID to make sure the current server-side name is treated as the "latest",
//and the client correctly reverts back to the old name
c.NameId++;
@@ -3525,7 +3525,7 @@ namespace Barotrauma.Networking
if (result != null)
{
LastClientListUpdateID++;
IncrementLastClientListUpdateID();
return result.Value;
}
@@ -3542,14 +3542,14 @@ namespace Barotrauma.Networking
c.Name = newName;
c.RejectedName = string.Empty;
SendChatMessage($"ServerMessage.NameChangeSuccessful~[oldname]={oldName}~[newname]={newName}", ChatMessageType.Server);
LastClientListUpdateID++;
IncrementLastClientListUpdateID();
return true;
}
else
{
//update client list even if the name cannot be changed to the one sent by the client,
//so the client will be informed what their actual name is
LastClientListUpdateID++;
IncrementLastClientListUpdateID();
return false;
}
}
@@ -4841,7 +4841,7 @@ namespace Barotrauma.Networking
private void UpdateClientLobbies()
{
// Triggers a call to WriteClientList(), which causes clients to call GameClient.ReadClientList()
LastClientListUpdateID++;
IncrementLastClientListUpdateID();
}
private List<Client> GetPlayingClients()