diff options
author | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2010-02-23 01:33:17 +0000 |
---|---|---|
committer | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2010-02-23 01:33:17 +0000 |
commit | 54a60add71fc584765b8e575fdc699e93ec2ba84 (patch) | |
tree | e4f1a96285f27124d6bc3e04d2340beeae53725d /src | |
parent | a06e674305f96e3235f9217efa30e73ff87f4015 (diff) |
Actually use the cmdTable pointer in bot structures, it now points to the bots command hash
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2794 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r-- | src/bots.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/bots.cpp b/src/bots.cpp index 93121ba16..6e97d4aa2 100644 --- a/src/bots.cpp +++ b/src/bots.cpp @@ -19,26 +19,46 @@ BotInfo::BotInfo(const std::string &nnick, const std::string &nuser, const std:: this->host = nhost; this->real = nreal; this->lastmsg = this->created = time(NULL); - this->uid = ts6_uid_retrieve(); // XXX is this safe? has ts6 been setup yet? - ++nbots; + this->uid = ts6_uid_retrieve(); this->cmdTable = NULL; + ++nbots; this->chancount = 0; ci::string ci_nick(nnick.c_str()); if (Config.s_ChanServ && ci_nick == Config.s_ChanServ) + { + this->cmdTable = CHANSERV; this->SetFlag(BI_CHANSERV); + } else if (Config.s_BotServ && ci_nick == Config.s_BotServ) + { + this->cmdTable = BOTSERV; this->SetFlag(BI_BOTSERV); + } else if (Config.s_HostServ && ci_nick == Config.s_HostServ) + { + this->cmdTable = HOSTSERV; this->SetFlag(BI_HOSTSERV); + } else if (Config.s_OperServ && ci_nick == Config.s_OperServ) + { + this->cmdTable = OPERSERV; this->SetFlag(BI_OPERSERV); + } else if (Config.s_MemoServ && ci_nick == Config.s_MemoServ) + { + this->cmdTable = MEMOSERV; this->SetFlag(BI_MEMOSERV); + } else if (Config.s_NickServ && ci_nick == Config.s_NickServ) + { + this->cmdTable = NICKSERV; this->SetFlag(BI_NICKSERV); + } else if (Config.s_GlobalNoticer && ci_nick == Config.s_GlobalNoticer) + { this->SetFlag(BI_GLOBAL); + } FOREACH_MOD(I_OnBotPreLoad, OnBotPreLoad(this)); |