Rcon Command Changes

- moved the rcon commands to the gamedata files, so they can be extended.
This commit is contained in:
Brett Hewitson 2022-06-14 12:55:58 +10:00
parent f3ff807cd0
commit e7100e6323
18 changed files with 266 additions and 152 deletions

View file

@ -29,7 +29,6 @@ namespace ServerManagerTool.Lib
private const string NoResponseMatch = "Server received, But no response!!";
public const string NoResponseOutput = "NO_RESPONSE";
public const string RCON_COMMAND_BROADCAST = "broadcast";
public const string RCON_COMMAND_LISTPLAYERS = "listplayers";
public const string RCON_COMMAND_GETCHAT = "getchat";
public const string RCON_COMMAND_SERVERCHAT = "serverchat";
@ -315,18 +314,21 @@ namespace ServerManagerTool.Lib
}
}
}
if (command.command.Equals(RCON_COMMAND_BROADCAST, StringComparison.OrdinalIgnoreCase))
{
LogEvent(LogEventType.Chat, command.rawCommand);
command.suppressOutput = true;
}
if (command.command.Equals(RCON_COMMAND_SERVERCHAT, StringComparison.OrdinalIgnoreCase))
{
LogEvent(LogEventType.Chat, command.rawCommand);
command.suppressOutput = true;
}
foreach (var item in GameData.GetMessageRconInputModes())
{
if (command.command.Equals(item.ValueMember, StringComparison.OrdinalIgnoreCase))
{
LogEvent(LogEventType.Chat, command.rawCommand);
command.suppressOutput = true;
}
}
}
// This is bound to the UI thread