diff --git a/Barotrauma/BarotraumaServer/ServerSource/Networking/ServerSettings.cs b/Barotrauma/BarotraumaServer/ServerSource/Networking/ServerSettings.cs index 9f9e10a7c..7103fa6e9 100644 --- a/Barotrauma/BarotraumaServer/ServerSource/Networking/ServerSettings.cs +++ b/Barotrauma/BarotraumaServer/ServerSource/Networking/ServerSettings.cs @@ -489,8 +489,7 @@ namespace Barotrauma.Networking DebugConsole.Command command = DebugConsole.FindCommand(commandName); if (command == null) { - DebugConsole.ThrowError("Error in " + ClientPermissionsFile + " - \"" + commandName + "\" is not a valid console command."); - continue; + command = new DebugConsole.Command(commandName, "", (_) => {}, null, true); } permittedCommands.Add(command); diff --git a/Barotrauma/BarotraumaShared/SharedSource/Lua/LuaClasses.cs b/Barotrauma/BarotraumaShared/SharedSource/Lua/LuaClasses.cs index 6d13ffca1..d5f0d2b3d 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/Lua/LuaClasses.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/Lua/LuaClasses.cs @@ -507,6 +507,21 @@ namespace Barotrauma luaAddedCommand.Add(cmd); DebugConsole.Commands.Add(cmd); + +#if SERVER + foreach (var client in GameMain.Server.ConnectedClients) { + var index = client.PermittedConsoleCommands.FindIndex((pc) => pc.names[0] == cmd.names[0]); + if (index > -1) { + client.PermittedConsoleCommands[index] = cmd; + } + } + foreach (var permissions in GameMain.Server.ServerSettings.ClientPermissions) { + var index = permissions.PermittedCommands.FindIndex((pc) => pc.names[0] == cmd.names[0]); + if (index > -1) { + permissions.PermittedCommands[index] = cmd; + } + } +#endif } public List Commands => DebugConsole.Commands;