#include <ctables.h>
A structure that defines a command. Every command available in InspIRCd must be defined as derived from Command.
◆ Command()
Command::Command |
( |
Module * |
me, |
|
|
const std::string & |
cmd, |
|
|
int |
minpara = 0 , |
|
|
int |
maxpara = 0 |
|
) |
| |
|
inline |
Create a new command.
- Parameters
-
me | The module which created this command. |
cmd | Command name. This must be UPPER CASE. |
minpara | Minimum parameters required for the command. |
maxpara | Maximum number of parameters this command may have - extra parameters will be tossed into one last space-seperated param. |
◆ DecodeParameter()
virtual void Command::DecodeParameter |
( |
std::string & |
parameter, |
|
|
int |
index |
|
) |
| |
|
inlinevirtual |
Decode a parameter from server->server transmission. Not currently used in this version of InspIRCd. Used for parameters for which the translation type is TR_CUSTOM.
- Parameters
-
parameter | The parameter to decode. Can be modified in place. |
index | The parameter index (0 == first parameter). |
◆ Disable()
void Command::Disable |
( |
bool |
setting | ) |
|
|
inline |
Disable or enable this command.
- Parameters
-
setting | True to disable the command. |
◆ EncodeParameter()
virtual void Command::EncodeParameter |
( |
std::string & |
parameter, |
|
|
int |
index |
|
) |
| |
|
inlinevirtual |
Encode a parameter for server->server transmission. Used for parameters for which the translation type is TR_CUSTOM.
- Parameters
-
parameter | The parameter to encode. Can be modified in place. |
index | The parameter index (0 == first parameter). |
◆ Handle()
virtual CmdResult Command::Handle |
( |
const std::vector< std::string > & |
parameters, |
|
|
User * |
user |
|
) |
| |
|
pure virtual |
Handle the command from a user.
- Parameters
-
parameters | The parameters for the command. |
user | The user who issued the command. |
- Returns
- Return CMD_SUCCESS on success, or CMD_FAILURE on failure.
Implemented in SplitCommand.
◆ IsDisabled()
bool Command::IsDisabled |
( |
| ) |
|
|
inline |
Obtain this command's disable state.
- Returns
- true if the command is currently disabled (disabled commands can be used only by operators)
◆ WorksBeforeReg()
bool Command::WorksBeforeReg |
( |
| ) |
|
|
inline |
- Returns
- true if the command works before registration.
◆ allow_empty_last_param
bool Command::allow_empty_last_param |
True if the command allows an empty last parameter. When false and the last parameter is empty, it's popped BEFORE checking there are enough params, etc. (i.e. the handler won't be called if there aren't enough params after popping the empty param). True by default
◆ disabled
True if the command is disabled to non-opers
◆ flags_needed
char Command::flags_needed |
User flags needed to execute the command or 0
◆ max_params
const unsigned int Command::max_params |
Maximum number of parameters command takes. This is used by the command parser to join extra parameters into one last param. If not set, no munging is done to this command.
◆ min_params
const unsigned int Command::min_params |
Minimum number of parameters command takes
◆ Penalty
How many seconds worth of penalty does this command have?
◆ syntax
std::string Command::syntax |
Syntax string for the command, displayed if non-empty string. This takes place of the text in the 'not enough parameters' numeric.
◆ total_bytes
unsigned long Command::total_bytes |
◆ translation
std::vector<TranslateType> Command::translation |
Translation type list for possible parameters, used to tokenize parameters into UIDs and SIDs etc.
◆ use_count
unsigned long Command::use_count |
◆ works_before_reg
bool Command::works_before_reg |
True if the command can be issued before registering
The documentation for this class was generated from the following files: