From f4472dd6dcdfbb5d4a2a50ddc615644c3b2c8145 Mon Sep 17 00:00:00 2001 From: danieldg Date: Thu, 3 Sep 2009 02:30:12 +0000 Subject: 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 --- include/inspircd.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'include/inspircd.h') 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 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 -- cgit v1.2.3