summaryrefslogtreecommitdiff
path: root/include/bots.h
diff options
context:
space:
mode:
authorAdam <Adam@drink-coca-cola.info>2010-05-14 20:35:38 -0400
committerAdam <Adam@anope.org>2010-06-18 21:01:53 -0400
commitf049124905bd9f53439293e873003cb027a17b91 (patch)
tree352ed9251fd47055dd770aa2d5eabb20247e4b43 /include/bots.h
parent81a45520a773732c9f46785f27aa1956150775d7 (diff)
Rewrote the hashing system to use std::tr1::unordered_map
Diffstat (limited to 'include/bots.h')
-rw-r--r--include/bots.h24
1 files changed, 7 insertions, 17 deletions
diff --git a/include/bots.h b/include/bots.h
index 3b4987bb7..b73b39879 100644
--- a/include/bots.h
+++ b/include/bots.h
@@ -8,6 +8,12 @@
*
*/
+#include "commands.h"
+
+class BotInfo;
+typedef unordered_map_namespace::unordered_map<ci::string, BotInfo *, hash_compare_ci_string> botinfo_map;
+extern CoreExport botinfo_map BotList;
+
/** Flags settable on a bot
*/
enum BotFlag
@@ -16,29 +22,13 @@ enum BotFlag
/* This bot can only be assigned by IRCops */
BI_PRIVATE,
- /* The following flags are used to determin what bot really is what.
- * Since you *could* have ChanServ really named BotServ or something stupid,
- * this keeps track of them and allows them to be renamed in the config
- * at any time, even if they already exist in the database
- */
- BI_CHANSERV,
- BI_BOTSERV,
- BI_HOSTSERV,
- BI_OPERSERV,
- BI_MEMOSERV,
- BI_NICKSERV,
- BI_GLOBAL,
BI_END
};
-struct CommandHash;
-
class CoreExport BotInfo : public Extensible, public Flags<BotFlag>
{
public:
- BotInfo *next, *prev;
-
std::string uid; /* required for UID supporting servers, as opposed to the shitty struct Uid. */
std::string nick; /* Nickname of the bot */
std::string user; /* Its user name */
@@ -48,7 +38,7 @@ class CoreExport BotInfo : public Extensible, public Flags<BotFlag>
int16 chancount; /* Number of channels that use the bot. */
/* Dynamic data */
time_t lastmsg; /* Last time we said something */
- CommandHash **cmdTable;
+ CommandMap Commands;
/** Create a new bot.
* @param nick The nickname to assign to the bot.