@@ -489,8 +489,7 @@ namespace Barotrauma.Networking
|
|||||||
DebugConsole.Command command = DebugConsole.FindCommand(commandName);
|
DebugConsole.Command command = DebugConsole.FindCommand(commandName);
|
||||||
if (command == null)
|
if (command == null)
|
||||||
{
|
{
|
||||||
DebugConsole.ThrowError("Error in " + ClientPermissionsFile + " - \"" + commandName + "\" is not a valid console command.");
|
command = new DebugConsole.Command(commandName, "", (_) => {}, null, true);
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
permittedCommands.Add(command);
|
permittedCommands.Add(command);
|
||||||
|
|||||||
@@ -507,6 +507,21 @@ namespace Barotrauma
|
|||||||
|
|
||||||
luaAddedCommand.Add(cmd);
|
luaAddedCommand.Add(cmd);
|
||||||
DebugConsole.Commands.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<DebugConsole.Command> Commands => DebugConsole.Commands;
|
public List<DebugConsole.Command> Commands => DebugConsole.Commands;
|
||||||
|
|||||||
Reference in New Issue
Block a user