diff options
-rw-r--r-- | src/commands/cmd_modules.cpp | 15 | ||||
-rw-r--r-- | src/modules/m_spanningtree/treesocket2.cpp | 12 |
2 files changed, 17 insertions, 10 deletions
diff --git a/src/commands/cmd_modules.cpp b/src/commands/cmd_modules.cpp index a70477e69..434bd9569 100644 --- a/src/commands/cmd_modules.cpp +++ b/src/commands/cmd_modules.cpp @@ -39,10 +39,13 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) /** Handle /MODULES */ CmdResult CommandModules::Handle (const char**, int, User *user) -{/* XXX FIXME - for (unsigned int i = 0; i < ServerInstance->Config->module_names.size(); i++) +{ + std::vector<std::string> module_names = ServerInstance->Modules->GetAllModuleNames(0); + + for (unsigned int i = 0; i < module_names.size(); i++) { - Version V = ServerInstance->Modules->modules[i]->GetVersion(); + Module* m = ServerInstance->Modules->Find(module_names[i]); + Version V = m->GetVersion(); char modulename[MAXBUF]; char flagstate[MAXBUF]; *flagstate = 0; @@ -56,10 +59,10 @@ CmdResult CommandModules::Handle (const char**, int, User *user) strlcat(flagstate,", service provider",MAXBUF); if (!flagstate[0]) strcpy(flagstate," <no flags>"); - strlcpy(modulename,ServerInstance->Config->module_names[i].c_str(),256); + strlcpy(modulename,module_names[i].c_str(),256); if (IS_OPER(user)) { - user->WriteServ("900 %s :0x%08lx %d.%d.%d.%d %s (%s)",user->nick,ServerInstance->Modules->modules[i],V.Major,V.Minor,V.Revision,V.Build,ServerConfig::CleanFilename(modulename),flagstate+2); + user->WriteServ("900 %s :0x%08lx %d.%d.%d.%d %s (%s)",user->nick,m,V.Major,V.Minor,V.Revision,V.Build,ServerConfig::CleanFilename(modulename),flagstate+2); } else { @@ -67,6 +70,6 @@ CmdResult CommandModules::Handle (const char**, int, User *user) } } user->WriteServ("901 %s :End of MODULES list",user->nick); - */ + return CMD_SUCCESS; } diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index 5f3f11fc3..b18261c52 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -71,9 +71,12 @@ bool TreeSocket::Modules(const std::string &prefix, std::deque<std::string> &par if (!source) return true; - for (unsigned int i = 0; i < Instance->Config->module_names.size(); i++) + std::vector<std::string> module_names = Instance->Modules->GetAllModuleNames(0); + + for (unsigned int i = 0; i < module_names.size(); i++) { - Version V = Instance->Modules->modules[i]->GetVersion(); + Module* m = Instance->Modules->Find(module_names[i]); + Version V = m->GetVersion(); char modulename[MAXBUF]; char flagstate[MAXBUF]; *flagstate = 0; @@ -87,10 +90,11 @@ bool TreeSocket::Modules(const std::string &prefix, std::deque<std::string> &par strlcat(flagstate,", service provider",MAXBUF); if (!flagstate[0]) strcpy(flagstate," <no flags>"); - strlcpy(modulename,Instance->Config->module_names[i].c_str(),256); + strlcpy(modulename,module_names[i].c_str(),256); if (*source->oper) { - snprintf(strbuf, MAXBUF, "::%s 900 %s :0x%08lx %d.%d.%d.%d %s (%s)",Instance->Config->ServerName,source->nick,(long unsigned int)Instance->Modules->modules[i],V.Major,V.Minor,V.Revision,V.Build,ServerConfig::CleanFilename(modulename),flagstate+2); + snprintf(strbuf, MAXBUF, "::%s 900 %s :0x%08lx %d.%d.%d.%d %s (%s)",Instance->Config->ServerName,source->nick,(unsigned long)m, + V.Major,V.Minor,V.Revision,V.Build,ServerConfig::CleanFilename(modulename),flagstate+2); } else { |