diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-09-03 00:44:11 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-09-03 00:44:11 +0000 |
commit | 540f3bd9da75eea65e8ae5e5fd929ff522d95870 (patch) | |
tree | bec0072b8a7911367a156de8e1d33f80bb4a376c /include | |
parent | 1b7c615062a7b203c7fc3ce4c56e16eb671f7c15 (diff) |
Add /RELOAD and move cmd_mode into its own command.
/RELOAD is the only thing you cant reload (ahem)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5119 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include')
-rw-r--r-- | include/command_parse.h | 29 | ||||
-rw-r--r-- | include/commands/cmd_mode.h | 31 | ||||
-rw-r--r-- | include/mode.h | 14 |
3 files changed, 58 insertions, 16 deletions
diff --git a/include/command_parse.h b/include/command_parse.h index d4c64dab4..a9c1e26c8 100644 --- a/include/command_parse.h +++ b/include/command_parse.h @@ -24,6 +24,8 @@ class InspIRCd; +typedef std::map<std::string, void*> SharedObjectList; + /** This class handles command management and parsing. * It allows you to add and remove commands from the map, * call command handlers by name, and chop up comma seperated @@ -55,12 +57,16 @@ class CommandParser : public classbase void FindSym(void** v, void* h); + SharedObjectList RFCCommands; + + void LoadCommand(const char* name); + public: /** Command list, a hash_map of command names to command_t* */ command_table cmdlist; - void LoadCommand(const char* name); + bool ReloadCommand(const char* cmd); /** Default constructor. * @param Instance The creator of this class @@ -146,9 +152,28 @@ class CommandParser : public classbase /** Add a new command to the commands hash * @param f The new command_t 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); + bool CreateCommand(command_t *f, void* so_handle = NULL); +}; + +/** 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 +{ + public: + /** Standard constructor + */ + cmd_reload (InspIRCd* Instance) : command_t(Instance,"RELOAD",'o',1) { syntax = "<core-command>"; } + /** Handle RELOAD + */ + void Handle(const char** parameters, int pcnt, userrec *user); }; + + #endif diff --git a/include/commands/cmd_mode.h b/include/commands/cmd_mode.h new file mode 100644 index 000000000..e52042f6a --- /dev/null +++ b/include/commands/cmd_mode.h @@ -0,0 +1,31 @@ +/* +------------------------------------+ + * | Inspire Internet Relay Chat Daemon | + * +------------------------------------+ + * + * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev. + * E-mail: + * <brain@chatspike.net> + * <Craig@chatspike.net> + * + * Written by Craig Edwards, Craig McLure, and others. + * This program is free but copyrighted software; see + * the file COPYING for details. + * + * --------------------------------------------------- + */ + +#ifndef __CMD_ADMIN_H__ +#define __CMD_ADMIN_H__ + +#include "users.h" +#include "channels.h" +#include "ctables.h" + +class cmd_mode : public command_t +{ + public: + cmd_mode (InspIRCd* Instance) : command_t(Instance,"MODE",0,1) { syntax = "<target> <modes> {<mode-parameters>}"; } + void Handle(const char** parameters, int pcnt, userrec *user); +}; + +#endif diff --git a/include/mode.h b/include/mode.h index 27cdd890f..fe646c9b3 100644 --- a/include/mode.h +++ b/include/mode.h @@ -483,18 +483,4 @@ class ModeParser : public classbase std::string ModeString(userrec* user, chanrec* channel); }; -/** Command handler class for the MODE command. - * put here for completeness. - */ -class cmd_mode : public command_t -{ - public: - /** Standard constructor - */ - cmd_mode (InspIRCd* Instance) : command_t(Instance,"MODE",0,1) { syntax = "<target> <modes> {<mode-parameters>}"; } - /** Handle MODE - */ - void Handle(const char** parameters, int pcnt, userrec *user); -}; - #endif |