diff --git a/Barotrauma/BarotraumaClient/Source/DebugConsole.cs b/Barotrauma/BarotraumaClient/Source/DebugConsole.cs index 19d86a62f..b095508b2 100644 --- a/Barotrauma/BarotraumaClient/Source/DebugConsole.cs +++ b/Barotrauma/BarotraumaClient/Source/DebugConsole.cs @@ -394,7 +394,7 @@ namespace Barotrauma NewMessage(GUI.DisableHUD ? "Disabled HUD" : "Enabled HUD", Color.White); })); - commands.Add(new Command("followsub", "followsub: Toggle whether the ", (string[] args) => + commands.Add(new Command("followsub", "followsub: Toggle whether the camera should follow the nearest submarine.", (string[] args) => { Camera.FollowSub = !Camera.FollowSub; NewMessage(Camera.FollowSub ? "Set the camera to follow the closest submarine" : "Disabled submarine following.", Color.White); diff --git a/Barotrauma/BarotraumaServer/Source/DebugConsole.cs b/Barotrauma/BarotraumaServer/Source/DebugConsole.cs index 0d31c1d48..7204c5899 100644 --- a/Barotrauma/BarotraumaServer/Source/DebugConsole.cs +++ b/Barotrauma/BarotraumaServer/Source/DebugConsole.cs @@ -14,7 +14,7 @@ namespace Barotrauma { lock (QueuedCommands) { - while (QueuedCommands.Count>0) + while (QueuedCommands.Count > 0) { ExecuteCommand(QueuedCommands[0]); QueuedCommands.RemoveAt(0); @@ -190,6 +190,16 @@ namespace Barotrauma NewMessage(ent.ToString(), Color.Lime); } })); + + //"dummy commands" that only exist so that the server can give clients permissions to use them + commands.Add(new Command("control|controlcharacter", "control [character name]: Start controlling the specified character (client-only).", null)); + commands.Add(new Command("los", "Toggle the line of sight effect on/off (client-only).", null)); + commands.Add(new Command("lighting|lights", "Toggle lighting on/off (client-only).", null)); + commands.Add(new Command("debugdraw", "Toggle the debug drawing mode on/off (client-only).", null)); + commands.Add(new Command("togglehud|hud", "Toggle the character HUD (inventories, icons, buttons, etc) on/off (client-only).", null)); + commands.Add(new Command("followsub", "Toggle whether the camera should follow the nearest submarine (client-only).", null)); + commands.Add(new Command("toggleaitargets|aitargets", "Toggle the visibility of AI targets (= targets that enemies can detect and attack/escape from) (client-only).", null)); + #if DEBUG commands.Add(new Command("eventdata", "", (string[] args) => { diff --git a/Barotrauma/BarotraumaShared/Source/DebugConsole.cs b/Barotrauma/BarotraumaShared/Source/DebugConsole.cs index 3a9a9a714..37740d5da 100644 --- a/Barotrauma/BarotraumaShared/Source/DebugConsole.cs +++ b/Barotrauma/BarotraumaShared/Source/DebugConsole.cs @@ -88,6 +88,7 @@ namespace Barotrauma public void Execute(string[] args) { + if (onExecute == null) return; onExecute(args); } @@ -100,6 +101,7 @@ namespace Barotrauma { if (onClientRequestExecute == null) { + if (onExecute == null) return; onExecute(args); } else