Files
RobustToolbox/SS14.Server/ClientConsoleHost/Commands/ListCommands.cs
Acruid 6247ff4eff Console Rework (#483)
* Extracted the logic from DebugConsole into a new ClientConsole class.

* ClientConsole moved to IoC system.
Verb system replaced with concmds.

* Shared Cleanup

* ClientChatConsole skeleton.

* DebugConsole and LobbyChat are now both subscribed to ClientChatConsole.

* Removed server chat commands.

* cleaned up server command sysyem.

* More chat handling, and aliasing.

* Nightly work on Say command.

* Fixes a bug in Maths.Angle.

* Chat channel colors moved to ClientChatConsole.

* Now Server commands are sent without opening DebugConsole.

* Emotes work.
Clientside chat formatting works.

* Fixed angle unit test.
2018-01-04 00:53:41 +01:00

25 lines
968 B
C#

using System.Text;
using SS14.Server.Interfaces.ClientConsoleHost;
using SS14.Server.Interfaces.Player;
namespace SS14.Server.ClientConsoleHost.Commands
{
public class ListCommands : IClientCommand
{
public string Command => "sv_list";
public string Description => "Lists all available commands.";
public string Help => "Outputs a list of all commands which are currently available to you, and a total command number.";
public void Execute(IClientConsoleHost host, IPlayerSession player, params string[] args)
{
var builder = new StringBuilder("Available commands:\n");
foreach (var command in host.AvailableCommands.Values)
{
builder.AppendFormat("{0}: {1}\n", command.Command, command.Description);
}
var message = builder.ToString().Trim(' ', '\n');
host.SendConsoleReply(player.ConnectedClient, message);
}
}
}