From b8f9116b19eb511c4f5e6a683725f50bf732a7dd Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 29 May 2010 20:44:31 -0400 Subject: Rewrote all of the command handling to get rid of all the nasty strtoks() everywhere, and added a bot map by uid --- src/core/bs_botlist.cpp | 8 ++++---- src/core/db_plain.cpp | 2 +- src/core/os_defcon.cpp | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/core') diff --git a/src/core/bs_botlist.cpp b/src/core/bs_botlist.cpp index 935e6d18a..12c90ab8b 100644 --- a/src/core/bs_botlist.cpp +++ b/src/core/bs_botlist.cpp @@ -25,13 +25,13 @@ class CommandBSBotList : public Command { unsigned count = 0; - if (BotList.empty()) + if (BotListByNick.empty()) { notice_lang(Config.s_BotServ, u, BOT_BOTLIST_EMPTY); return MOD_CONT; } - for (botinfo_map::const_iterator it = BotList.begin(); it != BotList.end(); ++it) + for (botinfo_map::const_iterator it = BotListByNick.begin(); it != BotListByNick.end(); ++it) { BotInfo *bi = it->second; @@ -44,11 +44,11 @@ class CommandBSBotList : public Command } } - if (u->Account()->HasCommand("botserv/botlist") && count < BotList.size()) + if (u->Account()->HasCommand("botserv/botlist") && count < BotListByNick.size()) { notice_lang(Config.s_BotServ, u, BOT_BOTLIST_PRIVATE_HEADER); - for (botinfo_map::const_iterator it = BotList.begin(); it != BotList.end(); ++it) + for (botinfo_map::const_iterator it = BotListByNick.begin(); it != BotListByNick.end(); ++it) { BotInfo *bi = it->second; diff --git a/src/core/db_plain.cpp b/src/core/db_plain.cpp index 8808539bd..98e055ee8 100644 --- a/src/core/db_plain.cpp +++ b/src/core/db_plain.cpp @@ -1006,7 +1006,7 @@ class DBPlain : public Module FOREACH_MOD(I_OnDatabaseWriteMetadata, OnDatabaseWriteMetadata(WriteMetadata, na)); } - for (botinfo_map::const_iterator it = BotList.begin(); it != BotList.end(); ++it) + for (botinfo_map::const_iterator it = BotListByNick.begin(); it != BotListByNick.end(); ++it) { BotInfo *bi = it->second; diff --git a/src/core/os_defcon.cpp b/src/core/os_defcon.cpp index 6f9197a2b..5945ad3ba 100644 --- a/src/core/os_defcon.cpp +++ b/src/core/os_defcon.cpp @@ -211,7 +211,7 @@ class OSDEFCON : public Module return EVENT_CONTINUE; } - EventReturn OnPreCommandRun(const std::string &service, User *u, const char *cmd, Command *c) + EventReturn OnPreCommandRun(User *u, BotInfo *bi, const ci::string &command, const ci::string &message, Command *c) { if (!c) { @@ -222,7 +222,7 @@ class OSDEFCON : public Module { if (!CheckDefCon(DEFCON_SILENT_OPER_ONLY)) { - notice_lang(service, u, OPER_DEFCON_DENIED); + notice_lang(bi->nick.c_str(), u, OPER_DEFCON_DENIED); } return EVENT_STOP; -- cgit