mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-10 06:34:16 +00:00
...
This commit is contained in:
parent
8f704ba720
commit
5ae8c65727
1 changed files with 17 additions and 0 deletions
|
@ -80,8 +80,19 @@ namespace SanAndreasUnity.Commands
|
|||
|
||||
public class ProcessCommandContext
|
||||
{
|
||||
/// <summary>
|
||||
/// Command that should be processed. This variable contains the entire command, including arguments.
|
||||
/// </summary>
|
||||
public string command;
|
||||
|
||||
/// <summary>
|
||||
/// Does the executor have server permissions ?
|
||||
/// </summary>
|
||||
public bool hasServerPermissions;
|
||||
|
||||
/// <summary>
|
||||
/// Player who is executing the command.
|
||||
/// </summary>
|
||||
public Player player;
|
||||
}
|
||||
|
||||
|
@ -105,6 +116,12 @@ namespace SanAndreasUnity.Commands
|
|||
|
||||
public bool RegisterCommand(CommandInfo commandInfo)
|
||||
{
|
||||
if (null == commandInfo.commandHandler)
|
||||
throw new System.ArgumentException("Command handler must be provided");
|
||||
|
||||
if (string.IsNullOrWhiteSpace(commandInfo.command))
|
||||
throw new System.ArgumentException("Command can not be empty");
|
||||
|
||||
commandInfo.command = commandInfo.command.Trim();
|
||||
|
||||
if (this.ForbiddenCommands.Contains(commandInfo.command))
|
||||
|
|
Loading…
Reference in a new issue