1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2007 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 "configreader.h"
19 #include "commands/cmd_modules.h"
22 "OnUserConnect", "OnUserQuit", "OnUserDisconnect", "OnUserJoin", "OnUserPart", "OnRehash", "OnServerRaw",
23 "OnUserPreJoin", "OnUserPreKick", "OnUserKick", "OnOper", "OnInfo", "OnWhois", "OnUserPreInvite",
24 "OnUserInvite", "OnUserPreMessage", "OnUserPreNotice", "OnUserPreNick", "OnUserMessage", "OnUserNotice", "OnMode",
25 "OnGetServerDescription", "OnSyncUser", "OnSyncChannel", "OnSyncChannelMetaData", "OnSyncUserMetaData",
26 "OnDecodeMetaData", "ProtoSendMode", "ProtoSendMetaData", "OnWallops", "OnChangeHost", "OnChangeName", "OnAddGLine",
27 "OnAddZLine", "OnAddQLine", "OnAddKLine", "OnAddELine", "OnDelGLine", "OnDelZLine", "OnDelKLine", "OnDelELine", "OnDelQLine",
28 "OnCleanup", "OnUserPostNick", "OnAccessCheck", "On005Numeric", "OnKill", "OnRemoteKill", "OnLoadModule", "OnUnloadModule",
29 "OnBackgroundTimer", "OnSendList", "OnPreCommand", "OnCheckReady", "OnUserRegister", "OnCheckInvite",
30 "OnCheckKey", "OnCheckLimit", "OnCheckBan", "OnStats", "OnChangeLocalUserHost", "OnChangeLocalUserGecos", "OnLocalTopicChange",
31 "OnPostLocalTopicChange", "OnEvent", "OnRequest", "OnOperCompre", "OnGlobalOper", "OnPostConnect", "OnAddBan", "OnDelBan",
32 "OnRawSocketAccept", "OnRawSocketClose", "OnRawSocketWrite", "OnRawSocketRead", "OnChangeLocalUserGECOS", "OnUserRegister",
33 "OnOperCompare", "OnChannelDelete", "OnPostOper", "OnSyncOtherMetaData", "OnSetAway", "OnCancelAway", "OnNamesList",
34 "OnPostCommand", "OnPostJoin", "OnWhoisLine", "OnBuildExemptList", "OnRawSocketConnect", "OnGarbageCollect", NULL
37 extern "C" DllExport command_t* init_command(InspIRCd* Instance)
39 return new cmd_modules(Instance);
44 CmdResult cmd_modules::Handle (const char** parameters, int pcnt, userrec *user)
46 for (unsigned int i = 0; i < ServerInstance->Config->module_names.size(); i++)
48 Version V = ServerInstance->modules[i]->GetVersion();
49 char modulename[MAXBUF];
50 char flagstate[MAXBUF];
52 if (V.Flags & VF_STATIC)
53 strlcat(flagstate,", static",MAXBUF);
54 if (V.Flags & VF_VENDOR)
55 strlcat(flagstate,", vendor",MAXBUF);
56 if (V.Flags & VF_COMMON)
57 strlcat(flagstate,", common",MAXBUF);
58 if (V.Flags & VF_SERVICEPROVIDER)
59 strlcat(flagstate,", service provider",MAXBUF);
61 strcpy(flagstate," <no flags>");
62 strlcpy(modulename,ServerInstance->Config->module_names[i].c_str(),256);
65 user->WriteServ("900 %s :0x%08lx %d.%d.%d.%d %s (%s)",user->nick,ServerInstance->modules[i],V.Major,V.Minor,V.Revision,V.Build,ServerConfig::CleanFilename(modulename),flagstate+2);
69 user->WriteServ("900 %s :%s",user->nick,ServerConfig::CleanFilename(modulename));
72 user->WriteServ("901 %s :End of MODULES list",user->nick);