summaryrefslogtreecommitdiff
path: root/src/core
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 /src/core
parent81a45520a773732c9f46785f27aa1956150775d7 (diff)
Rewrote the hashing system to use std::tr1::unordered_map
Diffstat (limited to 'src/core')
-rw-r--r--src/core/bs_act.c2
-rw-r--r--src/core/bs_assign.c2
-rw-r--r--src/core/bs_badwords.c2
-rw-r--r--src/core/bs_bot.c2
-rw-r--r--src/core/bs_botlist.c44
-rw-r--r--src/core/bs_help.c4
-rw-r--r--src/core/bs_info.c27
-rw-r--r--src/core/bs_kick.c2
-rw-r--r--src/core/bs_say.c2
-rw-r--r--src/core/bs_set.c2
-rw-r--r--src/core/bs_unassign.c2
-rw-r--r--src/core/cs_access.c4
-rw-r--r--src/core/cs_akick.c49
-rw-r--r--src/core/cs_ban.c4
-rw-r--r--src/core/cs_clear.c2
-rw-r--r--src/core/cs_drop.c4
-rw-r--r--src/core/cs_forbid.c6
-rw-r--r--src/core/cs_getkey.c2
-rw-r--r--src/core/cs_help.c4
-rw-r--r--src/core/cs_info.c2
-rw-r--r--src/core/cs_invite.c2
-rw-r--r--src/core/cs_kick.c4
-rw-r--r--src/core/cs_list.c88
-rw-r--r--src/core/cs_modes.c32
-rw-r--r--src/core/cs_register.c4
-rw-r--r--src/core/cs_set.c8
-rw-r--r--src/core/cs_status.c2
-rw-r--r--src/core/cs_suspend.c8
-rw-r--r--src/core/cs_topic.c10
-rw-r--r--src/core/cs_unban.c2
-rw-r--r--src/core/cs_xop.c14
-rw-r--r--src/core/db_plain.cpp444
-rw-r--r--src/core/hs_del.c2
-rw-r--r--src/core/hs_delall.c2
-rw-r--r--src/core/hs_group.c2
-rw-r--r--src/core/hs_help.c4
-rw-r--r--src/core/hs_list.c69
-rw-r--r--src/core/hs_off.c2
-rw-r--r--src/core/hs_on.c2
-rw-r--r--src/core/hs_set.c2
-rw-r--r--src/core/hs_setall.c2
-rw-r--r--src/core/ms_cancel.c2
-rw-r--r--src/core/ms_check.c2
-rw-r--r--src/core/ms_del.c2
-rw-r--r--src/core/ms_help.c4
-rw-r--r--src/core/ms_info.c2
-rw-r--r--src/core/ms_list.c2
-rw-r--r--src/core/ms_read.c2
-rw-r--r--src/core/ms_rsend.c2
-rw-r--r--src/core/ms_send.c2
-rw-r--r--src/core/ms_sendall.c20
-rw-r--r--src/core/ms_set.c2
-rw-r--r--src/core/ms_staff.c17
-rw-r--r--src/core/ns_access.c2
-rw-r--r--src/core/ns_alist.c36
-rw-r--r--src/core/ns_drop.c6
-rw-r--r--src/core/ns_forbid.c4
-rw-r--r--src/core/ns_getemail.c23
-rw-r--r--src/core/ns_getpass.c6
-rw-r--r--src/core/ns_ghost.c2
-rw-r--r--src/core/ns_group.c8
-rw-r--r--src/core/ns_help.c4
-rw-r--r--src/core/ns_identify.c4
-rw-r--r--src/core/ns_info.c2
-rw-r--r--src/core/ns_list.c95
-rw-r--r--src/core/ns_logout.c2
-rw-r--r--src/core/ns_recover.c2
-rw-r--r--src/core/ns_register.c6
-rw-r--r--src/core/ns_release.c2
-rw-r--r--src/core/ns_resetpass.c2
-rw-r--r--src/core/ns_saset.c4
-rw-r--r--src/core/ns_sendpass.c2
-rw-r--r--src/core/ns_set.c2
-rw-r--r--src/core/ns_status.c2
-rw-r--r--src/core/ns_suspend.c8
-rw-r--r--src/core/ns_update.c2
-rw-r--r--src/core/os_akill.c4
-rw-r--r--src/core/os_chankill.c4
-rw-r--r--src/core/os_chanlist.c31
-rw-r--r--src/core/os_clearmodes.c4
-rw-r--r--src/core/os_defcon.c24
-rw-r--r--src/core/os_global.c4
-rw-r--r--src/core/os_help.c4
-rw-r--r--src/core/os_ignore.c2
-rw-r--r--src/core/os_jupe.c4
-rw-r--r--src/core/os_kick.c6
-rw-r--r--src/core/os_mode.c6
-rw-r--r--src/core/os_modinfo.c49
-rw-r--r--src/core/os_modlist.c109
-rw-r--r--src/core/os_modload.c12
-rw-r--r--src/core/os_modunload.c12
-rw-r--r--src/core/os_news.c6
-rw-r--r--src/core/os_noop.c12
-rw-r--r--src/core/os_oline.c8
-rw-r--r--src/core/os_quit.c2
-rw-r--r--src/core/os_reload.c2
-rw-r--r--src/core/os_restart.c2
-rw-r--r--src/core/os_session.c19
-rw-r--r--src/core/os_set.c10
-rw-r--r--src/core/os_sgline.c4
-rw-r--r--src/core/os_shutdown.c2
-rw-r--r--src/core/os_sqline.c4
-rw-r--r--src/core/os_staff.c6
-rw-r--r--src/core/os_stats.c2
-rw-r--r--src/core/os_svsnick.c4
-rw-r--r--src/core/os_szline.c4
-rw-r--r--src/core/os_umode.c6
-rw-r--r--src/core/os_update.c2
-rw-r--r--src/core/os_userlist.c32
-rw-r--r--src/core/ss_main.c19
110 files changed, 759 insertions, 820 deletions
diff --git a/src/core/bs_act.c b/src/core/bs_act.c
index d0b9c8b08..1bf11e078 100644
--- a/src/core/bs_act.c
+++ b/src/core/bs_act.c
@@ -75,7 +75,7 @@ class BSAct : public Module
this->SetAuthor("Anope");
this->SetVersion(VERSION_STRING);
this->SetType(CORE);
- this->AddCommand(BOTSERV, new CommandBSAct());
+ this->AddCommand(BotServ, new CommandBSAct());
ModuleManager::Attach(I_OnBotServHelp, this);
}
diff --git a/src/core/bs_assign.c b/src/core/bs_assign.c
index f37db9aca..dc847eb66 100644
--- a/src/core/bs_assign.c
+++ b/src/core/bs_assign.c
@@ -85,7 +85,7 @@ class BSAssign : public Module
this->SetAuthor("Anope");
this->SetVersion(VERSION_STRING);
this->SetType(CORE);
- this->AddCommand(BOTSERV, new CommandBSAssign);
+ this->AddCommand(BotServ, new CommandBSAssign);
ModuleManager::Attach(I_OnBotServHelp, this);
}
diff --git a/src/core/bs_badwords.c b/src/core/bs_badwords.c
index af616c41a..3db6f1e42 100644
--- a/src/core/bs_badwords.c
+++ b/src/core/bs_badwords.c
@@ -229,7 +229,7 @@ class BSBadwords : public Module
this->SetAuthor("Anope");
this->SetVersion(VERSION_STRING);
this->SetType(CORE);
- this->AddCommand(BOTSERV, new CommandBSBadwords);
+ this->AddCommand(BotServ, new CommandBSBadwords);
ModuleManager::Attach(I_OnBotServHelp, this);
}
diff --git a/src/core/bs_bot.c b/src/core/bs_bot.c
index 8abfecde8..d8cb3db6d 100644
--- a/src/core/bs_bot.c
+++ b/src/core/bs_bot.c
@@ -414,7 +414,7 @@ class BSBot : public Module
this->SetAuthor("Anope");
this->SetVersion(VERSION_STRING);
this->SetType(CORE);
- this->AddCommand(BOTSERV, new CommandBSBot());
+ this->AddCommand(BotServ, new CommandBSBot());
ModuleManager::Attach(I_OnBotServHelp, this);
}
diff --git a/src/core/bs_botlist.c b/src/core/bs_botlist.c
index 540cac30d..935e6d18a 100644
--- a/src/core/bs_botlist.c
+++ b/src/core/bs_botlist.c
@@ -23,34 +23,39 @@ class CommandBSBotList : public Command
CommandReturn Execute(User *u, const std::vector<ci::string> &params)
{
- int i, count = 0;
- BotInfo *bi;
+ unsigned count = 0;
- if (!nbots) {
+ if (BotList.empty())
+ {
notice_lang(Config.s_BotServ, u, BOT_BOTLIST_EMPTY);
return MOD_CONT;
}
- for (i = 0; i < 256; i++) {
- for (bi = botlists[i]; bi; bi = bi->next) {
- if (!(bi->HasFlag(BI_PRIVATE))) {
- if (!count)
- notice_lang(Config.s_BotServ, u, BOT_BOTLIST_HEADER);
- count++;
- u->SendMessage(Config.s_BotServ, " %-15s (%s@%s)", bi->nick.c_str(), bi->user.c_str(), bi->host.c_str());
- }
+ for (botinfo_map::const_iterator it = BotList.begin(); it != BotList.end(); ++it)
+ {
+ BotInfo *bi = it->second;
+
+ if (!bi->HasFlag(BI_PRIVATE))
+ {
+ if (!count)
+ notice_lang(Config.s_BotServ, u, BOT_BOTLIST_HEADER);
+ count++;
+ u->SendMessage(Config.s_BotServ, " %-15s (%s@%s)", bi->nick.c_str(), bi->user.c_str(), bi->host.c_str());
}
}
- if (u->Account()->HasCommand("botserv/botlist") && count < nbots) {
+ if (u->Account()->HasCommand("botserv/botlist") && count < BotList.size())
+ {
notice_lang(Config.s_BotServ, u, BOT_BOTLIST_PRIVATE_HEADER);
- for (i = 0; i < 256; i++) {
- for (bi = botlists[i]; bi; bi = bi->next) {
- if (bi->HasFlag(BI_PRIVATE)) {
- u->SendMessage(Config.s_BotServ, " %-15s (%s@%s)", bi->nick.c_str(), bi->user.c_str(), bi->host.c_str());
- count++;
- }
+ for (botinfo_map::const_iterator it = BotList.begin(); it != BotList.end(); ++it)
+ {
+ BotInfo *bi = it->second;
+
+ if (bi->HasFlag(BI_PRIVATE))
+ {
+ u->SendMessage(Config.s_BotServ, " %-15s (%s@%s)", bi->nick.c_str(), bi->user.c_str(), bi->host.c_str());
+ count++;
}
}
}
@@ -59,6 +64,7 @@ class CommandBSBotList : public Command
notice_lang(Config.s_BotServ, u, BOT_BOTLIST_EMPTY);
else
notice_lang(Config.s_BotServ, u, BOT_BOTLIST_FOOTER, count);
+
return MOD_CONT;
}
@@ -77,7 +83,7 @@ class BSBotList : public Module
this->SetAuthor("Anope");
this->SetVersion(VERSION_STRING);
this->SetType(CORE);
- this->AddCommand(BOTSERV, new CommandBSBotList());
+ this->AddCommand(BotServ, new CommandBSBotList());
ModuleManager::Attach(I_OnBotServHelp, this);
}
diff --git a/src/core/bs_help.c b/src/core/bs_help.c
index d28595986..a3e53df5c 100644
--- a/src/core/bs_help.c
+++ b/src/core/bs_help.c
@@ -25,7 +25,7 @@ class CommandBSHelp : public Command
CommandReturn Execute(User *u, const std::vector<ci::string> &params)
{
- mod_help_cmd(Config.s_BotServ, u, BOTSERV, params[0].c_str());
+ mod_help_cmd(findbot(Config.s_BotServ), u, params[0].c_str());
return MOD_CONT;
}
@@ -46,7 +46,7 @@ class BSHelp : public Module
this->SetAuthor("Anope");
this->SetVersion(VERSION_STRING);
this->SetType(CORE);
- this->AddCommand(BOTSERV, new CommandBSHelp());
+ this->AddCommand(BotServ, new CommandBSHelp());
}
};
diff --git a/src/core/bs_info.c b/src/core/bs_info.c
index 3ac3e9540..3f873aafd 100644
--- a/src/core/bs_info.c
+++ b/src/core/bs_info.c
@@ -19,25 +19,24 @@ class CommandBSInfo : public Command
private:
void send_bot_channels(User * u, BotInfo * bi)
{
- int i;
- ChannelInfo *ci;
char buf[307], *end;
*buf = 0;
end = buf;
- for (i = 0; i < 256; i++) {
- for (ci = chanlists[i]; ci; ci = ci->next) {
- if (ci->bi == bi) {
- if (strlen(buf) + strlen(ci->name.c_str()) > 300) {
- u->SendMessage(Config.s_BotServ, "%s", buf);
- *buf = 0;
- end = buf;
- }
- end +=
- snprintf(end, sizeof(buf) - (end - buf), " %s ",
- ci->name.c_str());
+ for (registered_channel_map::const_iterator it = RegisteredChannelList.begin(); it != RegisteredChannelList.end(); ++it)
+ {
+ ChannelInfo *ci = it->second;
+
+ if (ci->bi == bi)
+ {
+ if (strlen(buf) + strlen(ci->name.c_str()) > 300)
+ {
+ u->SendMessage(Config.s_BotServ, "%s", buf);
+ *buf = 0;
+ end = buf;
}
+ end += snprintf(end, sizeof(buf) - (end - buf), " %s ", ci->name.c_str());
}
}
@@ -251,7 +250,7 @@ class BSInfo : public Module
this->SetAuthor("Anope");
this->SetVersion(VERSION_STRING);
this->SetType(CORE);
- this->AddCommand(BOTSERV, new CommandBSInfo());
+ this->AddCommand(BotServ, new CommandBSInfo());
ModuleManager::Attach(I_OnBotServHelp, this);
}
diff --git a/src/core/bs_kick.c b/src/core/bs_kick.c
index 766239c73..ab2782c8d 100644
--- a/src/core/bs_kick.c
+++ b/src/core/bs_kick.c
@@ -335,7 +335,7 @@ class BSKick : public Module
this->SetAuthor("Anope");
this->SetVersion(VERSION_STRING);
this->SetType(CORE);
- this->AddCommand(BOTSERV, new CommandBSKick());
+ this->AddCommand(BotServ, new CommandBSKick());
ModuleManager::Attach(I_OnBotServHelp, this);
}
diff --git a/src/core/bs_say.c b/src/core/bs_say.c
index 9cd630eb8..8dfc55115 100644
--- a/src/core/bs_say.c
+++ b/src/core/bs_say.c
@@ -81,7 +81,7 @@ class BSSay : public Module
this->SetAuthor("Anope");
this->SetVersion(VERSION_STRING);
this->SetType(CORE);
- this->AddCommand(BOTSERV, new CommandBSSay());
+ this->AddCommand(BotServ, new CommandBSSay());
ModuleManager::Attach(I_OnBotServHelp, this);
}
diff --git a/src/core/bs_set.c b/src/core/bs_