mirror of
https://github.com/tribufu/ServerManagers
synced 2026-05-06 15:17:34 +00:00
Rcon Command Changes
- moved the rcon commands to the gamedata files, so they can be extended.
This commit is contained in:
parent
f3ff807cd0
commit
e7100e6323
18 changed files with 266 additions and 152 deletions
|
|
@ -26,9 +26,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_ALERT = "alert";
|
||||
public const string RCON_COMMAND_SERVER = "server";
|
||||
public const string RCON_COMMAND_LISTPLAYERS = "listplayers";
|
||||
|
||||
public event EventHandler PlayersCollectionUpdated;
|
||||
|
|
@ -274,22 +271,13 @@ namespace ServerManagerTool.Lib
|
|||
command.suppressOutput = command.lines.Count() == 0;
|
||||
}
|
||||
|
||||
if (command?.command?.Equals(RCON_COMMAND_BROADCAST, StringComparison.OrdinalIgnoreCase) ?? false)
|
||||
foreach (var item in GameData.GetMessageRconInputModes())
|
||||
{
|
||||
LogEvent(LogEventType.Chat, command.rawCommand);
|
||||
command.suppressOutput = true;
|
||||
}
|
||||
|
||||
if (command?.command?.Equals(RCON_COMMAND_ALERT, StringComparison.OrdinalIgnoreCase) ?? false)
|
||||
{
|
||||
LogEvent(LogEventType.Chat, command.rawCommand);
|
||||
command.suppressOutput = true;
|
||||
}
|
||||
|
||||
if (command?.command?.Equals(RCON_COMMAND_SERVER, StringComparison.OrdinalIgnoreCase) ?? false)
|
||||
{
|
||||
LogEvent(LogEventType.Chat, command.rawCommand);
|
||||
command.suppressOutput = true;
|
||||
if (command?.command?.Equals(item.ValueMember, StringComparison.OrdinalIgnoreCase) ?? false)
|
||||
{
|
||||
LogEvent(LogEventType.Chat, command.rawCommand);
|
||||
command.suppressOutput = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue