Servers can disable the disguise feature. Closes #568
This commit is contained in:
@@ -70,6 +70,12 @@ namespace Barotrauma.Networking
|
|||||||
get { return entityEventManager.MidRoundSyncing; }
|
get { return entityEventManager.MidRoundSyncing; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool AllowDisguises
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
private set;
|
||||||
|
}
|
||||||
|
|
||||||
public GameClient(string newName)
|
public GameClient(string newName)
|
||||||
{
|
{
|
||||||
endVoteTickBox = new GUITickBox(new Rectangle(GameMain.GraphicsWidth - 170, 20, 20, 20), "End round", Alignment.TopLeft, inGameHUD);
|
endVoteTickBox = new GUITickBox(new Rectangle(GameMain.GraphicsWidth - 170, 20, 20, 20), "End round", Alignment.TopLeft, inGameHUD);
|
||||||
@@ -705,6 +711,7 @@ namespace Barotrauma.Networking
|
|||||||
bool respawnAllowed = inc.ReadBoolean();
|
bool respawnAllowed = inc.ReadBoolean();
|
||||||
bool loadSecondSub = inc.ReadBoolean();
|
bool loadSecondSub = inc.ReadBoolean();
|
||||||
|
|
||||||
|
bool disguisesAllowed = inc.ReadBoolean();
|
||||||
bool isTraitor = inc.ReadBoolean();
|
bool isTraitor = inc.ReadBoolean();
|
||||||
string traitorTargetName = isTraitor ? inc.ReadString() : null;
|
string traitorTargetName = isTraitor ? inc.ReadString() : null;
|
||||||
|
|
||||||
@@ -743,6 +750,8 @@ namespace Barotrauma.Networking
|
|||||||
|
|
||||||
GameMain.NetLobbyScreen.UsingShuttle = usingShuttle;
|
GameMain.NetLobbyScreen.UsingShuttle = usingShuttle;
|
||||||
|
|
||||||
|
AllowDisguises = disguisesAllowed;
|
||||||
|
|
||||||
if (campaign == null)
|
if (campaign == null)
|
||||||
{
|
{
|
||||||
if (!GameMain.NetLobbyScreen.TrySelectSub(subName, subHash, GameMain.NetLobbyScreen.SubList))
|
if (!GameMain.NetLobbyScreen.TrySelectSub(subName, subHash, GameMain.NetLobbyScreen.SubList))
|
||||||
|
|||||||
@@ -144,6 +144,10 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
get
|
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;
|
return info != null && !string.IsNullOrWhiteSpace(info.Name) ? info.Name + (info.DisplayName != info.Name ? " (as " + info.DisplayName + ")" : "") : SpeciesName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,11 +17,16 @@ namespace Barotrauma
|
|||||||
get
|
get
|
||||||
{
|
{
|
||||||
string disguiseName = "?";
|
string disguiseName = "?";
|
||||||
if (Character == null || !Character.HideFace)
|
if (Character == null || !Character.HideFace || (GameMain.Server != null && !GameMain.Server.AllowDisguises))
|
||||||
{
|
{
|
||||||
return Name;
|
return Name;
|
||||||
}
|
}
|
||||||
|
#if CLIENT
|
||||||
|
if (GameMain.Client != null && !GameMain.Client.AllowDisguises)
|
||||||
|
{
|
||||||
|
return Name;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (Character.Inventory != null)
|
if (Character.Inventory != null)
|
||||||
{
|
{
|
||||||
int cardSlotIndex = Character.Inventory.FindLimbSlot(InvSlotType.Card);
|
int cardSlotIndex = Character.Inventory.FindLimbSlot(InvSlotType.Card);
|
||||||
|
|||||||
@@ -1456,6 +1456,8 @@ namespace Barotrauma.Networking
|
|||||||
msg.Write(AllowRespawn && missionAllowRespawn);
|
msg.Write(AllowRespawn && missionAllowRespawn);
|
||||||
msg.Write(Submarine.MainSubs[1] != null); //loadSecondSub
|
msg.Write(Submarine.MainSubs[1] != null); //loadSecondSub
|
||||||
|
|
||||||
|
msg.Write(AllowDisguises);
|
||||||
|
|
||||||
Traitor traitor = null;
|
Traitor traitor = null;
|
||||||
if (TraitorManager != null && TraitorManager.TraitorList.Count > 0)
|
if (TraitorManager != null && TraitorManager.TraitorList.Count > 0)
|
||||||
traitor = TraitorManager.TraitorList.Find(t => t.Character == client.Character);
|
traitor = TraitorManager.TraitorList.Find(t => t.Character == client.Character);
|
||||||
|
|||||||
@@ -177,6 +177,13 @@ namespace Barotrauma.Networking
|
|||||||
set;
|
set;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Serialize(true, true)]
|
||||||
|
public bool AllowDisguises
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
|
||||||
public YesNoMaybe TraitorsEnabled
|
public YesNoMaybe TraitorsEnabled
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
|
|||||||
Reference in New Issue
Block a user