diff --git a/Barotrauma/BarotraumaClient/Source/Networking/GameClient.cs b/Barotrauma/BarotraumaClient/Source/Networking/GameClient.cs index 20038608c..cdfcd3de6 100644 --- a/Barotrauma/BarotraumaClient/Source/Networking/GameClient.cs +++ b/Barotrauma/BarotraumaClient/Source/Networking/GameClient.cs @@ -69,6 +69,12 @@ namespace Barotrauma.Networking { get { return entityEventManager.MidRoundSyncing; } } + + public bool AllowDisguises + { + get; + private set; + } public GameClient(string newName) { @@ -705,6 +711,7 @@ namespace Barotrauma.Networking bool respawnAllowed = inc.ReadBoolean(); bool loadSecondSub = inc.ReadBoolean(); + bool disguisesAllowed = inc.ReadBoolean(); bool isTraitor = inc.ReadBoolean(); string traitorTargetName = isTraitor ? inc.ReadString() : null; @@ -743,6 +750,8 @@ namespace Barotrauma.Networking GameMain.NetLobbyScreen.UsingShuttle = usingShuttle; + AllowDisguises = disguisesAllowed; + if (campaign == null) { if (!GameMain.NetLobbyScreen.TrySelectSub(subName, subHash, GameMain.NetLobbyScreen.SubList)) diff --git a/Barotrauma/BarotraumaShared/Source/Characters/Character.cs b/Barotrauma/BarotraumaShared/Source/Characters/Character.cs index 4ba534488..2448c2439 100644 --- a/Barotrauma/BarotraumaShared/Source/Characters/Character.cs +++ b/Barotrauma/BarotraumaShared/Source/Characters/Character.cs @@ -144,6 +144,10 @@ namespace Barotrauma { get { + if (GameMain.Server != null && !GameMain.Server.AllowDisguises) return Name; +#if CLIENT + if (GameMain.Client != null && !GameMain.Client.AllowDisguises) return Name; +#endif return info != null && !string.IsNullOrWhiteSpace(info.Name) ? info.Name + (info.DisplayName != info.Name ? " (as " + info.DisplayName + ")" : "") : SpeciesName; } } diff --git a/Barotrauma/BarotraumaShared/Source/Characters/CharacterInfo.cs b/Barotrauma/BarotraumaShared/Source/Characters/CharacterInfo.cs index ff85a049e..23898e360 100644 --- a/Barotrauma/BarotraumaShared/Source/Characters/CharacterInfo.cs +++ b/Barotrauma/BarotraumaShared/Source/Characters/CharacterInfo.cs @@ -17,11 +17,16 @@ namespace Barotrauma get { string disguiseName = "?"; - if (Character == null || !Character.HideFace) + if (Character == null || !Character.HideFace || (GameMain.Server != null && !GameMain.Server.AllowDisguises)) { return Name; } - +#if CLIENT + if (GameMain.Client != null && !GameMain.Client.AllowDisguises) + { + return Name; + } +#endif if (Character.Inventory != null) { int cardSlotIndex = Character.Inventory.FindLimbSlot(InvSlotType.Card); diff --git a/Barotrauma/BarotraumaShared/Source/Networking/GameServer.cs b/Barotrauma/BarotraumaShared/Source/Networking/GameServer.cs index cc51749cb..f10433eba 100644 --- a/Barotrauma/BarotraumaShared/Source/Networking/GameServer.cs +++ b/Barotrauma/BarotraumaShared/Source/Networking/GameServer.cs @@ -1456,6 +1456,8 @@ namespace Barotrauma.Networking msg.Write(AllowRespawn && missionAllowRespawn); msg.Write(Submarine.MainSubs[1] != null); //loadSecondSub + msg.Write(AllowDisguises); + Traitor traitor = null; if (TraitorManager != null && TraitorManager.TraitorList.Count > 0) traitor = TraitorManager.TraitorList.Find(t => t.Character == client.Character); diff --git a/Barotrauma/BarotraumaShared/Source/Networking/GameServerSettings.cs b/Barotrauma/BarotraumaShared/Source/Networking/GameServerSettings.cs index 3e3708352..ae3c37d1c 100644 --- a/Barotrauma/BarotraumaShared/Source/Networking/GameServerSettings.cs +++ b/Barotrauma/BarotraumaShared/Source/Networking/GameServerSettings.cs @@ -177,6 +177,13 @@ namespace Barotrauma.Networking set; } + [Serialize(true, true)] + public bool AllowDisguises + { + get; + set; + } + public YesNoMaybe TraitorsEnabled { get;