]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/cmd_modules.cpp
b8812c22dea4473a15faccc0879d6b37f057c71b
[user/henk/code/inspircd.git] / src / cmd_modules.cpp
1 /*       +------------------------------------+\r *       | Inspire Internet Relay Chat Daemon |\r *       +------------------------------------+\r *\r *  InspIRCd: (C) 2002-2007 InspIRCd Development Team\r * See: http://www.inspircd.org/wiki/index.php/Credits\r *\r * This program is free but copyrighted software; see\r *            the file COPYING for details.\r *\r * ---------------------------------------------------\r */\r\r#include "inspircd.h"\r#include "configreader.h"\r#include "users.h"\r#include "modules.h"\r#include "wildcard.h"\r#include "commands/cmd_modules.h"\r\rchar* itab[] = {\r  "OnUserConnect", "OnUserQuit", "OnUserDisconnect", "OnUserJoin", "OnUserPart", "OnRehash", "OnServerRaw",\r      "OnUserPreJoin", "OnUserPreKick", "OnUserKick", "OnOper", "OnInfo", "OnWhois", "OnUserPreInvite",\r      "OnUserInvite", "OnUserPreMessage", "OnUserPreNotice", "OnUserPreNick", "OnUserMessage", "OnUserNotice", "OnMode",\r     "OnGetServerDescription", "OnSyncUser", "OnSyncChannel", "OnSyncChannelMetaData", "OnSyncUserMetaData",\r        "OnDecodeMetaData", "ProtoSendMode", "ProtoSendMetaData", "OnWallops", "OnChangeHost", "OnChangeName", "OnAddGLine",\r   "OnAddZLine", "OnAddQLine", "OnAddKLine", "OnAddELine", "OnDelGLine", "OnDelZLine", "OnDelKLine", "OnDelELine", "OnDelQLine",\r  "OnCleanup", "OnUserPostNick", "OnAccessCheck", "On005Numeric", "OnKill", "OnRemoteKill", "OnLoadModule", "OnUnloadModule",\r    "OnBackgroundTimer", "OnSendList", "OnPreCommand", "OnCheckReady", "OnUserRegister", "OnCheckInvite",\r  "OnCheckKey", "OnCheckLimit", "OnCheckBan", "OnStats", "OnChangeLocalUserHost", "OnChangeLocalUserGecos", "OnLocalTopicChange",\r        "OnPostLocalTopicChange", "OnEvent", "OnRequest", "OnOperCompre", "OnGlobalOper", "OnPostConnect", "OnAddBan", "OnDelBan",\r     "OnRawSocketAccept", "OnRawSocketClose", "OnRawSocketWrite", "OnRawSocketRead", "OnChangeLocalUserGECOS", "OnUserRegister",\r    "OnOperCompare", "OnChannelDelete", "OnPostOper", "OnSyncOtherMetaData", "OnSetAway", "OnCancelAway", "OnNamesList",\r   "OnPostCommand", "OnPostJoin", "OnWhoisLine", "OnBuildExemptList", "OnRawSocketConnect", "OnGarbageCollect", NULL\r};\r\rextern "C" DllExport command_t* init_command(InspIRCd* Instance)\r{\r       return new cmd_modules(Instance);\r}\r\r/** Handle /MODULES\r */\rCmdResult cmd_modules::Handle (const char** parameters, int pcnt, userrec *user)\r{\r        for (unsigned int i = 0; i < ServerInstance->Config->module_names.size(); i++)\r {\r              Version V = ServerInstance->modules[i]->GetVersion();\r          char modulename[MAXBUF];\r               char flagstate[MAXBUF];\r                *flagstate = 0;\r                if (V.Flags & VF_STATIC)\r                       strlcat(flagstate,", static",MAXBUF);\r          if (V.Flags & VF_VENDOR)\r                       strlcat(flagstate,", vendor",MAXBUF);\r          if (V.Flags & VF_COMMON)\r                       strlcat(flagstate,", common",MAXBUF);\r          if (V.Flags & VF_SERVICEPROVIDER)\r                      strlcat(flagstate,", service provider",MAXBUF);\r                if (!flagstate[0])\r                     strcpy(flagstate,"  <no flags>");\r              strlcpy(modulename,ServerInstance->Config->module_names[i].c_str(),256);\r               if (IS_OPER(user))\r             {\r                      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);\r           }\r              else\r           {\r                      user->WriteServ("900 %s :%s",user->nick,ServerConfig::CleanFilename(modulename));\r              }\r      }\r      user->WriteServ("901 %s :End of MODULES list",user->nick);\r\r    return CMD_SUCCESS;\r}\r