diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-03 02:30:12 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-03 02:30:12 +0000 |
commit | f4472dd6dcdfbb5d4a2a50ddc615644c3b2c8145 (patch) | |
tree | df27c8b3070c1fe4f285259f925de9fabe31b8a5 /src/modules | |
parent | c29175d8064b3428685da1155704b6c54c116b94 (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 'src/modules')
34 files changed, 9 insertions, 71 deletions
diff --git a/src/modules/m_spanningtree/cachetimer.cpp b/src/modules/m_spanningtree/cachetimer.cpp index 7168e9eed..ae26f3600 100644 --- a/src/modules/m_spanningtree/cachetimer.cpp +++ b/src/modules/m_spanningtree/cachetimer.cpp @@ -12,8 +12,6 @@ */ #include "inspircd.h" -#include "commands/cmd_whois.h" -#include "commands/cmd_stats.h" #include "socket.h" #include "xline.h" #include "../transport.h" diff --git a/src/modules/m_spanningtree/handshaketimer.cpp b/src/modules/m_spanningtree/handshaketimer.cpp index 1ccd466ad..56f34283b 100644 --- a/src/modules/m_spanningtree/handshaketimer.cpp +++ b/src/modules/m_spanningtree/handshaketimer.cpp @@ -12,8 +12,6 @@ */ #include "inspircd.h" -#include "commands/cmd_whois.h" -#include "commands/cmd_stats.h" #include "socket.h" #include "xline.h" #include "../transport.h" diff --git a/src/modules/m_spanningtree/hmac.cpp b/src/modules/m_spanningtree/hmac.cpp index e1d46d0d9..332e47585 100644 --- a/src/modules/m_spanningtree/hmac.cpp +++ b/src/modules/m_spanningtree/hmac.cpp @@ -12,8 +12,6 @@ */ #include "inspircd.h" -#include "commands/cmd_whois.h" -#include "commands/cmd_stats.h" #include "socket.h" #include "xline.h" #include "../transport.h" diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 7f152a0f5..e074f71ef 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -14,8 +14,6 @@ /* $ModDesc: Provides a spanning tree server link protocol */ #include "inspircd.h" -#include "commands/cmd_whois.h" -#include "commands/cmd_stats.h" #include "socket.h" #include "xline.h" #include "../transport.h" diff --git a/src/modules/m_spanningtree/override_admin.cpp b/src/modules/m_spanningtree/override_admin.cpp index c63b8dc4d..2a5cfcdab 100644 --- a/src/modules/m_spanningtree/override_admin.cpp +++ b/src/modules/m_spanningtree/override_admin.cpp @@ -14,8 +14,6 @@ /* $ModDesc: Provides a spanning tree server link protocol */ #include "inspircd.h" -#include "commands/cmd_whois.h" -#include "commands/cmd_stats.h" #include "socket.h" #include "xline.h" #include "../transport.h" diff --git a/src/modules/m_spanningtree/override_modules.cpp b/src/modules/m_spanningtree/override_modules.cpp index 10d46bbc3..6854bc31c 100644 --- a/src/modules/m_spanningtree/override_modules.cpp +++ b/src/modules/m_spanningtree/override_modules.cpp @@ -14,8 +14,6 @@ /* $ModDesc: Provides a spanning tree server link protocol */ #include "inspircd.h" -#include "commands/cmd_whois.h" -#include "commands/cmd_stats.h" #include "socket.h" #include "xline.h" #include "../transport.h" diff --git a/src/modules/m_spanningtree/override_motd.cpp b/src/modules/m_spanningtree/override_motd.cpp index fe229d5cc..270608062 100644 --- a/src/modules/m_spanningtree/override_motd.cpp +++ b/src/modules/m_spanningtree/override_motd.cpp @@ -14,8 +14,6 @@ /* $ModDesc: Provides a spanning tree server link protocol */ #include "inspircd.h" -#include "commands/cmd_whois.h" -#include "commands/cmd_stats.h" #include "socket.h" #include "xline.h" #include "../transport.h" diff --git a/src/modules/m_spanningtree/override_squit.cpp b/src/modules/m_spanningtree/override_squit.cpp index a13385cd1..5360f176c 100644 --- a/src/modules/m_spanningtree/override_squit.cpp +++ b/src/modules/m_spanningtree/override_squit.cpp @@ -14,8 +14,6 @@ /* $ModDesc: Provides a spanning tree server link protocol */ #include "inspircd.h" -#include "commands/cmd_whois.h" -#include "commands/cmd_stats.h" #include "socket.h" #include "xline.h" #include "../transport.h" diff --git a/src/modules/m_spanningtree/override_stats.cpp b/src/modules/m_spanningtree/override_stats.cpp index ecffcf05e..aa4834303 100644 --- a/src/modules/m_spanningtree/override_stats.cpp +++ b/src/modules/m_spanningtree/override_stats.cpp @@ -14,8 +14,6 @@ /* $ModDesc: Provides a spanning tree server link protocol */ #include "inspircd.h" -#include "commands/cmd_whois.h" -#include "commands/cmd_stats.h" #include "socket.h" #include "xline.h" #include "../transport.h" diff --git a/src/modules/m_spanningtree/override_time.cpp b/src/modules/m_spanningtree/override_time.cpp index bd9727498..54a2870bd 100644 --- a/src/modules/m_spanningtree/override_time.cpp +++ b/src/modules/m_spanningtree/override_time.cpp @@ -14,8 +14,6 @@ /* $ModDesc: Provides a spanning tree server link protocol */ #include "inspircd.h" -#include "commands/cmd_whois.h" -#include "commands/cmd_stats.h" #include "socket.h" #include "xline.h" #include "../transport.h" diff --git a/src/modules/m_spanningtree/override_whois.cpp b/src/modules/m_spanningtree/override_whois.cpp index 2d7199571..84bf8ce77 100644 --- a/src/modules/m_spanningtree/override_whois.cpp +++ b/src/modules/m_spanningtree/override_whois.cpp @@ -14,8 +14,6 @@ /* $ModDesc: Provides a spanning tree server link protocol */ #include "inspircd.h" -#include "commands/cmd_whois.h" -#include "commands/cmd_stats.h" #include "socket.h" #include "xline.h" #include "../transport.h" diff --git a/src/modules/m_spanningtree/ping.cpp b/src/modules/m_spanningtree/ping.cpp index 044d6e50c..1318b60a0 100644 --- a/src/modules/m_spanningtree/ping.cpp +++ b/src/modules/m_spanningtree/ping.cpp @@ -12,8 +12,6 @@ */ #include "inspircd.h" -#include "commands/cmd_whois.h" -#include "commands/cmd_stats.h" #include "socket.h" #include "xline.h" #include "../transport.h" diff --git a/src/modules/m_spanningtree/pong.cpp b/src/modules/m_spanningtree/pong.cpp index 6d9cd4193..b551ef6d2 100644 --- a/src/modules/m_spanningtree/pong.cpp +++ b/src/modules/m_spanningtree/pong.cpp @@ -12,8 +12,6 @@ */ #include "inspircd.h" -#include "commands/cmd_whois.h" -#include "commands/cmd_stats.h" #include "socket.h" #include "xline.h" #include "../transport.h" diff --git a/src/modules/m_spanningtree/postcommand.cpp b/src/modules/m_spanningtree/postcommand.cpp index d2cea154a..2cf4fa3ad 100644 --- a/src/modules/m_spanningtree/postcommand.cpp +++ b/src/modules/m_spanningtree/postcommand.cpp @@ -14,8 +14,6 @@ /* $ModDesc: Provides a spanning tree server link protocol */ #include "inspircd.h" -#include "commands/cmd_whois.h" -#include "commands/cmd_stats.h" #include "socket.h" #include "xline.h" #include "../transport.h" @@ -68,8 +66,14 @@ void ModuleSpanningTree::OnPostCommand(const std::string &command, const std::ve else { Module* srcmodule = thiscmd->creator; + Version ver = srcmodule->GetVersion(); - if (srcmodule && !(srcmodule->GetVersion().Flags & VF_COMMON)) { + // XXX Temporary check to avoid routing cmd_* entries while they default to global routing + if (srcmodule->ModuleSourceFile[0] == 'c') + return; + + if (!(ver.Flags & VF_COMMON)) + { ServerInstance->Logs->Log("m_spanningtree",ERROR,"Routed command %s from non-VF_COMMON module %s", command.c_str(), srcmodule->ModuleSourceFile.c_str()); return; diff --git a/src/modules/m_spanningtree/precommand.cpp b/src/modules/m_spanningtree/precommand.cpp index 94f98faf1..6564dd95b 100644 --- a/src/modules/m_spanningtree/precommand.cpp +++ b/src/modules/m_spanningtree/precommand.cpp @@ -14,8 +14,6 @@ /* $ModDesc: Provides a spanning tree server link protocol */ #include "inspircd.h" -#include "commands/cmd_whois.h" -#include "commands/cmd_stats.h" #include "socket.h" #include "xline.h" #include "../transport.h" diff --git a/src/modules/m_spanningtree/push.cpp b/src/modules/m_spanningtree/push.cpp index e0545f01e..88c6b55bd 100644 --- a/src/modules/m_spanningtree/push.cpp +++ b/src/modules/m_spanningtree/push.cpp @@ -12,8 +12,6 @@ */ #include "inspircd.h" -#include "commands/cmd_whois.h" -#include "commands/cmd_stats.h" #include "socket.h" #include "xline.h" #include "../transport.h" diff --git a/src/modules/m_spanningtree/rconnect.cpp b/src/modules/m_spanningtree/rconnect.cpp index 3e084dc19..1811d73a1 100644 --- a/src/modules/m_spanningtree/rconnect.cpp +++ b/src/modules/m_spanningtree/rconnect.cpp @@ -12,8 +12,6 @@ */ #include "inspircd.h" -#include "commands/cmd_whois.h" -#include "commands/cmd_stats.h" #include "socket.h" #include "xline.h" #include "../transport.h" diff --git a/src/modules/m_spanningtree/resolvers.cpp b/src/modules/m_spanningtree/resolvers.cpp index 51197cb11..fc3011bc2 100644 --- a/src/modules/m_spanningtree/resolvers.cpp +++ b/src/modules/m_spanningtree/resolvers.cpp @@ -12,8 +12,6 @@ */ #include "inspircd.h" -#include "commands/cmd_whois.h" -#include "commands/cmd_stats.h" #include "socket.h" #include "xline.h" #include "../transport.h" diff --git a/src/modules/m_spanningtree/resolvers.h b/src/modules/m_spanningtree/resolvers.h index 0b82bfd99..fc85cd049 100644 --- a/src/modules/m_spanningtree/resolvers.h +++ b/src/modules/m_spanningtree/resolvers.h @@ -14,8 +14,6 @@ #ifndef __RESOLVERS__H__ #define __RESOLVERS__H__ -#include "commands/cmd_whois.h" -#include "commands/cmd_stats.h" #include "socket.h" #include "inspircd.h" #include "xline.h" diff --git a/src/modules/m_spanningtree/rsquit.cpp b/src/modules/m_spanningtree/rsquit.cpp index e9c69a1d4..2afe8d4f8 100644 --- a/src/modules/m_spanningtree/rsquit.cpp +++ b/src/modules/m_spanningtree/rsquit.cpp @@ -12,8 +12,6 @@ */ #include "inspircd.h" -#include "commands/cmd_whois.h" -#include "commands/cmd_stats.h" #include "socket.h" #include "xline.h" #include "../transport.h" diff --git a/src/modules/m_spanningtree/save.cpp b/src/modules/m_spanningtree/save.cpp index 25f811267..9969fdca7 100644 --- a/src/modules/m_spanningtree/save.cpp +++ b/src/modules/m_spanningtree/save.cpp @@ -12,8 +12,6 @@ */ #include "inspircd.h" -#include "commands/cmd_whois.h" -#include "commands/cmd_stats.h" #include "socket.h" #include "xline.h" #include "../transport.h" diff --git a/src/modules/m_spanningtree/server.cpp b/src/modules/m_spanningtree/server.cpp index 6351c93b5..c275f3490 100644 --- a/src/modules/m_spanningtree/server.cpp +++ b/src/modules/m_spanningtree/server.cpp @@ -12,8 +12,6 @@ */ #include "inspircd.h" -#include "commands/cmd_whois.h" -#include "commands/cmd_stats.h" #include "socket.h" #include "xline.h" #include "../transport.h" diff --git a/src/modules/m_spanningtree/stats.cpp b/src/modules/m_spanningtree/stats.cpp index 810b6dc77..d67c5a3af 100644 --- a/src/modules/m_spanningtree/stats.cpp +++ b/src/modules/m_spanningtree/stats.cpp @@ -12,8 +12,6 @@ */ #include "inspircd.h" -#include "commands/cmd_whois.h" -#include "commands/cmd_stats.h" #include "socket.h" #include "xline.h" #include "../transport.h" @@ -44,7 +42,7 @@ bool TreeSocket::Stats(const std::string &prefix, parameterlist ¶ms) parameterlist par; par.push_back(prefix); par.push_back(""); - DoStats(this->ServerInstance, *(params[0].c_str()), source, results); + ServerInstance->DoStats(params[0][0], source, results); for (size_t i = 0; i < results.size(); i++) { par[1] = "::" + results[i]; diff --git a/src/modules/m_spanningtree/svsjoin.cpp b/src/modules/m_spanningtree/svsjoin.cpp index dbdcce718..b6246e2f4 100644 --- a/src/modules/m_spanningtree/svsjoin.cpp +++ b/src/modules/m_spanningtree/svsjoin.cpp @@ -12,8 +12,6 @@ */ #include "inspircd.h" -#include "commands/cmd_whois.h" -#include "commands/cmd_stats.h" #include "socket.h" #include "xline.h" #include "../transport.h" diff --git a/src/modules/m_spanningtree/svsnick.cpp b/src/modules/m_spanningtree/svsnick.cpp index 48e0c638a..3af6961d0 100644 --- a/src/modules/m_spanningtree/svsnick.cpp +++ b/src/modules/m_spanningtree/svsnick.cpp @@ -12,8 +12,6 @@ */ #include "inspircd.h" -#include "commands/cmd_whois.h" -#include "commands/cmd_stats.h" #include "socket.h" #include "xline.h" #include "../transport.h" diff --git a/src/modules/m_spanningtree/svspart.cpp b/src/modules/m_spanningtree/svspart.cpp index 1649b32b6..83e329b4e 100644 --- a/src/modules/m_spanningtree/svspart.cpp +++ b/src/modules/m_spanningtree/svspart.cpp @@ -12,8 +12,6 @@ */ #include "inspircd.h" -#include "commands/cmd_whois.h" -#include "commands/cmd_stats.h" #include "socket.h" #include "xline.h" #include "../transport.h" diff --git a/src/modules/m_spanningtree/time.cpp b/src/modules/m_spanningtree/time.cpp index d2c8f7989..82a7fe62e 100644 --- a/src/modules/m_spanningtree/time.cpp +++ b/src/modules/m_spanningtree/time.cpp @@ -12,8 +12,6 @@ */ #include "inspircd.h" -#include "commands/cmd_whois.h" -#include "commands/cmd_stats.h" #include "socket.h" #include "xline.h" #include "../transport.h" diff --git a/src/modules/m_spanningtree/treeserver.cpp b/src/modules/m_spanningtree/treeserver.cpp index c9f4cfdfa..a07d540bc 100644 --- a/src/modules/m_spanningtree/treeserver.cpp +++ b/src/modules/m_spanningtree/treeserver.cpp @@ -12,8 +12,6 @@ */ #include "inspircd.h" -#include "commands/cmd_whois.h" -#include "commands/cmd_stats.h" #include "socket.h" #include "xline.h" #include "../transport.h" diff --git a/src/modules/m_spanningtree/treesocket.h b/src/modules/m_spanningtree/treesocket.h index 34d042432..37cfbbd9e 100644 --- a/src/modules/m_spanningtree/treesocket.h +++ b/src/modules/m_spanningtree/treesocket.h @@ -14,8 +14,6 @@ #ifndef __TREESOCKET_H__ #define __TREESOCKET_H__ -#include "commands/cmd_whois.h" -#include "commands/cmd_stats.h" #include "socket.h" #include "inspircd.h" #include "xline.h" diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp index f31685c01..6703021a8 100644 --- a/src/modules/m_spanningtree/treesocket1.cpp +++ b/src/modules/m_spanningtree/treesocket1.cpp @@ -12,8 +12,6 @@ */ #include "inspircd.h" -#include "commands/cmd_whois.h" -#include "commands/cmd_stats.h" #include "socket.h" #include "xline.h" #include "../transport.h" diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index 922e6f784..dac0216aa 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -12,8 +12,6 @@ */ #include "inspircd.h" -#include "commands/cmd_whois.h" -#include "commands/cmd_stats.h" #include "socket.h" #include "xline.h" #include "../transport.h" diff --git a/src/modules/m_spanningtree/utils.cpp b/src/modules/m_spanningtree/utils.cpp index 13a4cc760..30b9cad3c 100644 --- a/src/modules/m_spanningtree/utils.cpp +++ b/src/modules/m_spanningtree/utils.cpp @@ -12,8 +12,6 @@ */ #include "inspircd.h" -#include "commands/cmd_whois.h" -#include "commands/cmd_stats.h" #include "socket.h" #include "xline.h" #include "../transport.h" diff --git a/src/modules/m_spanningtree/version.cpp b/src/modules/m_spanningtree/version.cpp index abf61611a..6cec7baf9 100644 --- a/src/modules/m_spanningtree/version.cpp +++ b/src/modules/m_spanningtree/version.cpp @@ -12,8 +12,6 @@ */ #include "inspircd.h" -#include "commands/cmd_whois.h" -#include "commands/cmd_stats.h" #include "socket.h" #include "xline.h" #include "../transport.h" diff --git a/src/modules/m_spanningtree/whois.cpp b/src/modules/m_spanningtree/whois.cpp index 796713182..f12a7f109 100644 --- a/src/modules/m_spanningtree/whois.cpp +++ b/src/modules/m_spanningtree/whois.cpp @@ -12,8 +12,6 @@ */ #include "inspircd.h" -#include "commands/cmd_whois.h" -#include "commands/cmd_stats.h" #include "socket.h" #include "xline.h" #include "../transport.h" @@ -69,7 +67,7 @@ bool TreeSocket::Whois(const std::string &prefix, parameterlist ¶ms) unsigned long idle = atoi(params[2].c_str()); if ((who_to_send_to) && (IS_LOCAL(who_to_send_to))) { - do_whois(this->ServerInstance, who_to_send_to, u, signon, idle, nick_whoised.c_str()); + ServerInstance->DoWhois(who_to_send_to, u, signon, idle, nick_whoised.c_str()); } } else |