/** Removes a command if the sources match. Used as a helper for
* safe hash_map delete while iter in RemoveCommands(const char* source).
*/
- void RemoveCommand(nspace::hash_map<std::string,command_t*>::iterator safei, const char* source);
+ void RemoveCommand(nspace::hash_map<std::string,Command*>::iterator safei, const char* source);
public:
- /** Command list, a hash_map of command names to command_t*
+ /** Command list, a hash_map of command names to Command*
*/
- command_table cmdlist;
+ Commandable cmdlist;
/** Reload a core command.
* This will only reload commands implemented by the core,
* @param commandname The command required. Always use uppercase for this parameter.
* @return a pointer to the command handler, or NULL
*/
- command_t* GetHandler(const std::string &commandname);
+ Command* GetHandler(const std::string &commandname);
/** This function returns true if a command is valid with the given number of parameters and user.
* @param commandname The command name to check
* @return This function will return 1 when there are no more parameters to process. When this occurs, its
* caller should return without doing anything, otherwise it should continue into its main section of code.
*/
- int LoopCall(userrec* user, command_t* CommandObj, const char** parameters, int pcnt, unsigned int splithere, unsigned int extra);
+ int LoopCall(userrec* user, Command* CommandObj, const char** parameters, int pcnt, unsigned int splithere, unsigned int extra);
/** LoopCall is used to call a command classes handler repeatedly based on the contents of a comma seperated list.
* There are two overriden versions of this method, one of which takes two potential lists and the other takes one.
* @return This function will return 1 when there are no more parameters to process. When this occurs, its
* caller should return without doing anything, otherwise it should continue into its main section of code.
*/
- int LoopCall(userrec* user, command_t* CommandObj, const char** parameters, int pcnt, unsigned int splithere);
+ int LoopCall(userrec* user, Command* CommandObj, const char** parameters, int pcnt, unsigned int splithere);
/** Take a raw input buffer from a recvq, and process it on behalf of a user.
* @param buffer The buffer line to process
bool RemoveCommands(const char* source);
/** Add a new command to the commands hash
- * @param f The new command_t to add to the list
+ * @param f The new Command to add to the list
* @param so_handle The handle to the shared object where the command can be found.
* Only core commands loaded via cmd_*.so files should set this parameter to anything
* meaningful. Module authors should leave this parameter at its default of NULL.
* @return True if the command was added
*/
- bool CreateCommand(command_t *f, void* so_handle = NULL);
+ bool CreateCommand(Command *f, void* so_handle = NULL);
/** Insert the default RFC1459 commands into the command hash.
* Ignore any already loaded commands.
/** Command handler class for the RELOAD command.
* A command cant really reload itself, so this has to be in here.
*/
-class cmd_reload : public command_t
+class cmd_reload : public Command
{
public:
/** Standard constructor
*/
- cmd_reload (InspIRCd* Instance) : command_t(Instance,"RELOAD",'o',1) { syntax = "<core-command>"; }
+ cmd_reload (InspIRCd* Instance) : Command(Instance,"RELOAD",'o',1) { syntax = "<core-command>"; }
/** Handle RELOAD
*/
CmdResult Handle(const char** parameters, int pcnt, userrec *user);
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_admin : public command_t
+class cmd_admin : public Command
{
public:
/** Constructor for admin.
*/
- cmd_admin (InspIRCd* Instance) : command_t(Instance,"ADMIN",0,0) { syntax = "[<servername>]"; }
+ cmd_admin (InspIRCd* Instance) : Command(Instance,"ADMIN",0,0) { syntax = "[<servername>]"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_away : public command_t
+class cmd_away : public Command
{
public:
/** Constructor for away.
*/
- cmd_away (InspIRCd* Instance) : command_t(Instance,"AWAY",0,0) { syntax = "[<message>]"; }
+ cmd_away (InspIRCd* Instance) : Command(Instance,"AWAY",0,0) { syntax = "[<message>]"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_clearcache : public command_t
+class cmd_clearcache : public Command
{
public:
/** Constructor for clearcache.
*/
- cmd_clearcache (InspIRCd* Instance) : command_t(Instance,"CLEARCACHE",'o',0) { }
+ cmd_clearcache (InspIRCd* Instance) : Command(Instance,"CLEARCACHE",'o',0) { }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_commands : public command_t
+class cmd_commands : public Command
{
public:
/** Constructor for commands.
*/
- cmd_commands (InspIRCd* Instance) : command_t(Instance,"COMMANDS",0,0) { }
+ cmd_commands (InspIRCd* Instance) : Command(Instance,"COMMANDS",0,0) { }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_connect : public command_t
+class cmd_connect : public Command
{
public:
/** Constructor for connect.
*/
- cmd_connect (InspIRCd* Instance) : command_t(Instance,"CONNECT",'o',1) { syntax = "<servername> [<remote-server>]"; }
+ cmd_connect (InspIRCd* Instance) : Command(Instance,"CONNECT",'o',1) { syntax = "<servername> [<remote-server>]"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_die : public command_t
+class cmd_die : public Command
{
public:
/** Constructor for die.
*/
- cmd_die (InspIRCd* Instance) : command_t(Instance,"DIE",'o',1) { syntax = "<password>"; }
+ cmd_die (InspIRCd* Instance) : Command(Instance,"DIE",'o',1) { syntax = "<password>"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_eline : public command_t
+class cmd_eline : public Command
{
public:
/** Constructor for eline.
*/
- cmd_eline (InspIRCd* Instance) : command_t(Instance,"ELINE",'o',1) { syntax = "<ident@host> [<duration> :<reason>]"; }
+ cmd_eline (InspIRCd* Instance) : Command(Instance,"ELINE",'o',1) { syntax = "<ident@host> [<duration> :<reason>]"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_gline : public command_t
+class cmd_gline : public Command
{
public:
/** Constructor for gline.
*/
- cmd_gline (InspIRCd* Instance) : command_t(Instance,"GLINE",'o',1) { syntax = "<ident@host> [<duration> :<reason>]"; }
+ cmd_gline (InspIRCd* Instance) : Command(Instance,"GLINE",'o',1) { syntax = "<ident@host> [<duration> :<reason>]"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_info : public command_t
+class cmd_info : public Command
{
public:
/** Constructor for info.
*/
- cmd_info (InspIRCd* Instance) : command_t(Instance,"INFO",0,0) { syntax = "[<servermask>]"; }
+ cmd_info (InspIRCd* Instance) : Command(Instance,"INFO",0,0) { syntax = "[<servermask>]"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_invite : public command_t
+class cmd_invite : public Command
{
public:
/** Constructor for invite.
*/
- cmd_invite (InspIRCd* Instance) : command_t(Instance,"INVITE",0,0) { syntax = "[<nick> <channel>]"; }
+ cmd_invite (InspIRCd* Instance) : Command(Instance,"INVITE",0,0) { syntax = "[<nick> <channel>]"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_ison : public command_t
+class cmd_ison : public Command
{
public:
/** Constructor for ison.
*/
- cmd_ison (InspIRCd* Instance) : command_t(Instance,"ISON",0,0) { syntax = "<nick> {nick}"; }
+ cmd_ison (InspIRCd* Instance) : Command(Instance,"ISON",0,0) { syntax = "<nick> {nick}"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_join : public command_t
+class cmd_join : public Command
{
public:
/** Constructor for join.
*/
- cmd_join (InspIRCd* Instance) : command_t(Instance,"JOIN",0,1) { syntax = "<channel>{,<channel>} {<key>{,<key>}}"; }
+ cmd_join (InspIRCd* Instance) : Command(Instance,"JOIN",0,1) { syntax = "<channel>{,<channel>} {<key>{,<key>}}"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_kick : public command_t
+class cmd_kick : public Command
{
public:
/** Constructor for kick.
*/
- cmd_kick (InspIRCd* Instance) : command_t(Instance,"KICK",0,2) { syntax = "<channel> <nick>{,<nick>} [<reason>]"; }
+ cmd_kick (InspIRCd* Instance) : Command(Instance,"KICK",0,2) { syntax = "<channel> <nick>{,<nick>} [<reason>]"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_kill : public command_t
+class cmd_kill : public Command
{
public:
/** Constructor for kill.
*/
- cmd_kill (InspIRCd* Instance) : command_t(Instance,"KILL",'o',2) { syntax = "<nickname> <reason>"; }
+ cmd_kill (InspIRCd* Instance) : Command(Instance,"KILL",'o',2) { syntax = "<nickname> <reason>"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_kline : public command_t
+class cmd_kline : public Command
{
public:
/** Constructor for kline.
*/
- cmd_kline (InspIRCd* Instance) : command_t(Instance,"KLINE",'o',1) { syntax = "<ident@host> [<duration> :<reason>]"; }
+ cmd_kline (InspIRCd* Instance) : Command(Instance,"KLINE",'o',1) { syntax = "<ident@host> [<duration> :<reason>]"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_links : public command_t
+class cmd_links : public Command
{
public:
/** Constructor for links.
*/
- cmd_links (InspIRCd* Instance) : command_t(Instance,"LINKS",0,0) { }
+ cmd_links (InspIRCd* Instance) : Command(Instance,"LINKS",0,0) { }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_list : public command_t
+class cmd_list : public Command
{
public:
/** Constructor for list.
*/
- cmd_list (InspIRCd* Instance) : command_t(Instance,"LIST",0,0) { }
+ cmd_list (InspIRCd* Instance) : Command(Instance,"LIST",0,0) { }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_loadmodule : public command_t
+class cmd_loadmodule : public Command
{
public:
/** Constructor for loadmodule.
*/
- cmd_loadmodule (InspIRCd* Instance) : command_t(Instance,"LOADMODULE",'o',1) { syntax = "<modulename>"; }
+ cmd_loadmodule (InspIRCd* Instance) : Command(Instance,"LOADMODULE",'o',1) { syntax = "<modulename>"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_lusers : public command_t
+class cmd_lusers : public Command
{
public:
/** Constructor for lusers.
*/
- cmd_lusers (InspIRCd* Instance) : command_t(Instance,"LUSERS",0,0) { }
+ cmd_lusers (InspIRCd* Instance) : Command(Instance,"LUSERS",0,0) { }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_map : public command_t
+class cmd_map : public Command
{
public:
/** Constructor for map.
*/
- cmd_map (InspIRCd* Instance) : command_t(Instance,"MAP",0,0) { }
+ cmd_map (InspIRCd* Instance) : Command(Instance,"MAP",0,0) { }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_mode : public command_t
+class cmd_mode : public Command
{
public:
/** Constructor for mode.
*/
- cmd_mode (InspIRCd* Instance) : command_t(Instance,"MODE",0,1) { syntax = "<target> <modes> {<mode-parameters>}"; }
+ cmd_mode (InspIRCd* Instance) : Command(Instance,"MODE",0,1) { syntax = "<target> <modes> {<mode-parameters>}"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_modules : public command_t
+class cmd_modules : public Command
{
public:
/** Constructor for modules.
*/
- cmd_modules (InspIRCd* Instance) : command_t(Instance,"MODULES",0,0) { syntax = "[debug]"; }
+ cmd_modules (InspIRCd* Instance) : Command(Instance,"MODULES",0,0) { syntax = "[debug]"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_motd : public command_t
+class cmd_motd : public Command
{
public:
/** Constructor for motd.
*/
- cmd_motd (InspIRCd* Instance) : command_t(Instance,"MOTD",0,0) { syntax = "[<servername>]"; }
+ cmd_motd (InspIRCd* Instance) : Command(Instance,"MOTD",0,0) { syntax = "[<servername>]"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_names : public command_t
+class cmd_names : public Command
{
public:
/** Constructor for names.
*/
- cmd_names (InspIRCd* Instance) : command_t(Instance,"NAMES",0,0) { syntax = "{<channel>{,<channel>}}"; }
+ cmd_names (InspIRCd* Instance) : Command(Instance,"NAMES",0,0) { syntax = "{<channel>{,<channel>}}"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_nick : public command_t
+class cmd_nick : public Command
{
bool allowinvalid;
public:
/** Constructor for nick.
*/
- cmd_nick (InspIRCd* Instance) : command_t(Instance,"NICK",0,1,true), allowinvalid(false) { syntax = "<newnick>"; }
+ cmd_nick (InspIRCd* Instance) : Command(Instance,"NICK",0,1,true), allowinvalid(false) { syntax = "<newnick>"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_notice : public command_t
+class cmd_notice : public Command
{
public:
/** Constructor for notice.
*/
- cmd_notice (InspIRCd* Instance) : command_t(Instance,"NOTICE",0,2) { syntax = "<target>{,<target>} <message>"; }
+ cmd_notice (InspIRCd* Instance) : Command(Instance,"NOTICE",0,2) { syntax = "<target>{,<target>} <message>"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_oper : public command_t
+class cmd_oper : public Command
{
public:
/** Constructor for oper.
*/
- cmd_oper (InspIRCd* Instance) : command_t(Instance,"OPER",0,2) { syntax = "<username> <password>"; }
+ cmd_oper (InspIRCd* Instance) : Command(Instance,"OPER",0,2) { syntax = "<username> <password>"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_part : public command_t
+class cmd_part : public Command
{
public:
/** Constructor for part.
*/
- cmd_part (InspIRCd* Instance) : command_t(Instance,"PART",0,1) { syntax = "<channel>{,<channel>} [<reason>]"; }
+ cmd_part (InspIRCd* Instance) : Command(Instance,"PART",0,1) { syntax = "<channel>{,<channel>} [<reason>]"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_pass : public command_t
+class cmd_pass : public Command
{
public:
/** Constructor for pass.
*/
- cmd_pass (InspIRCd* Instance) : command_t(Instance,"PASS",0,1,true) { syntax = "<password>"; }
+ cmd_pass (InspIRCd* Instance) : Command(Instance,"PASS",0,1,true) { syntax = "<password>"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_ping : public command_t
+class cmd_ping : public Command
{
public:
/** Constructor for ping.
*/
- cmd_ping (InspIRCd* Instance) : command_t(Instance,"PING",0,1) { syntax = "<servername> [:<servername>]"; }
+ cmd_ping (InspIRCd* Instance) : Command(Instance,"PING",0,1) { syntax = "<servername> [:<servername>]"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_pong : public command_t
+class cmd_pong : public Command
{
public:
/** Constructor for pong.
*/
- cmd_pong (InspIRCd* Instance) : command_t(Instance,"PONG",0,1) { syntax = "<ping-text>"; }
+ cmd_pong (InspIRCd* Instance) : Command(Instance,"PONG",0,1) { syntax = "<ping-text>"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_privmsg : public command_t
+class cmd_privmsg : public Command
{
public:
/** Constructor for privmsg.
*/
- cmd_privmsg (InspIRCd* Instance) : command_t(Instance,"PRIVMSG",0,2) { syntax = "<target>{,<target>} <message>"; }
+ cmd_privmsg (InspIRCd* Instance) : Command(Instance,"PRIVMSG",0,2) { syntax = "<target>{,<target>} <message>"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_qline : public command_t
+class cmd_qline : public Command
{
public:
/** Constructor for qline.
*/
- cmd_qline (InspIRCd* Instance) : command_t(Instance,"QLINE",'o',1) { syntax = "<nick> [<duration> :<reason>]"; }
+ cmd_qline (InspIRCd* Instance) : Command(Instance,"QLINE",'o',1) { syntax = "<nick> [<duration> :<reason>]"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_quit : public command_t
+class cmd_quit : public Command
{
public:
/** Constructor for quit.
*/
- cmd_quit (InspIRCd* Instance) : command_t(Instance,"QUIT",0,0,true) { syntax = "[<message>]"; }
+ cmd_quit (InspIRCd* Instance) : Command(Instance,"QUIT",0,0,true) { syntax = "[<message>]"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_rehash : public command_t
+class cmd_rehash : public Command
{
public:
/** Constructor for rehash.
*/
- cmd_rehash (InspIRCd* Instance) : command_t(Instance,"REHASH",'o',0) { syntax = "[<servermask>]"; }
+ cmd_rehash (InspIRCd* Instance) : Command(Instance,"REHASH",'o',0) { syntax = "[<servermask>]"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_reloadmodule : public command_t
+class cmd_reloadmodule : public Command
{
public:
/** Constructor for reloadmodule.
*/
- cmd_reloadmodule (InspIRCd* Instance) : command_t(Instance,"RELOADMODULE",'o',1) { syntax = "<modulename>"; }
+ cmd_reloadmodule (InspIRCd* Instance) : Command(Instance,"RELOADMODULE",'o',1) { syntax = "<modulename>"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_restart : public command_t
+class cmd_restart : public Command
{
public:
/** Constructor for restart.
*/
- cmd_restart (InspIRCd* Instance) : command_t(Instance,"RESTART",'o',1) { syntax = "<password>"; }
+ cmd_restart (InspIRCd* Instance) : Command(Instance,"RESTART",'o',1) { syntax = "<password>"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_rules : public command_t
+class cmd_rules : public Command
{
public:
/** Constructor for rules.
*/
- cmd_rules (InspIRCd* Instance) : command_t(Instance,"RULES",0,0) { syntax = "[<servername>]"; }
+ cmd_rules (InspIRCd* Instance) : Command(Instance,"RULES",0,0) { syntax = "[<servername>]"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_server : public command_t
+class cmd_server : public Command
{
public:
/** Constructor for server.
*/
- cmd_server (InspIRCd* Instance) : command_t(Instance,"SERVER",0,0) { }
+ cmd_server (InspIRCd* Instance) : Command(Instance,"SERVER",0,0) { }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_squit : public command_t
+class cmd_squit : public Command
{
public:
/** Constructor for squit.
*/
- cmd_squit (InspIRCd* Instance) : command_t(Instance,"SQUIT",'o',1) { syntax = "<servername> [<reason>]"; }
+ cmd_squit (InspIRCd* Instance) : Command(Instance,"SQUIT",'o',1) { syntax = "<servername> [<reason>]"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_stats : public command_t
+class cmd_stats : public Command
{
public:
/** Constructor for stats.
*/
- cmd_stats (InspIRCd* Instance) : command_t(Instance,"STATS",0,1) { syntax = "<stats-symbol> [<servername>]"; }
+ cmd_stats (InspIRCd* Instance) : Command(Instance,"STATS",0,1) { syntax = "<stats-symbol> [<servername>]"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_time : public command_t
+class cmd_time : public Command
{
public:
/** Constructor for time.
*/
- cmd_time (InspIRCd* Instance) : command_t(Instance,"TIME",0,0) { syntax = "[<servername>]"; }
+ cmd_time (InspIRCd* Instance) : Command(Instance,"TIME",0,0) { syntax = "[<servername>]"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_topic : public command_t
+class cmd_topic : public Command
{
public:
/** Constructor for topic.
*/
- cmd_topic (InspIRCd* Instance) : command_t(Instance,"TOPIC",0,1) { syntax = "<channel> [<topic>]"; }
+ cmd_topic (InspIRCd* Instance) : Command(Instance,"TOPIC",0,1) { syntax = "<channel> [<topic>]"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_trace : public command_t
+class cmd_trace : public Command
{
public:
/** Constructor for trace.
*/
- cmd_trace (InspIRCd* Instance) : command_t(Instance,"TRACE",'o',0) { syntax = "[<object>]"; }
+ cmd_trace (InspIRCd* Instance) : Command(Instance,"TRACE",'o',0) { syntax = "[<object>]"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_unloadmodule : public command_t
+class cmd_unloadmodule : public Command
{
public:
/** Constructor for unloadmodule.
*/
- cmd_unloadmodule (InspIRCd* Instance) : command_t(Instance,"UNLOADMODULE",'o',1) { syntax = "<modulename>"; }
+ cmd_unloadmodule (InspIRCd* Instance) : Command(Instance,"UNLOADMODULE",'o',1) { syntax = "<modulename>"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_user : public command_t
+class cmd_user : public Command
{
public:
/** Constructor for user.
*/
- cmd_user (InspIRCd* Instance) : command_t(Instance,"USER",0,4,true) { syntax = "<username> <localhost> <remotehost> <GECOS>"; }
+ cmd_user (InspIRCd* Instance) : Command(Instance,"USER",0,4,true) { syntax = "<username> <localhost> <remotehost> <GECOS>"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_userhost : public command_t
+class cmd_userhost : public Command
{
public:
/** Constructor for userhost.
*/
- cmd_userhost (InspIRCd* Instance) : command_t(Instance,"USERHOST",0,1) { syntax = "<nick>{,<nick>}"; }
+ cmd_userhost (InspIRCd* Instance) : Command(Instance,"USERHOST",0,1) { syntax = "<nick>{,<nick>}"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_version : public command_t
+class cmd_version : public Command
{
public:
/** Constructor for version.
*/
- cmd_version (InspIRCd* Instance) : command_t(Instance,"VERSION",0,0) { syntax = "[<servername>]"; }
+ cmd_version (InspIRCd* Instance) : Command(Instance,"VERSION",0,0) { syntax = "[<servername>]"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_wallops : public command_t
+class cmd_wallops : public Command
{
public:
/** Constructor for wallops.
*/
- cmd_wallops (InspIRCd* Instance) : command_t(Instance,"WALLOPS",'o',1) { syntax = "<any-text>"; }
+ cmd_wallops (InspIRCd* Instance) : Command(Instance,"WALLOPS",'o',1) { syntax = "<any-text>"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_who : public command_t
+class cmd_who : public Command
{
bool CanView(chanrec* chan, userrec* user);
bool opt_viewopersonly;
public:
/** Constructor for who.
*/
- cmd_who (InspIRCd* Instance) : command_t(Instance,"WHO",0,1) { syntax = "<server>|<nickname>|<channel>|<realname>|<host>|0 [ohurmMiaplf]"; }
+ cmd_who (InspIRCd* Instance) : Command(Instance,"WHO",0,1) { syntax = "<server>|<nickname>|<channel>|<realname>|<host>|0 [ohurmMiaplf]"; }
void SendWhoLine(userrec* user, const std::string &initial, chanrec* ch, userrec* u, std::vector<std::string> &whoresults);
/** Handle command.
* @param parameters The parameters to the comamnd
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_whois : public command_t
+class cmd_whois : public Command
{
public:
/** Constructor for whois.
*/
- cmd_whois (InspIRCd* Instance) : command_t(Instance,"WHOIS",0,1) { syntax = "<nick>{,<nick>}"; }
+ cmd_whois (InspIRCd* Instance) : Command(Instance,"WHOIS",0,1) { syntax = "<nick>{,<nick>}"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_whowas : public command_t
+class cmd_whowas : public Command
{
private:
/** Whowas container, contains a map of vectors of users tracked by WHOWAS
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class cmd_zline : public command_t
+class cmd_zline : public Command
{
public:
/** Constructor for zline.
*/
- cmd_zline (InspIRCd* Instance) : command_t(Instance,"ZLINE",'o',1) { syntax = "<ipmask> [<duration> :<reason>]"; }
+ cmd_zline (InspIRCd* Instance) : Command(Instance,"ZLINE",'o',1) { syntax = "<ipmask> [<duration> :<reason>]"; }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
/** A structure that defines a command. Every command available
- * in InspIRCd must be defined as derived from command_t.
+ * in InspIRCd must be defined as derived from Command.
*/
-class CoreExport command_t : public Extensible
+class CoreExport Command : public Extensible
{
protected:
/** Owner/Creator object
* be allowed before the user is 'registered' (has sent USER,
* NICK, optionally PASS, and been resolved).
*/
- command_t(InspIRCd* Instance, const std::string &cmd, char flags, int minpara, int before_reg = false) : ServerInstance(Instance), command(cmd), flags_needed(flags), min_params(minpara), disabled(false), works_before_reg(before_reg)
+ Command(InspIRCd* Instance, const std::string &cmd, char flags, int minpara, int before_reg = false) : ServerInstance(Instance), command(cmd), flags_needed(flags), min_params(minpara), disabled(false), works_before_reg(before_reg)
{
use_count = 0;
total_bytes = 0;
/** Standard constructor gubbins
*/
- virtual ~command_t() {}
+ virtual ~Command() {}
};
/** A hash of commands used by the core
*/
-typedef nspace::hash_map<std::string,command_t*> command_table;
+typedef nspace::hash_map<std::string,Command*> Commandable;
#define TRANSLATE1(x1) translation.push_back(x1);
#define TRANSLATE2(x1,x2) translation.push_back(x1);translation.push_back(x2);
bool AddResolver(Resolver* r, bool cached);
/** Add a command to this server's command parser
- * @param f A command_t command handler object to add
+ * @param f A Command command handler object to add
* @throw ModuleException Will throw ModuleExcption if the command already exists
*/
- void AddCommand(command_t *f);
+ void AddCommand(Command *f);
/** Send a modechange.
* The parameters provided are identical to that sent to the
#include "commands/cmd_admin.h"
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_admin(Instance);
}
#include "inspircd.h"
#include "commands/cmd_away.h"
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_away(Instance);
}
#include "inspircd.h"
#include "commands/cmd_clearcache.h"
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_clearcache(Instance);
}
/** Handle /COMMANDS
*/
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_commands(Instance);
}
CmdResult cmd_commands::Handle (const char** parameters, int pcnt, userrec *user)
{
- for (command_table::iterator i = ServerInstance->Parser->cmdlist.begin(); i != ServerInstance->Parser->cmdlist.end(); i++)
+ for (Commandable::iterator i = ServerInstance->Parser->cmdlist.begin(); i != ServerInstance->Parser->cmdlist.end(); i++)
{
user->WriteServ("902 %s :%s %s %d",user->nick,i->second->command.c_str(),i->second->source.c_str(),i->second->min_params);
}
* This is handled by the server linking module, if necessary. Do not remove this stub.
*/
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_connect(Instance);
}
#include "commands/cmd_die.h"
#include "exitcodes.h"
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_die(Instance);
}
#include "xline.h"
#include "commands/cmd_eline.h"
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_eline(Instance);
}
#include "xline.h"
#include "commands/cmd_gline.h"
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_gline(Instance);
}
#include "inspircd.h"
#include "commands/cmd_info.h"
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_info(Instance);
}
#include "inspircd.h"
#include "commands/cmd_invite.h"
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_invite(Instance);
}
#include "inspircd.h"
#include "commands/cmd_ison.h"
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_ison(Instance);
}
#include "inspircd.h"
#include "commands/cmd_join.h"
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_join(Instance);
}
#include "inspircd.h"
#include "commands/cmd_kick.h"
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_kick(Instance);
}
#include "inspircd.h"
#include "commands/cmd_kill.h"
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_kill(Instance);
}
#include "xline.h"
#include "commands/cmd_kline.h"
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_kline(Instance);
}
#include "inspircd.h"
#include "commands/cmd_links.h"
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_links(Instance);
}
/** Handle /LIST
*/
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_list(Instance);
}
#include "inspircd.h"
#include "commands/cmd_loadmodule.h"
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_loadmodule(Instance);
}
#include "inspircd.h"
#include "commands/cmd_lusers.h"
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_lusers(Instance);
}
#include "inspircd.h"
#include "commands/cmd_map.h"
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_map(Instance);
}
#include "inspircd.h"
#include "commands/cmd_mode.h"
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_mode(Instance);
}
"OnPostCommand", "OnPostJoin", "OnWhoisLine", "OnBuildExemptList", "OnRawSocketConnect", "OnGarbageCollect", NULL
};
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_modules(Instance);
}
#include "inspircd.h"
#include "commands/cmd_motd.h"
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_motd(Instance);
}
#include "inspircd.h"
#include "commands/cmd_names.h"
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_names(Instance);
}
#include "xline.h"
#include "commands/cmd_nick.h"
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_nick(Instance);
}
#include "wildcard.h"
#include "commands/cmd_notice.h"
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_notice(Instance);
}
return false;
}
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_oper(Instance);
}
#include "inspircd.h"
#include "commands/cmd_part.h"
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_part(Instance);
}
#include "inspircd.h"
#include "commands/cmd_pass.h"
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_pass(Instance);
}
#include "inspircd.h"
#include "commands/cmd_ping.h"
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_ping(Instance);
}
#include "inspircd.h"
#include "commands/cmd_pong.h"
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_pong(Instance);
}
#include "wildcard.h"
#include "commands/cmd_privmsg.h"
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_privmsg(Instance);
}
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_qline(Instance);
}
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_quit(Instance);
}
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_rehash(Instance);
}
#include "inspircd.h"
#include "commands/cmd_reloadmodule.h"
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_reloadmodule(Instance);
}
#include "inspircd.h"
#include "commands/cmd_restart.h"
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_restart(Instance);
}
#include "inspircd.h"
#include "commands/cmd_rules.h"
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_rules(Instance);
}
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_server(Instance);
}
*/
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_squit(Instance);
}
#include "commands/cmd_whowas.h"
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_stats(Instance);
}
/* stats m (list number of times each command has been used, plus bytecount) */
case 'm':
- for (command_table::iterator i = ServerInstance->Parser->cmdlist.begin(); i != ServerInstance->Parser->cmdlist.end(); i++)
+ for (Commandable::iterator i = ServerInstance->Parser->cmdlist.begin(); i != ServerInstance->Parser->cmdlist.end(); i++)
{
if (i->second->use_count)
{
results.push_back(sn+" 240 "+user->nick+" :InspIRCd(CLASS) "+ConvToStr(sizeof(InspIRCd))+" bytes");
results.push_back(sn+" 249 "+user->nick+" :Users(HASH_MAP) "+ConvToStr(ServerInstance->clientlist->size())+" ("+ConvToStr(ServerInstance->clientlist->size()*sizeof(userrec))+" bytes)");
results.push_back(sn+" 249 "+user->nick+" :Channels(HASH_MAP) "+ConvToStr(ServerInstance->chanlist->size())+" ("+ConvToStr(ServerInstance->chanlist->size()*sizeof(chanrec))+" bytes)");
- results.push_back(sn+" 249 "+user->nick+" :Commands(VECTOR) "+ConvToStr(ServerInstance->Parser->cmdlist.size())+" ("+ConvToStr(ServerInstance->Parser->cmdlist.size()*sizeof(command_t))+" bytes)");
+ results.push_back(sn+" 249 "+user->nick+" :Commands(VECTOR) "+ConvToStr(ServerInstance->Parser->cmdlist.size())+" ("+ConvToStr(ServerInstance->Parser->cmdlist.size()*sizeof(Command))+" bytes)");
if (!ServerInstance->Config->WhoWasGroupSize == 0 && !ServerInstance->Config->WhoWasMaxGroups == 0)
{
- command_t* whowas_command = ServerInstance->Parser->GetHandler("WHOWAS");
+ Command* whowas_command = ServerInstance->Parser->GetHandler("WHOWAS");
if (whowas_command)
{
std::deque<classbase*> params;
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_time(Instance);
}
#include "commands/cmd_topic.h"
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_topic(Instance);
}
#include "inspircd.h"
#include "commands/cmd_trace.h"
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_trace(Instance);
}
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_unloadmodule(Instance);
}
#include "inspircd.h"
#include "commands/cmd_user.h"
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_user(Instance);
}
#include "inspircd.h"
#include "commands/cmd_userhost.h"
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_userhost(Instance);
}
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_version(Instance);
}
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_wallops(Instance);
}
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_who(Instance);
}
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_whois(Instance);
}
WhoWasMaintainTimer * timer;
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_whowas(Instance);
}
cmd_whowas::cmd_whowas(InspIRCd* Instance)
-: command_t(Instance, "WHOWAS", 0, 1)
+: Command(Instance, "WHOWAS", 0, 1)
{
syntax = "<nick>{,<nick>}";
timer = new WhoWasMaintainTimer(Instance, 3600);
/* every hour, run this function which removes all entries older than Config->WhoWasMaxKeep */
void WhoWasMaintainTimer::Tick(time_t t)
{
- command_t* whowas_command = ServerInstance->Parser->GetHandler("WHOWAS");
+ Command* whowas_command = ServerInstance->Parser->GetHandler("WHOWAS");
if (whowas_command)
{
std::deque<classbase*> params;
-extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport Command* init_command(InspIRCd* Instance)
{
return new cmd_zline(Instance);
}
* The second version is much simpler and just has the one stream to read, and is used in NAMES, WHOIS, PRIVMSG etc.
* Both will only parse until they reach ServerInstance->Config->MaxTargets number of targets, to stop abuse via spam.
*/
-int CommandParser::LoopCall(userrec* user, command_t* CommandObj, const char** parameters, int pcnt, unsigned int splithere, unsigned int extra)
+int CommandParser::LoopCall(userrec* user, Command* CommandObj, const char** parameters, int pcnt, unsigned int splithere, unsigned int extra)
{
/* First check if we have more than one item in the list, if we don't we return zero here and the handler
* which called us just carries on as it was.
return 1;
}
-int CommandParser::LoopCall(userrec* user, command_t* CommandObj, const char** parameters, int pcnt, unsigned int splithere)
+int CommandParser::LoopCall(userrec* user, Command* CommandObj, const char** parameters, int pcnt, unsigned int splithere)
{
/* First check if we have more than one item in the list, if we don't we return zero here and the handler
* which called us just carries on as it was.
bool CommandParser::IsValidCommand(const std::string &commandname, int pcnt, userrec * user)
{
- command_table::iterator n = cmdlist.find(commandname);
+ Commandable::iterator n = cmdlist.find(commandname);
if (n != cmdlist.end())
{
return false;
}
-command_t* CommandParser::GetHandler(const std::string &commandname)
+Command* CommandParser::GetHandler(const std::string &commandname)
{
- command_table::iterator n = cmdlist.find(commandname);
+ Commandable::iterator n = cmdlist.find(commandname);
if (n != cmdlist.end())
return n->second;
CmdResult CommandParser::CallHandler(const std::string &commandname,const char** parameters, int pcnt, userrec *user)
{
- command_table::iterator n = cmdlist.find(commandname);
+ Commandable::iterator n = cmdlist.find(commandname);
if (n != cmdlist.end())
{
return;
}
- command_table::iterator cm = cmdlist.find(command);
+ Commandable::iterator cm = cmdlist.find(command);
if (cm != cmdlist.end())
{
bool CommandParser::RemoveCommands(const char* source)
{
- command_table::iterator i,safei;
+ Commandable::iterator i,safei;
for (i = cmdlist.begin(); i != cmdlist.end(); i++)
{
safei = i;
return true;
}
-void CommandParser::RemoveCommand(command_table::iterator safei, const char* source)
+void CommandParser::RemoveCommand(Commandable::iterator safei, const char* source)
{
- command_t* x = safei->second;
+ Command* x = safei->second;
if (x->source == std::string(source))
{
cmdlist.erase(safei);
}
}
-bool CommandParser::CreateCommand(command_t *f, void* so_handle)
+bool CommandParser::CreateCommand(Command *f, void* so_handle)
{
if (so_handle)
{
if (command != RFCCommands.end())
{
- command_t* cmdptr = cmdlist.find(commandname)->second;
+ Command* cmdptr = cmdlist.find(commandname)->second;
cmdlist.erase(cmdlist.find(commandname));
for (char* x = commandname; *x; x++)
{
char filename[MAXBUF];
void* h;
- command_t* (*cmd_factory_func)(InspIRCd*);
+ Command* (*cmd_factory_func)(InspIRCd*);
/* Command already exists? Succeed silently - this is needed for REHASH */
if (RFCCommands.find(name) != RFCCommands.end())
if (this->FindSym((void **)&cmd_factory_func, h, name))
{
- command_t* newcommand = cmd_factory_func(ServerInstance);
+ Command* newcommand = cmd_factory_func(ServerInstance);
this->CreateCommand(newcommand, h);
}
return NULL;
std::string thiscmd;
/* Enable everything first */
- for (command_table::iterator x = ServerInstance->Parser->cmdlist.begin(); x != ServerInstance->Parser->cmdlist.end(); x++)
+ for (Commandable::iterator x = ServerInstance->Parser->cmdlist.begin(); x != ServerInstance->Parser->cmdlist.end(); x++)
x->second->Disable(false);
/* Now disable all the ones which the user wants disabled */
while (dcmds >> thiscmd)
{
- command_table::iterator cm = ServerInstance->Parser->cmdlist.find(thiscmd);
+ Commandable::iterator cm = ServerInstance->Parser->cmdlist.find(thiscmd);
if (cm != ServerInstance->Parser->cmdlist.end())
{
cm->second->Disable(true);
conf->GetInstance()->Log(DEFAULT,"WARNING: <whowas:maxkeep> value less than 3600, setting to default 3600");
}
- command_t* whowas_command = conf->GetInstance()->Parser->GetHandler("WHOWAS");
+ Command* whowas_command = conf->GetInstance()->Parser->GetHandler("WHOWAS");
if (whowas_command)
{
std::deque<classbase*> params;
return this->Parser->IsValidCommand(commandname, pcnt, user);
}
-void InspIRCd::AddCommand(command_t *f)
+void InspIRCd::AddCommand(Command *f)
{
if (!this->Parser->CreateCommand(f))
{
void LoginFail(userrec* user, const std::string &username, const std::string &pass)
{
- command_t* oper_command = ServerInstance->Parser->GetHandler("OPER");
+ Command* oper_command = ServerInstance->Parser->GetHandler("OPER");
if (oper_command)
{
/** Handle /FINGERPRINT
*/
-class cmd_fingerprint : public command_t
+class cmd_fingerprint : public Command
{
public:
- cmd_fingerprint (InspIRCd* Instance) : command_t(Instance,"FINGERPRINT", 0, 1)
+ cmd_fingerprint (InspIRCd* Instance) : Command(Instance,"FINGERPRINT", 0, 1)
{
this->source = "m_ssl_oper_cert.so";
syntax = "<nickname>";
/** Handle /SSLINFO
*/
-class cmd_sslinfo : public command_t
+class cmd_sslinfo : public Command
{
public:
- cmd_sslinfo (InspIRCd* Instance) : command_t(Instance,"SSLINFO", 0, 1)
+ cmd_sslinfo (InspIRCd* Instance) : Command(Instance,"SSLINFO", 0, 1)
{
this->source = "m_sslinfo.so";
this->syntax = "<nick>";
/* $ModDesc: Display timestamps from all servers connected to the network */
-class cmd_alltime : public command_t
+class cmd_alltime : public Command
{
public:
- cmd_alltime(InspIRCd *Instance) : command_t(Instance, "ALLTIME", 'o', 0)
+ cmd_alltime(InspIRCd *Instance) : Command(Instance, "ALLTIME", 'o', 0)
{
this->source = "m_alltime.so";
syntax.clear();
void OnUserQuit(userrec* user, const std::string &reason, const std::string &oper_message)
{
- command_t* parthandler = ServerInstance->Parser->GetHandler("PART");
+ Command* parthandler = ServerInstance->Parser->GetHandler("PART");
std::vector<std::string> to_leave;
const char* parameters[2];
if (parthandler)
/** Handle /CBAN
*/
-class cmd_cban : public command_t
+class cmd_cban : public Command
{
public:
- cmd_cban(InspIRCd* Me) : command_t(Me, "CBAN", 'o', 1)
+ cmd_cban(InspIRCd* Me) : Command(Me, "CBAN", 'o', 1)
{
this->source = "m_cban.so";
this->syntax = "<channel> [<duration> :<reason>]";
};
typedef std::vector<CGIhost> CGIHostlist;
-class cmd_webirc : public command_t
+class cmd_webirc : public Command
{
InspIRCd* Me;
CGIHostlist Hosts;
bool notify;
public:
- cmd_webirc(InspIRCd* Me, CGIHostlist &Hosts, bool notify) : command_t(Me, "WEBIRC", 0, 4, true), Hosts(Hosts), notify(notify)
+ cmd_webirc(InspIRCd* Me, CGIHostlist &Hosts, bool notify) : Command(Me, "WEBIRC", 0, 4, true), Hosts(Hosts), notify(notify)
{
this->source = "m_cgiirc.so";
this->syntax = "password client hostname ip";
/** Handle /CHECK
*/
-class cmd_check : public command_t
+class cmd_check : public Command
{
public:
- cmd_check (InspIRCd* Instance) : command_t(Instance,"CHECK", 'o', 1)
+ cmd_check (InspIRCd* Instance) : Command(Instance,"CHECK", 'o', 1)
{
this->source = "m_check.so";
syntax = "<nickname>|<ip>|<hostmask>|<channel>";
/** Handle /CHGHOST
*/
-class cmd_chghost : public command_t
+class cmd_chghost : public Command
{
private:
char* hostmap;
public:
- cmd_chghost (InspIRCd* Instance, char* hmap) : command_t(Instance,"CHGHOST",'o',2), hostmap(hmap)
+ cmd_chghost (InspIRCd* Instance, char* hmap) : Command(Instance,"CHGHOST",'o',2), hostmap(hmap)
{
this->source = "m_chghost.so";
syntax = "<nick> <newhost>";
/** Handle /CHGIDENT
*/
-class cmd_chgident : public command_t
+class cmd_chgident : public Command
{
public:
- cmd_chgident (InspIRCd* Instance) : command_t(Instance,"CHGIDENT", 'o', 2)
+ cmd_chgident (InspIRCd* Instance) : Command(Instance,"CHGIDENT", 'o', 2)
{
this->source = "m_chgident.so";
syntax = "<nick> <newident>";
/** Handle /CHGNAME
*/
-class cmd_chgname : public command_t
+class cmd_chgname : public Command
{
public:
- cmd_chgname (InspIRCd* Instance) : command_t(Instance,"CHGNAME", 'o', 2)
+ cmd_chgname (InspIRCd* Instance) : Command(Instance,"CHGNAME", 'o', 2)
{
this->source = "m_chgname.so";
syntax = "<nick> <newname>";
/** Handle /CHECK
*/
-class cmd_clones : public command_t
+class cmd_clones : public Command
{
public:
- cmd_clones (InspIRCd* Instance) : command_t(Instance,"CLONES", 'o', 1)
+ cmd_clones (InspIRCd* Instance) : Command(Instance,"CLONES", 'o', 1)
{
this->source = "m_clones.so";
syntax = "<limit>";
/** Handle /CLOSE
*/
-class cmd_close : public command_t
+class cmd_close : public Command
{
public:
/* Command 'close', needs operator */
- cmd_close (InspIRCd* Instance) : command_t(Instance,"CLOSE", 'o', 0)
+ cmd_close (InspIRCd* Instance) : Command(Instance,"CLOSE", 'o', 0)
{
this->source = "m_close.so";
}
/** Handle /TITLE
*/
-class cmd_title : public command_t
+class cmd_title : public Command
{
public:
- cmd_title (InspIRCd* Instance) : command_t(Instance,"TITLE",0,2)
+ cmd_title (InspIRCd* Instance) : Command(Instance,"TITLE",0,2)
{
this->source = "m_customtitle.so";
syntax = "<user> <password>";
/** Handle /CYCLE
*/
-class cmd_cycle : public command_t
+class cmd_cycle : public Command
{
public:
- cmd_cycle (InspIRCd* Instance) : command_t(Instance,"CYCLE", 0, 1)
+ cmd_cycle (InspIRCd* Instance) : Command(Instance,"CYCLE", 0, 1)
{
this->source = "m_cycle.so";
syntax = "<channel> :[reason]";
typedef std::vector<BannedFileList> bannedfilelist;
bannedfilelist bfl;
-class cmd_dccallow : public command_t
+class cmd_dccallow : public Command
{
public:
- cmd_dccallow(InspIRCd* Me) : command_t(Me, "DCCALLOW", 0, 0)
+ cmd_dccallow(InspIRCd* Me) : Command(Me, "DCCALLOW", 0, 0)
{
this->source = "m_dccallow.so";
syntax = "{[+|-]<nick> <time>|HELP|LIST}";
/** Handle /DEVOICE
*/
-class cmd_devoice : public command_t
+class cmd_devoice : public Command
{
public:
- cmd_devoice (InspIRCd* Instance) : command_t(Instance,"DEVOICE", 0, 1)
+ cmd_devoice (InspIRCd* Instance) : Command(Instance,"DEVOICE", 0, 1)
{
this->source = "m_devoice.so";
syntax = "<channel>";
bool AppliesToMe(userrec* user, FilterResult* filter, int flags);
};
-class cmd_filter : public command_t
+class cmd_filter : public Command
{
FilterBase* Base;
public:
- cmd_filter(FilterBase* f, InspIRCd* Me, const std::string &source) : command_t(Me, "FILTER", 'o', 1), Base(f)
+ cmd_filter(FilterBase* f, InspIRCd* Me, const std::string &source) : Command(Me, "FILTER", 'o', 1), Base(f)
{
this->source = source;
this->syntax = "<filter-definition> <type> <flags> [<gline-duration>] :<reason>";
return 0;
/* We cant block a part or quit, so instead we change the reason to 'Reason filtered' */
- command_t* c = ServerInstance->Parser->GetHandler(command);
+ Command* c = ServerInstance->Parser->GetHandler(command);
if (c)
{
const char* params[MAXPARAMETERS];
/** Handle /GLOADMODULE
*/
-class cmd_gloadmodule : public command_t
+class cmd_gloadmodule : public Command
{
public:
- cmd_gloadmodule (InspIRCd* Instance) : command_t(Instance,"GLOADMODULE", 'o', 1)
+ cmd_gloadmodule (InspIRCd* Instance) : Command(Instance,"GLOADMODULE", 'o', 1)
{
this->source = "m_globalload.so";
syntax = "<modulename> [servermask]";
/** Handle /GUNLOADMODULE
*/
-class cmd_gunloadmodule : public command_t
+class cmd_gunloadmodule : public Command
{
public:
- cmd_gunloadmodule (InspIRCd* Instance) : command_t(Instance,"GUNLOADMODULE", 'o', 1)
+ cmd_gunloadmodule (InspIRCd* Instance) : Command(Instance,"GUNLOADMODULE", 'o', 1)
{
this->source = "m_globalload.so";
syntax = "<modulename> [servermask]";
/** Handle /GRELOADMODULE
*/
-class cmd_greloadmodule : public command_t
+class cmd_greloadmodule : public Command
{
public:
- cmd_greloadmodule (InspIRCd* Instance) : command_t(Instance, "GRELOADMODULE", 'o', 1)
+ cmd_greloadmodule (InspIRCd* Instance) : Command(Instance, "GRELOADMODULE", 'o', 1)
{
this->source = "m_globalload.so";
syntax = "<modulename> [servermask]";
/** Handle /GLOBOPS
*/
-class cmd_globops : public command_t
+class cmd_globops : public Command
{
public:
- cmd_globops (InspIRCd* Instance) : command_t(Instance,"GLOBOPS",'o',1)
+ cmd_globops (InspIRCd* Instance) : Command(Instance,"GLOBOPS",'o',1)
{
this->source = "m_globops.so";
syntax = "<any-text>";
/** Handles /HELPOP
*/
-class cmd_helpop : public command_t
+class cmd_helpop : public Command
{
public:
- cmd_helpop (InspIRCd* Instance) : command_t(Instance, "HELPOP", 0, 0)
+ cmd_helpop (InspIRCd* Instance) : Command(Instance, "HELPOP", 0, 0)
{
this->source = "m_helpop.so";
syntax = "<any-text>";
{
if (user->IsModeSet('Q'))
{
- command_t* parthandler = ServerInstance->Parser->GetHandler("PART");
+ Command* parthandler = ServerInstance->Parser->GetHandler("PART");
std::vector<std::string> to_leave;
const char* parameters[2];
if (parthandler)
/** Handle /SAPART
*/
-class cmd_jumpserver : public command_t
+class cmd_jumpserver : public Command
{
public:
bool redirect_all_immediately;
std::string reason;
int port;
- cmd_jumpserver (InspIRCd* Instance) : command_t(Instance, "JUMPSERVER", 'o', 0)
+ cmd_jumpserver (InspIRCd* Instance) : Command(Instance, "JUMPSERVER", 'o', 0)
{
this->source = "m_jumpserver.so";
syntax = "[<server> <port> <+/-a> :<reason>]";
/** Handles the /KNOCK command
*/
-class cmd_knock : public command_t
+class cmd_knock : public Command
{
public:
- cmd_knock (InspIRCd* Instance) : command_t(Instance,"KNOCK", 0, 2)
+ cmd_knock (InspIRCd* Instance) : Command(Instance,"KNOCK", 0, 2)
{
this->source = "m_knock.so";
syntax = "<channel> <reason>";
*/
-class cmd_lockserv : public command_t
+class cmd_lockserv : public Command
{
private:
bool& locked;
public:
cmd_lockserv (InspIRCd* Instance, bool &lock)
- : command_t(Instance, "LOCKSERV", 'o', 0), locked(lock)
+ : Command(Instance, "LOCKSERV", 'o', 0), locked(lock)
{
this->source = "m_lockserv.so";
syntax.clear();
}
};
-class cmd_unlockserv : public command_t
+class cmd_unlockserv : public Command
{
private:
bool& locked;
public:
cmd_unlockserv (InspIRCd* Instance, bool &lock)
- : command_t(Instance, "UNLOCKSERV", 'o', 0), locked(lock)
+ : Command(Instance, "UNLOCKSERV", 'o', 0), locked(lock)
{
this->source = "m_lockserv.so";
syntax.clear();
/** Handle /NICKLOCK
*/
-class cmd_nicklock : public command_t
+class cmd_nicklock : public Command
{
char* dummy;
public:
- cmd_nicklock (InspIRCd* Instance) : command_t(Instance,"NICKLOCK", 'o', 2)
+ cmd_nicklock (InspIRCd* Instance) : Command(Instance,"NICKLOCK", 'o', 2)
{
this->source = "m_nicklock.so";
syntax = "<oldnick> <newnick>";
/** Handle /NICKUNLOCK
*/
-class cmd_nickunlock : public command_t
+class cmd_nickunlock : public Command
{
public:
- cmd_nickunlock (InspIRCd* Instance) : command_t(Instance,"NICKUNLOCK", 'o', 1)
+ cmd_nickunlock (InspIRCd* Instance) : Command(Instance,"NICKUNLOCK", 'o', 1)
{
this->source = "m_nicklock.so";
syntax = "<locked-nick>";
/* Handle /MKPASSWD
*/
-class cmd_mkpasswd : public command_t
+class cmd_mkpasswd : public Command
{
Module* Sender;
hashymodules &hashers;
std::deque<std::string> &names;
public:
cmd_mkpasswd (InspIRCd* Instance, Module* S, hashymodules &h, std::deque<std::string> &n)
- : command_t(Instance,"MKPASSWD", 'o', 2), Sender(S), hashers(h), names(n)
+ : Command(Instance,"MKPASSWD", 'o', 2), Sender(S), hashers(h), names(n)
{
this->source = "m_oper_hash.so";
syntax = "<hashtype> <any-text>";
if ((IS_OPER(user)) && (IS_LOCAL(user)) && (user->HasPermission(command)))
{
- command_t* thiscommand = ServerInstance->Parser->GetHandler(command);
+ Command* thiscommand = ServerInstance->Parser->GetHandler(command);
if ((thiscommand) && (thiscommand->flags_needed == 'o'))
{
std::string plist;
/** Handle /OPERMOTD
*/
-class cmd_opermotd : public command_t
+class cmd_opermotd : public Command
{
public:
- cmd_opermotd (InspIRCd* Instance) : command_t(Instance,"OPERMOTD", 'o', 0)
+ cmd_opermotd (InspIRCd* Instance) : Command(Instance,"OPERMOTD", 'o', 0)
{
this->source = "m_opermotd.so";
syntax = "[<servername>]";
/** Handle /RANDQUOTE
*/
-class cmd_randquote : public command_t
+class cmd_randquote : public Command
{
public:
- cmd_randquote (InspIRCd* Instance) : command_t(Instance,"RANDQUOTE", 0, 0)
+ cmd_randquote (InspIRCd* Instance) : Command(Instance,"RANDQUOTE", 0, 0)
{
this->source = "m_randquote.so";
}
/** Handle /REMOVE
*/
-class cmd_remove : public command_t, public RemoveBase
+class cmd_remove : public Command, public RemoveBase
{
public:
- cmd_remove(InspIRCd* Instance, bool& snk) : command_t(Instance, "REMOVE", 0, 2), RemoveBase(Instance, snk)
+ cmd_remove(InspIRCd* Instance, bool& snk) : Command(Instance, "REMOVE", 0, 2), RemoveBase(Instance, snk)
{
this->source = "m_remove.so";
syntax = "<nick> <channel> [<reason>]";
/** Handle /FPART
*/
-class cmd_fpart : public command_t, public RemoveBase
+class cmd_fpart : public Command, public RemoveBase
{
public:
- cmd_fpart(InspIRCd* Instance, bool& snk) : command_t(Instance, "FPART", 0, 2), RemoveBase(Instance, snk)
+ cmd_fpart(InspIRCd* Instance, bool& snk) : Command(Instance, "FPART", 0, 2), RemoveBase(Instance, snk)
{
this->source = "m_remove.so";
syntax = "<channel> <nick> [<reason>]";
/** Handle /SAJOIN
*/
-class cmd_sajoin : public command_t
+class cmd_sajoin : public Command
{
public:
- cmd_sajoin (InspIRCd* Instance) : command_t(Instance,"SAJOIN", 'o', 2)
+ cmd_sajoin (InspIRCd* Instance) : Command(Instance,"SAJOIN", 'o', 2)
{
this->source = "m_sajoin.so";
syntax = "<nick> <channel>";
/** Handle /SAMODE
*/
-class cmd_samode : public command_t
+class cmd_samode : public Command
{
public:
- cmd_samode (InspIRCd* Instance) : command_t(Instance,"SAMODE", 'o', 2)
+ cmd_samode (InspIRCd* Instance) : Command(Instance,"SAMODE", 'o', 2)
{
this->source = "m_samode.so";
syntax = "<target> <modes> {<mode-parameters>}";
/** Handle /SANICK
*/
-class cmd_sanick : public command_t
+class cmd_sanick : public Command
{
public:
- cmd_sanick (InspIRCd* Instance) : command_t(Instance,"SANICK", 'o', 2)
+ cmd_sanick (InspIRCd* Instance) : Command(Instance,"SANICK", 'o', 2)
{
this->source = "m_sanick.so";
syntax = "<nick> <new-nick>";
/** Handle /SAPART
*/
-class cmd_sapart : public command_t
+class cmd_sapart : public Command
{
public:
- cmd_sapart (InspIRCd* Instance) : command_t(Instance,"SAPART", 'o', 2)
+ cmd_sapart (InspIRCd* Instance) : Command(Instance,"SAPART", 'o', 2)
{
this->source = "m_sapart.so";
syntax = "<nick> <channel>";
/** Handle /SAQUIT
*/
-class cmd_saquit : public command_t
+class cmd_saquit : public Command
{
public:
- cmd_saquit (InspIRCd* Instance) : command_t(Instance,"SAQUIT",'o',2)
+ cmd_saquit (InspIRCd* Instance) : Command(Instance,"SAQUIT",'o',2)
{
this->source = "m_saquit.so";
syntax = "<nick> <reason>";
/** Handle /SETHOST
*/
-class cmd_sethost : public command_t
+class cmd_sethost : public Command
{
private:
char* hostmap;
public:
- cmd_sethost (InspIRCd* Instance, char* hmap) : command_t(Instance,"SETHOST",'o',1), hostmap(hmap)
+ cmd_sethost (InspIRCd* Instance, char* hmap) : Command(Instance,"SETHOST",'o',1), hostmap(hmap)
{
this->source = "m_sethost.so";
syntax = "<new-hostname>";
/** Handle /SETIDENT
*/
-class cmd_setident : public command_t
+class cmd_setident : public Command
{
public:
- cmd_setident (InspIRCd* Instance) : command_t(Instance,"SETIDENT", 'o', 1)
+ cmd_setident (InspIRCd* Instance) : Command(Instance,"SETIDENT", 'o', 1)
{
this->source = "m_setident.so";
syntax = "<new-ident>";
/** Handle /SETIDLE
*/
-class cmd_setidle : public command_t
+class cmd_setidle : public Command
{
public:
- cmd_setidle (InspIRCd* Instance) : command_t(Instance,"SETIDLE", 'o', 1)
+ cmd_setidle (InspIRCd* Instance) : Command(Instance,"SETIDLE", 'o', 1)
{
this->source = "m_setidle.so";
syntax = "<duration>";
-class cmd_setname : public command_t
+class cmd_setname : public Command
{
public:
- cmd_setname (InspIRCd* Instance) : command_t(Instance,"SETNAME", 0, 1)
+ cmd_setname (InspIRCd* Instance) : Command(Instance,"SETNAME", 0, 1)
{
this->source = "m_setname.so";
syntax = "<new-gecos>";
// have one of these structures associated with their user record.
typedef std::map<irc::string, time_t> silencelist;
-class cmd_silence : public command_t
+class cmd_silence : public Command
{
unsigned int& maxsilence;
public:
- cmd_silence (InspIRCd* Instance, unsigned int &max) : command_t(Instance,"SILENCE", 0, 0), maxsilence(max)
+ cmd_silence (InspIRCd* Instance, unsigned int &max) : Command(Instance,"SILENCE", 0, 0), maxsilence(max)
{
this->source = "m_silence.so";
syntax = "{[+|-]<mask>}";
static int SILENCE_EXCLUDE = 0x0040; /* x exclude this pattern */
-class cmd_silence : public command_t
+class cmd_silence : public Command
{
unsigned int& maxsilence;
public:
- cmd_silence (InspIRCd* Instance, unsigned int &max) : command_t(Instance,"SILENCE", 0, 0), maxsilence(max)
+ cmd_silence (InspIRCd* Instance, unsigned int &max) : Command(Instance,"SILENCE", 0, 0), maxsilence(max)
{
this->source = "m_silence_ext.so";
syntax = "{[+|-]<mask> <p|c|i|n|t|a|x>}";
if ((result == CMD_SUCCESS) && (ServerInstance->IsValidModuleCommand(command, pcnt, user)))
{
/* Safe, we know its non-null because IsValidModuleCommand returned true */
- command_t* thiscmd = ServerInstance->Parser->GetHandler(command);
+ Command* thiscmd = ServerInstance->Parser->GetHandler(command);
// this bit of code cleverly routes all module commands
// to all remote severs *automatically* so that modules
// can just handle commands locally, without having
/* $ModDep: m_spanningtree/timesynctimer.h m_spanningtree/resolvers.h m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/link.h m_spanningtree/treesocket.h m_spanningtree/rconnect.h */
-cmd_rconnect::cmd_rconnect (InspIRCd* Instance, Module* Callback, SpanningTreeUtilities* Util) : command_t(Instance, "RCONNECT", 'o', 2), Creator(Callback), Utils(Util)
+cmd_rconnect::cmd_rconnect (InspIRCd* Instance, Module* Callback, SpanningTreeUtilities* Util) : Command(Instance, "RCONNECT", 'o', 2), Creator(Callback), Utils(Util)
{
this->source = "m_spanningtree.so";
syntax = "<remote-server-mask> <target-server-mask>";
/** Handle /RCONNECT
*/
-class cmd_rconnect : public command_t
+class cmd_rconnect : public Command
{
Module* Creator; /* Creator */
SpanningTreeUtilities* Utils; /* Utility class */
/* $ModDep: m_spanningtree/timesynctimer.h m_spanningtree/resolvers.h m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/link.h m_spanningtree/treesocket.h m_spanningtree/rsquit.h */
-cmd_rsquit::cmd_rsquit (InspIRCd* Instance, Module* Callback, SpanningTreeUtilities* Util) : command_t(Instance, "RSQUIT", 'o', 1), Creator(Callback), Utils(Util)
+cmd_rsquit::cmd_rsquit (InspIRCd* Instance, Module* Callback, SpanningTreeUtilities* Util) : Command(Instance, "RSQUIT", 'o', 1), Creator(Callback), Utils(Util)
{
this->source = "m_spanningtree.so";
syntax = "<remote-server-mask> [target-server-mask]";
/** Handle /RCONNECT
*/
-class cmd_rsquit : public command_t
+class cmd_rsquit : public Command
{
Module* Creator; /* Creator */
SpanningTreeUtilities* Utils; /* Utility class */
/** Handle /SPYLIST
*/
-class cmd_spylist : public command_t
+class cmd_spylist : public Command
{
public:
- cmd_spylist (InspIRCd* Instance) : command_t(Instance,"SPYLIST", 'o', 0)
+ cmd_spylist (InspIRCd* Instance) : Command(Instance,"SPYLIST", 'o', 0)
{
this->source = "m_spy.so";
syntax.clear();
/** Handle /SPYNAMES
*/
-class cmd_spynames : public command_t
+class cmd_spynames : public Command
{
public:
- cmd_spynames (InspIRCd* Instance) : command_t(Instance,"SPYNAMES", 'o', 0)
+ cmd_spynames (InspIRCd* Instance) : Command(Instance,"SPYNAMES", 'o', 0)
{
this->source = "m_spy.so";
syntax = "{<channel>{,<channel>}}";
/** Handle /SVSHold
*/
-class cmd_svshold : public command_t
+class cmd_svshold : public Command
{
public:
- cmd_svshold(InspIRCd* Me) : command_t(Me, "SVSHOLD", 'o', 1)
+ cmd_svshold(InspIRCd* Me) : Command(Me, "SVSHOLD", 'o', 1)
{
this->source = "m_svshold.so";
this->syntax = "<nickname> [<duration> :<reason>]";
/** Handle /SWHOIS
*/
-class cmd_swhois : public command_t
+class cmd_swhois : public Command
{
public:
- cmd_swhois (InspIRCd* Instance) : command_t(Instance,"SWHOIS",'o',2)
+ cmd_swhois (InspIRCd* Instance) : Command(Instance,"SWHOIS",'o',2)
{
this->source = "m_swhois.so";
syntax = "<nick> <swhois>";
/** Handle /TAXONOMY
*/
-class cmd_taxonomy : public command_t
+class cmd_taxonomy : public Command
{
Module* Creator;
bool& claimed;
public:
/* Command 'taxonomy', takes no parameters and needs no special modes */
- cmd_taxonomy (InspIRCd* Instance, Module* maker, bool &claim) : command_t(Instance,"TAXONOMY", 'o', 1), Creator(maker), claimed(claim)
+ cmd_taxonomy (InspIRCd* Instance, Module* maker, bool &claim) : Command(Instance,"TAXONOMY", 'o', 1), Creator(maker), claimed(claim)
{
this->source = "m_taxonomy.so";
syntax = "<nickname>";
/** Handle /DALINFO
*/
-class cmd_dalinfo : public command_t
+class cmd_dalinfo : public Command
{
public:
/* Command 'dalinfo', takes no parameters and needs no special modes */
- cmd_dalinfo (InspIRCd* Instance) : command_t(Instance,"DALINFO", 0, 0)
+ cmd_dalinfo (InspIRCd* Instance) : Command(Instance,"DALINFO", 0, 0)
{
this->source = "m_testcommand.so";
}
/** Handle /TBAN
*/
-class cmd_tban : public command_t
+class cmd_tban : public Command
{
public:
- cmd_tban (InspIRCd* Instance) : command_t(Instance,"TBAN", 0, 3)
+ cmd_tban (InspIRCd* Instance) : Command(Instance,"TBAN", 0, 3)
{
this->source = "m_timedbans.so";
syntax = "<channel> <duration> <banmask>";
/** Handle /TLINE
*/
-class cmd_tline : public command_t
+class cmd_tline : public Command
{
public:
- cmd_tline (InspIRCd* Instance) : command_t(Instance,"TLINE", 'o', 1)
+ cmd_tline (InspIRCd* Instance) : Command(Instance,"TLINE", 'o', 1)
{
this->source = "m_tline.so";
this->syntax = "<mask>";
/** Handle /UNINVITE
*/
-class cmd_uninvite : public command_t
+class cmd_uninvite : public Command
{
public:
- cmd_uninvite (InspIRCd* Instance) : command_t(Instance,"UNINVITE", 0, 2)
+ cmd_uninvite (InspIRCd* Instance) : Command(Instance,"UNINVITE", 0, 2)
{
this->source = "m_uninvite.so";
syntax = "<nick> <channel>";
/** Handle /USERIP
*/
-class cmd_userip : public command_t
+class cmd_userip : public Command
{
public:
- cmd_userip (InspIRCd* Instance) : command_t(Instance,"USERIP", 'o', 1)
+ cmd_userip (InspIRCd* Instance) : Command(Instance,"USERIP", 'o', 1)
{
this->source = "m_userip.so";
syntax = "<nick>{,<nick>}";
/** Handle /VHOST
*/
-class cmd_vhost : public command_t
+class cmd_vhost : public Command
{
public:
- cmd_vhost (InspIRCd* Instance) : command_t(Instance,"VHOST", 0, 2)
+ cmd_vhost (InspIRCd* Instance) : Command(Instance,"VHOST", 0, 2)
{
this->source = "m_vhost.so";
syntax = "<username> <password>";
/** Handle /WATCH
*/
-class cmd_watch : public command_t
+class cmd_watch : public Command
{
unsigned int& MAX_WATCH;
public:
return CMD_FAILURE;
}
- cmd_watch (InspIRCd* Instance, unsigned int &maxwatch) : command_t(Instance,"WATCH",0,0), MAX_WATCH(maxwatch)
+ cmd_watch (InspIRCd* Instance, unsigned int &maxwatch) : Command(Instance,"WATCH",0,0), MAX_WATCH(maxwatch)
{
this->source = "m_watch.so";
syntax = "[C|L|S]|[+|-<nick>]";
/* adds or updates an entry in the whowas list */
void userrec::AddToWhoWas()
{
- command_t* whowas_command = ServerInstance->Parser->GetHandler("WHOWAS");
+ Command* whowas_command = ServerInstance->Parser->GetHandler("WHOWAS");
if (whowas_command)
{
std::deque<classbase*> params;
if (this->registered == REG_ALL)
{
std::deque<classbase*> dummy;
- command_t* nickhandler = ServerInstance->Parser->GetHandler("NICK");
+ Command* nickhandler = ServerInstance->Parser->GetHandler("NICK");
if (nickhandler)
{
nickhandler->HandleInternal(1, dummy);