InspIRCd  3.0
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
Command Class Referenceabstract
Inheritance diagram for Command:
CommandBase ServiceProvider classbase SplitCommand

Public Member Functions

 ~Command () CXX11_OVERRIDE
 
virtual CmdResult Handle (User *user, const Params &parameters)=0
 
void RegisterService () CXX11_OVERRIDE
 
virtual void TellNotEnoughParameters (LocalUser *user, const Params &parameters)
 
virtual void TellNotRegistered (LocalUser *user, const Params &parameters)
 
- Public Member Functions inherited from CommandBase
 CommandBase (Module *me, const std::string &cmd, unsigned int minpara=0, unsigned int maxpara=0)
 
virtual RouteDescriptor GetRouting (User *user, const CommandBase::Params &parameters)
 
virtual void EncodeParameter (std::string &parameter, unsigned int index)
 
- Public Member Functions inherited from ServiceProvider
 ServiceProvider (Module *Creator, const std::string &Name, ServiceType Type)
 
const char * GetTypeString () const
 
void DisableAutoRegister ()
 
- Public Member Functions inherited from classbase
virtual CullResult cull ()
 

Public Attributes

unsigned char flags_needed
 
bool force_manual_route
 
unsigned int Penalty
 
unsigned long use_count
 
std::string syntax
 
bool works_before_reg
 
- Public Attributes inherited from CommandBase
const unsigned int min_params
 
const unsigned int max_params
 
bool allow_empty_last_param
 
std::vector< TranslateType > translation
 
- Public Attributes inherited from ServiceProvider
ModuleRef creator
 
const std::string name
 
const ServiceType service
 

Protected Member Functions

 Command (Module *me, const std::string &cmd, unsigned int minpara=0, unsigned int maxpara=0)
 

Constructor & Destructor Documentation

◆ Command()

Command::Command ( Module me,
const std::string &  cmd,
unsigned int  minpara = 0,
unsigned int  maxpara = 0 
)
protected

Initializes a new instance of the Command class.

Parameters
meThe module which created this instance.
cmdThe name of the command.
minparaThe minimum number of parameters that the command accepts.
maxparaThe maximum number of parameters that the command accepts.

◆ ~Command()

Command::~Command ( )

Unregisters this command from the command parser.

Member Function Documentation

◆ Handle()

virtual CmdResult Command::Handle ( User user,
const Params parameters 
)
pure virtual

Handle the command from a user.

Parameters
userThe user who issued the command.
parametersThe parameters for the command.
Returns
Returns CMD_FAILURE on failure, CMD_SUCCESS on success, or CMD_INVALID if the command was malformed.

Implemented in SplitCommand.

◆ RegisterService()

void Command::RegisterService ( )
virtual

Registers this command with the command parser.

Reimplemented from ServiceProvider.

◆ TellNotEnoughParameters()

void Command::TellNotEnoughParameters ( LocalUser user,
const Params parameters 
)
virtual

Tells the user they did not specify enough parameters.

Parameters
userThe user who issued the command.
parametersThe parameters for the command.

◆ TellNotRegistered()

void Command::TellNotRegistered ( LocalUser user,
const Params parameters 
)
virtual

Tells the user they need to be registered to execute this command.

Parameters
userThe user who issued the command.
parametersThe parameters for the command.

Member Data Documentation

◆ flags_needed

unsigned char Command::flags_needed

The user modes required to be able to execute this command.

◆ force_manual_route

bool Command::force_manual_route

Whether the command will not be forwarded by the linking module even if it comes via ENCAP.

◆ Penalty

unsigned int Command::Penalty

The number of seconds worth of penalty that executing this command gives.

◆ syntax

std::string Command::syntax

If non-empty then the syntax of the parameter for this command.

◆ use_count

unsigned long Command::use_count

The number of times this command has been executed.

◆ works_before_reg

bool Command::works_before_reg

Whether the command can be issued before registering.


The documentation for this class was generated from the following files: