![]() |
fCraft
0.638
Custom Minecraft Server
|
Static class that allows registration and parsing of all text commands. More...
Static Public Member Functions | |
| static CommandDescriptor[] | GetCommands () |
| Gets a list of all commands (includding hidden ones). | |
| static CommandDescriptor[] | GetCommands (bool hidden) |
| Gets a list of ONLY hidden or non-hidden commands, not both. | |
| static CommandDescriptor[] | GetCommands ([NotNull] Rank rank, bool includeHidden) |
| Gets a list of commands available to a specified rank. | |
| static CommandDescriptor[] | GetCommands (CommandCategory category, bool includeHidden) |
| Gets a list of commands in a specified category. Note that commands may belong to more than one category. | |
| static void | RegisterCustomCommand ([NotNull] CommandDescriptor descriptor) |
| Registers a custom command with fCraft, to be made available for players to call. Raises CommandManager.CommandRegistering/CommandRegistered events. CommandRegistering event may silently cancel the registration. | |
| static CommandDescriptor | GetDescriptor ([NotNull] string commandName, bool alsoCheckAliases) |
| Finds an instance of CommandDescriptor for a given command. Case-insensitive, but no autocompletion. | |
| static bool | ParseCommand ([NotNull] Player player,[NotNull] CommandReader cmd, bool fromConsole) |
| Parses and calls a specified command. | |
| static bool | IsValidCommandName ([NotNull] string name) |
| Checks whether a command name is acceptable. Constraints are similar to Player.IsValidName, except for length. Command names must bet between 1 and 16 characters long. | |
Static Public Attributes | |
| static readonly string[] | ReservedCommandNames = new[] { "ok", "nvm", "client" } |
| Set of reserved command names (ok, nvm, and client). | |
Events | |
| static EventHandler < CommandRegistringEventArgs > | CommandRegistering |
| Occurs when a command is being registered (cancelable). | |
| static EventHandler < CommandRegisteredEventArgs > | CommandRegistered |
| Occurs when a command has been registered. | |
| static EventHandler < CommandCallingEventArgs > | CommandCalling |
| Occurs when a command is being called by a player or the console (cancelable). | |
| static EventHandler < CommandCalledEventArgs > | CommandCalled |
| Occurs when the command has been called by a player or the console. | |
Static class that allows registration and parsing of all text commands.
|
static |
Gets a list of all commands (includding hidden ones).
|
static |
Gets a list of ONLY hidden or non-hidden commands, not both.
|
static |
Gets a list of commands available to a specified rank.
|
static |
Gets a list of commands in a specified category. Note that commands may belong to more than one category.
|
static |
Finds an instance of CommandDescriptor for a given command. Case-insensitive, but no autocompletion.
| commandName | Command to find. |
| alsoCheckAliases | Whether to check command aliases. |
| ArgumentNullException | commandName is null. |
|
static |
Checks whether a command name is acceptable. Constraints are similar to Player.IsValidName, except for length. Command names must bet between 1 and 16 characters long.
| name | Command name to check. |
| ArgumentNullException | name is null. |
|
static |
Parses and calls a specified command.
| player | Player who issued the command. |
| cmd | Command to be parsed and executed. |
| fromConsole | Whether this command is being called from a non-player (e.g. Console). |
| ArgumentNullException | player or cmd is null. |
|
static |
Registers a custom command with fCraft, to be made available for players to call. Raises CommandManager.CommandRegistering/CommandRegistered events. CommandRegistering event may silently cancel the registration.
| descriptor | Command descriptor to register. |
| ArgumentNullException | descriptor is null. |
| CommandRegistrationException | Command descriptor could not be registered. Check exception message for details. Possible reasons include: No category/name/handler was set; a command with the same name has already been registed; command name is reserved; or one of the aliases of given command matches the name of another registered command. |
|
static |
Set of reserved command names (ok, nvm, and client).
|
static |
Occurs when the command has been called by a player or the console.
|
static |
Occurs when a command is being called by a player or the console (cancelable).
|
static |
Occurs when a command has been registered.
|
static |
Occurs when a command is being registered (cancelable).