summaryrefslogtreecommitdiff
path: root/include/inspircd.h
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-03 02:30:12 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-03 02:30:12 +0000
commitf4472dd6dcdfbb5d4a2a50ddc615644c3b2c8145 (patch)
treedf27c8b3070c1fe4f285259f925de9fabe31b8a5 /include/inspircd.h
parentc29175d8064b3428685da1155704b6c54c116b94 (diff)
Change cmd_*.so to use the Module object API
Create Module* objects for each command, and load them like modules. This unifies the external API for modules. Library directory is now deprecated: all modules are located in a single module directory. Header files for each command are no longer needed; remove. This also fixes two potential segfaults in m_spanningtree. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11668 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include/inspircd.h')
-rw-r--r--include/inspircd.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/inspircd.h b/include/inspircd.h
index 92e446e03..ae46569a0 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -870,6 +870,14 @@ class CoreExport InspIRCd : public classbase
*/
void SendWhoisLine(User* user, User* dest, int numeric, const char* format, ...) CUSTOM_PRINTF(5, 6);
+ /** Handle /STATS
+ */
+ void DoStats(char statschar, User* user, string_list &results);
+
+ /** Handle /WHOIS
+ */
+ void DoWhois(User* user, User* dest,unsigned long signon, unsigned long idle, const char* nick);
+
/** Quit a user for excess flood, and if they are not
* fully registered yet, temporarily zline their IP.
* @param current user to quit
@@ -929,4 +937,20 @@ class CoreExport InspIRCd : public classbase
ENTRYPOINT;
+template<class Cmd>
+class CommandModule : public Module
+{
+ Cmd cmd;
+ public:
+ CommandModule(InspIRCd* me) : Module(me), cmd(me, this)
+ {
+ me->AddCommand(&cmd);
+ }
+
+ Version GetVersion()
+ {
+ return Version(cmd.command, VF_VENDOR);
+ }
+};
+
#endif