1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2008 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
15 #include "commands/cmd_modules.h"
17 extern "C" DllExport Command* init_command(InspIRCd* Instance)
19 return new CommandModules(Instance);
24 CmdResult CommandModules::Handle (const std::vector<std::string>&, User *user)
26 std::vector<std::string> module_names = ServerInstance->Modules->GetAllModuleNames(0);
28 for (unsigned int i = 0; i < module_names.size(); i++)
30 Module* m = ServerInstance->Modules->Find(module_names[i]);
31 Version V = m->GetVersion();
32 char modulename[MAXBUF];
33 char flagstate[MAXBUF];
35 if (V.Flags & VF_STATIC)
36 strlcat(flagstate,", static",MAXBUF);
37 if (V.Flags & VF_VENDOR)
38 strlcat(flagstate,", vendor",MAXBUF);
39 if (V.Flags & VF_COMMON)
40 strlcat(flagstate,", common",MAXBUF);
41 if (V.Flags & VF_SERVICEPROVIDER)
42 strlcat(flagstate,", service provider",MAXBUF);
44 strcpy(flagstate," <no flags>");
45 strlcpy(modulename,module_names[i].c_str(),256);
48 user->WriteNumeric(702, "%s :0x%08lx %d.%d.%d.%d %s (%s)",user->nick.c_str(),(unsigned long)m,V.Major,V.Minor,V.Revision,V.Build,ServerConfig::CleanFilename(modulename),flagstate+2);
52 user->WriteNumeric(702, "%s :%s",user->nick.c_str(),ServerConfig::CleanFilename(modulename));
55 user->WriteNumeric(703, "%s :End of MODULES list",user->nick.c_str());