X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcmd_modules.cpp;h=bd5848d928f4e3510fabd9d9a798898070d2df9d;hb=ed105d7fef72b5bb5f23e72fae40d6b4ffdcb5b8;hp=995384f058fed922fab95b5faca684e53de1bd9a;hpb=ef897559824f0607786ed79cc862c02b2b0520b9;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/cmd_modules.cpp b/src/cmd_modules.cpp index 995384f05..bd5848d92 100644 --- a/src/cmd_modules.cpp +++ b/src/cmd_modules.cpp @@ -14,25 +14,13 @@ * --------------------------------------------------- */ -#include -#include -#include -#include -#include -#include -#include "inspircd_config.h" #include "inspircd.h" #include "configreader.h" -#include "hash_map.h" #include "users.h" #include "modules.h" -#include "commands.h" - #include "wildcard.h" #include "commands/cmd_modules.h" - - char* itab[] = { "OnUserConnect", "OnUserQuit", "OnUserDisconnect", "OnUserJoin", "OnUserPart", "OnRehash", "OnServerRaw", "OnExtendedMode", "OnUserPreJoin", "OnUserPreKick", "OnUserKick", "OnOper", "OnInfo", "OnWhois", "OnUserPreInvite", @@ -41,14 +29,22 @@ char* itab[] = { "OnDecodeMetaData", "ProtoSendMode", "ProtoSendMetaData", "OnWallops", "OnChangeHost", "OnChangeName", "OnAddGLine", "OnAddZLine", "OnAddQLine", "OnAddKLine", "OnAddELine", "OnDelGLine", "OnDelZLine", "OnDelKLine", "OnDelELine", "OnDelQLine", "OnCleanup", "OnUserPostNick", "OnAccessCheck", "On005Numeric", "OnKill", "OnRemoteKill", "OnLoadModule", "OnUnloadModule", - "OnBackgroundTimer", "OnSendList", "OnPreCommand", "OnCheckReady", "OnUserRrgister", "OnRawMode", "OnCheckInvite", + "OnBackgroundTimer", "OnSendList", "OnPreCommand", "OnCheckReady", "OnUserRrgister", "OnCheckInvite", "OnCheckKey", "OnCheckLimit", "OnCheckBan", "OnStats", "OnChangeLocalUserHost", "OnChangeLocalUserGecos", "OnLocalTopicChange", "OnPostLocalTopicChange", "OnEvent", "OnRequest", "OnOperCompre", "OnGlobalOper", "OnPostConnect", "OnAddBan", "OnDelBan", "OnRawSocketAccept", "OnRawSocketClose", "OnRawSocketWrite", "OnRawSocketRead", "OnChangeLocalUserGECOS", "OnUserRegister", - "OnOperCompare", "OnChannelDelete", "OnPostOper", "OnSyncOtherMetaData", "OnSetAway", "OnCancelAway", NULL + "OnOperCompare", "OnChannelDelete", "OnPostOper", "OnSyncOtherMetaData", "OnSetAway", "OnCancelAway", "OnNamesList", + "OnPostCommand", "OnPostJoin", "OnWhoisLine", "OnBuildExemptList", "OnRawSocketConnect", NULL }; -void cmd_modules::Handle (const char** parameters, int pcnt, userrec *user) +extern "C" command_t* init_command(InspIRCd* Instance) +{ + return new cmd_modules(Instance); +} + +/** Handle /MODULES + */ +CmdResult cmd_modules::Handle (const char** parameters, int pcnt, userrec *user) { for (unsigned int i = 0; i < ServerInstance->Config->module_names.size(); i++) { @@ -86,7 +82,7 @@ void cmd_modules::Handle (const char** parameters, int pcnt, userrec *user) if (ServerInstance->Config->implement_lists[i][it]) { snprintf(data,MAXBUF,"%s=>%c ",itab[it],(ServerInstance->Config->implement_lists[i][it] ? '1' : '0')); - strncat(dlist,data,MAXBUF); + strlcat(dlist,data,MAXBUF); } it++; } @@ -113,4 +109,6 @@ void cmd_modules::Handle (const char** parameters, int pcnt, userrec *user) } } user->WriteServ("901 %s :End of MODULES list",user->nick); + + return CMD_SUCCESS; }