Broadcast Message Changes

1. Added config option for auto processes to use broadcast keyword
2. Added config to global settings
This commit is contained in:
Brett Hewitson 2022-03-22 22:20:37 +10:00
parent 220b3d9c77
commit fc658b04dd
22 changed files with 196 additions and 55 deletions

View file

@ -27,8 +27,9 @@ namespace ServerManagerTool
public enum InputMode
{
Command,
//Global,
Broadcast,
Alert,
Server,
}
public enum InputWindowMode
@ -633,12 +634,20 @@ namespace ServerManagerTool
switch (effectiveMode)
{
case InputMode.Command:
this.ServerRcon.IssueCommand(commandText);
break;
case InputMode.Broadcast:
this.ServerRcon.IssueCommand($"{ServerRcon.RCON_COMMAND_BROADCAST} {commandText}");
break;
case InputMode.Command:
this.ServerRcon.IssueCommand(commandText);
case InputMode.Alert:
this.ServerRcon.IssueCommand($"{ServerRcon.RCON_COMMAND_ALERT} {commandText}");
break;
case InputMode.Server:
this.ServerRcon.IssueCommand($"{ServerRcon.RCON_COMMAND_SERVER} {commandText}");
break;
}
@ -737,6 +746,14 @@ namespace ServerManagerTool
{
yield return new RconOutput_Broadcast(command.args);
}
else if(command.command.Equals(ServerRcon.RCON_COMMAND_ALERT, StringComparison.OrdinalIgnoreCase))
{
yield return new RconOutput_Broadcast(command.args);
}
else if(command.command.Equals(ServerRcon.RCON_COMMAND_SERVER, StringComparison.OrdinalIgnoreCase))
{
yield return new RconOutput_Broadcast(command.args);
}
else
{
yield return new RconOutput_Command($"> {command.rawCommand}");