* ---------------------------------------------------
*/
-#include <time.h>
-#include <string>
-#include <map>
-#include <sstream>
-#include <vector>
-#include <deque>
-#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",
"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", 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++)
{
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++;
}
}
}
user->WriteServ("901 %s :End of MODULES list",user->nick);
+
+ return CMD_SUCCESS;
}