summaryrefslogtreecommitdiff
path: root/include/bots.h
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-07-14 02:31:12 -0400
committerAdam <Adam@anope.org>2011-07-14 02:31:12 -0400
commitf858164deed48f2dcacd5ffc06a55398a54da7e8 (patch)
tree89c3cf36bd8e94942370135218d67d6d17ee222e /include/bots.h
parent924f6849fee4598a1a3a7f1a98d96b79e5ffd3b4 (diff)
Rewrote how commands are handled within Anope.
This allows naming commands and having spaces within command names.
Diffstat (limited to 'include/bots.h')
-rw-r--r--include/bots.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/include/bots.h b/include/bots.h
index 7316f074e..7508e4091 100644
--- a/include/bots.h
+++ b/include/bots.h
@@ -8,12 +8,12 @@
#ifndef BOTS_H
#define BOTS_H
-#include "commands.h"
-
class BotInfo;
extern CoreExport Anope::insensitive_map<BotInfo *> BotListByNick;
extern CoreExport Anope::map<BotInfo *> BotListByUID;
+typedef Anope::insensitive_map<BotInfo *> botinfo_map;
+typedef Anope::insensitive_map<Anope::string> command_map;
/** Flags settable on a bot
*/
@@ -25,11 +25,13 @@ enum BotFlag
BI_CORE,
/* This bot can only be assigned by IRCops */
BI_PRIVATE,
+ /* This bot is defined in the config */
+ BI_CONF,
BI_END
};
-static const Anope::string BotFlagString[] = { "BEGIN", "CORE", "PRIVATE", "" };
+static const Anope::string BotFlagString[] = { "BEGIN", "CORE", "PRIVATE", "CONF", "" };
class CoreExport BotInfo : public User, public Flags<BotFlag, BI_END>
{
@@ -37,7 +39,7 @@ class CoreExport BotInfo : public User, public Flags<BotFlag, BI_END>
uint32 chancount;
time_t created; /* Birth date ;) */
time_t lastmsg; /* Last time we said something */
- CommandMap Commands; /* Commands on this bot */
+ command_map commands; /* Commands, actual name to service name */
/** Create a new bot.
* @param nick The nickname to assign to the bot.
@@ -51,6 +53,8 @@ class CoreExport BotInfo : public User, public Flags<BotFlag, BI_END>
*/
virtual ~BotInfo();
+ void GenerateUID();
+
/** Change the nickname for the bot.
* @param newnick The nick to change to
*/