mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-24 21:46:52 +01:00
Required parameters
This commit is contained in:
@@ -40,11 +40,12 @@ namespace TGServerService
|
||||
class ServerChatCommand : ChatCommand
|
||||
{
|
||||
readonly string HelpText;
|
||||
public ServerChatCommand(string name, string helpText, bool adminOnly)
|
||||
public ServerChatCommand(string name, string helpText, bool adminOnly, int requiredParameters)
|
||||
{
|
||||
Keyword = name;
|
||||
RequiresAdmin = adminOnly;
|
||||
HelpText = helpText;
|
||||
RequiredParameters = requiredParameters;
|
||||
}
|
||||
|
||||
public override string GetHelpText()
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace TGServerService
|
||||
try
|
||||
{
|
||||
foreach(var I in new JavaScriptSerializer().Deserialize<IDictionary<string, IDictionary<string, object>>>(json))
|
||||
tmp.Add(new ServerChatCommand(I.Key, (string)I.Value["help_text"], (bool)I.Value["adminOnly"]));
|
||||
tmp.Add(new ServerChatCommand(I.Key, (string)I.Value["help_text"], (bool)I.Value["adminOnly"], (int)I.Value["required_parameters"]));
|
||||
ServerChatCommands = tmp;
|
||||
}
|
||||
catch { }
|
||||
|
||||
Reference in New Issue
Block a user