From f049124905bd9f53439293e873003cb027a17b91 Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 14 May 2010 20:35:38 -0400 Subject: Rewrote the hashing system to use std::tr1::unordered_map --- src/core/bs_act.c | 2 +- src/core/bs_assign.c | 2 +- src/core/bs_badwords.c | 2 +- src/core/bs_bot.c | 2 +- src/core/bs_botlist.c | 44 +++-- src/core/bs_help.c | 4 +- src/core/bs_info.c | 27 ++- src/core/bs_kick.c | 2 +- src/core/bs_say.c | 2 +- src/core/bs_set.c | 2 +- src/core/bs_unassign.c | 2 +- src/core/cs_access.c | 4 +- src/core/cs_akick.c | 49 +++--- src/core/cs_ban.c | 4 +- src/core/cs_clear.c | 2 +- src/core/cs_drop.c | 4 +- src/core/cs_forbid.c | 6 +- src/core/cs_getkey.c | 2 +- src/core/cs_help.c | 4 +- src/core/cs_info.c | 2 +- src/core/cs_invite.c | 2 +- src/core/cs_kick.c | 4 +- src/core/cs_list.c | 88 +++++----- src/core/cs_modes.c | 32 ++-- src/core/cs_register.c | 4 +- src/core/cs_set.c | 8 +- src/core/cs_status.c | 2 +- src/core/cs_suspend.c | 8 +- src/core/cs_topic.c | 10 +- src/core/cs_unban.c | 2 +- src/core/cs_xop.c | 14 +- src/core/db_plain.cpp | 444 ++++++++++++++++++++++------------------------- src/core/hs_del.c | 2 +- src/core/hs_delall.c | 2 +- src/core/hs_group.c | 2 +- src/core/hs_help.c | 4 +- src/core/hs_list.c | 69 ++++---- src/core/hs_off.c | 2 +- src/core/hs_on.c | 2 +- src/core/hs_set.c | 2 +- src/core/hs_setall.c | 2 +- src/core/ms_cancel.c | 2 +- src/core/ms_check.c | 2 +- src/core/ms_del.c | 2 +- src/core/ms_help.c | 4 +- src/core/ms_info.c | 2 +- src/core/ms_list.c | 2 +- src/core/ms_read.c | 2 +- src/core/ms_rsend.c | 2 +- src/core/ms_send.c | 2 +- src/core/ms_sendall.c | 20 +-- src/core/ms_set.c | 2 +- src/core/ms_staff.c | 17 +- src/core/ns_access.c | 2 +- src/core/ns_alist.c | 36 ++-- src/core/ns_drop.c | 6 +- src/core/ns_forbid.c | 4 +- src/core/ns_getemail.c | 23 +-- src/core/ns_getpass.c | 6 +- src/core/ns_ghost.c | 2 +- src/core/ns_group.c | 8 +- src/core/ns_help.c | 4 +- src/core/ns_identify.c | 4 +- src/core/ns_info.c | 2 +- src/core/ns_list.c | 95 +++++----- src/core/ns_logout.c | 2 +- src/core/ns_recover.c | 2 +- src/core/ns_register.c | 6 +- src/core/ns_release.c | 2 +- src/core/ns_resetpass.c | 2 +- src/core/ns_saset.c | 4 +- src/core/ns_sendpass.c | 2 +- src/core/ns_set.c | 2 +- src/core/ns_status.c | 2 +- src/core/ns_suspend.c | 8 +- src/core/ns_update.c | 2 +- src/core/os_akill.c | 4 +- src/core/os_chankill.c | 4 +- src/core/os_chanlist.c | 31 ++-- src/core/os_clearmodes.c | 4 +- src/core/os_defcon.c | 24 +-- src/core/os_global.c | 4 +- src/core/os_help.c | 4 +- src/core/os_ignore.c | 2 +- src/core/os_jupe.c | 4 +- src/core/os_kick.c | 6 +- src/core/os_mode.c | 6 +- src/core/os_modinfo.c | 49 +++--- src/core/os_modlist.c | 109 ++++++------ src/core/os_modload.c | 12 +- src/core/os_modunload.c | 12 +- src/core/os_news.c | 6 +- src/core/os_noop.c | 12 +- src/core/os_oline.c | 8 +- src/core/os_quit.c | 2 +- src/core/os_reload.c | 2 +- src/core/os_restart.c | 2 +- src/core/os_session.c | 19 +- src/core/os_set.c | 10 +- src/core/os_sgline.c | 4 +- src/core/os_shutdown.c | 2 +- src/core/os_sqline.c | 4 +- src/core/os_staff.c | 6 +- src/core/os_stats.c | 2 +- src/core/os_svsnick.c | 4 +- src/core/os_szline.c | 4 +- src/core/os_umode.c | 6 +- src/core/os_update.c | 2 +- src/core/os_userlist.c | 32 ++-- src/core/ss_main.c | 19 +- 110 files changed, 759 insertions(+), 820 deletions(-) (limited to 'src/core') 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 ¶ms) { - 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 ¶ms) { - 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_set.c index 0614651cc..3468198a2 100644 --- a/src/core/bs_set.c +++ b/src/core/bs_set.c @@ -185,7 +185,7 @@ class BSSet : public Module this->SetAuthor("Anope"); this->SetVersion(VERSION_STRING); this->SetType(CORE); - this->AddCommand(BOTSERV, new CommandBSSet()); + this->AddCommand(BotServ, new CommandBSSet()); ModuleManager::Attach(I_OnBotServHelp, this); } diff --git a/src/core/bs_unassign.c b/src/core/bs_unassign.c index e053f75d7..067e4cc14 100644 --- a/src/core/bs_unassign.c +++ b/src/core/bs_unassign.c @@ -63,7 +63,7 @@ class BSUnassign : public Module this->SetAuthor("Anope"); this->SetVersion(VERSION_STRING); this->SetType(CORE); - this->AddCommand(BOTSERV, new CommandBSUnassign); + this->AddCommand(BotServ, new CommandBSUnassign); ModuleManager::Attach(I_OnBotServHelp, this); } diff --git a/src/core/cs_access.c b/src/core/cs_access.c index e4e1d0e4b..718a7dc0f 100644 --- a/src/core/cs_access.c +++ b/src/core/cs_access.c @@ -573,8 +573,8 @@ class CSAccess : public Module this->SetVersion(VERSION_STRING); this->SetType(CORE); - this->AddCommand(CHANSERV, new CommandCSAccess()); - this->AddCommand(CHANSERV, new CommandCSLevels()); + this->AddCommand(ChanServ, new CommandCSAccess()); + this->AddCommand(ChanServ, new CommandCSLevels()); ModuleManager::Attach(I_OnChanServHelp, this); } diff --git a/src/core/cs_akick.c b/src/core/cs_akick.c index ac17ef504..abd00be6a 100644 --- a/src/core/cs_akick.c +++ b/src/core/cs_akick.c @@ -152,7 +152,6 @@ class CommandCSAKick : public Command NickAlias *na = findnick(mask.c_str()); NickCore *nc = NULL; AutoKick *akick; - int i; if (!na) { @@ -197,42 +196,40 @@ class CommandCSAKick : public Command } else if ((ci->HasFlag(CI_PEACE))) { - char buf[BUFSIZE]; /* Match against all currently online users with equal or * higher access. - Viper */ - for (i = 0; i < 1024; i++) + for (user_map::const_iterator it = UserListByNick.begin(); it != UserListByNick.end(); ++it) { - for (User *u2 = userlist[i]; u2; u2 = u2->next) + User *u2 = it->second; + + if (IsFounder(u2, ci) || (get_access(u2, ci) >= get_access(u, ci))) { - if (IsFounder(u2, ci) || (get_access(u2, ci) >= get_access(u, ci))) + if (match_usermask(mask.c_str(), u2)) { - if (match_usermask(mask.c_str(), u2)) - { - notice_lang(Config.s_ChanServ, u, ACCESS_DENIED); - return; - } + notice_lang(Config.s_ChanServ, u, ACCESS_DENIED); + return; } } - } - + } - /* Match against the lastusermask of all nickalias's with equal - * or higher access. - Viper */ - for (i = 0; i < 1024; i++) + /* Match against the lastusermask of all nickalias's with equal + * or higher access. - Viper */ + for (nickalias_map::const_iterator it = NickAliasList.begin(); it != NickAliasList.end(); ++it) { - for (NickAlias *na2 = nalists[i]; na2; na2 = na2->next) + NickAlias *na2 = it->second; + + if (na2->HasFlag(NS_FORBIDDEN)) + continue; + + if (na2->nc && ((na2->nc == ci->founder) || (get_access_nc(na2->nc, ci) >= get_access(u, ci)))) { - if (na2->HasFlag(NS_FORBIDDEN)) - continue; + char buf[BUFSIZE]; - if (na2->nc && ((na2->nc == ci->founder) || (get_access_nc(na2->nc, ci) >= get_access(u, ci)))) + snprintf(buf, BUFSIZE, "%s!%s", na2->nick, na2->last_usermask); + if (Anope::Match(buf, mask.c_str(), false)) { - snprintf(buf, BUFSIZE, "%s!%s", na2->nick, na2->last_usermask); - if (Anope::Match(buf, mask.c_str(), false)) - { - notice_lang(Config.s_ChanServ, u, ACCESS_DENIED); - return; - } + notice_lang(Config.s_ChanServ, u, ACCESS_DENIED); + return; } } } @@ -577,7 +574,7 @@ class CSAKick : public Module this->SetAuthor("Anope"); this->SetVersion(VERSION_STRING); this->SetType(CORE); - this->AddCommand(CHANSERV, new CommandCSAKick()); + this->AddCommand(ChanServ, new CommandCSAKick()); ModuleManager::Attach(I_OnChanServHelp, this); } diff --git a/src/core/cs_ban.c b/src/core/cs_ban.c index 95c5c6556..39f290d98 100644 --- a/src/core/cs_ban.c +++ b/src/core/cs_ban.c @@ -104,8 +104,8 @@ class CSBan : public Module this->SetAuthor("Anope"); this->SetVersion(VERSION_STRING); this->SetType(CORE); - this->AddCommand(CHANSERV, new CommandCSBan("BAN")); - this->AddCommand(CHANSERV, new CommandCSBan("KB")); + this->AddCommand(ChanServ, new CommandCSBan("BAN")); + this->AddCommand(ChanServ, new CommandCSBan("KB")); ModuleManager::Attach(I_OnChanServHelp, this); } diff --git a/src/core/cs_clear.c b/src/core/cs_clear.c index bb86e3b74..5e7ef2674 100644 --- a/src/core/cs_clear.c +++ b/src/core/cs_clear.c @@ -171,7 +171,7 @@ class CSClear : public Module this->SetAuthor("Anope"); this->SetVersion(VERSION_STRING); this->SetType(CORE); - this->AddCommand(CHANSERV, new CommandCSClear()); + this->AddCommand(ChanServ, new CommandCSClear()); ModuleManager::Attach(I_OnChanServHelp, this); } diff --git a/src/core/cs_drop.c b/src/core/cs_drop.c index b91fdc846..f7c7a8571 100644 --- a/src/core/cs_drop.c +++ b/src/core/cs_drop.c @@ -79,7 +79,7 @@ class CommandCSDrop : public Command */ if (Config.WallDrop) { if ((level < ACCESS_FOUNDER) || (!IsRealFounder(u, ci) && ci->HasFlag(CI_SECUREFOUNDER))) - ircdproto->SendGlobops(findbot(Config.s_ChanServ), "\2%s\2 used DROP on channel \2%s\2", u->nick.c_str(), chan); + ircdproto->SendGlobops(ChanServ, "\2%s\2 used DROP on channel \2%s\2", u->nick.c_str(), chan); } notice_lang(Config.s_ChanServ, u, CHAN_DROPPED, chan); @@ -113,7 +113,7 @@ class CSDrop : public Module this->SetAuthor("Anope"); this->SetVersion(VERSION_STRING); this->SetType(CORE); - this->AddCommand(CHANSERV, new CommandCSDrop()); + this->AddCommand(ChanServ, new CommandCSDrop()); ModuleManager::Attach(I_OnChanServHelp, this); } diff --git a/src/core/cs_forbid.c b/src/core/cs_forbid.c index b47982a7e..06447c800 100644 --- a/src/core/cs_forbid.c +++ b/src/core/cs_forbid.c @@ -78,12 +78,12 @@ class CommandCSForbid : public Command if (is_oper(uc->user)) continue; - c->Kick(findbot(Config.s_ChanServ), uc->user, "%s", reason ? reason : getstring(uc->user->Account(), CHAN_FORBID_REASON)); + c->Kick(ChanServ, uc->user, "%s", reason ? reason : getstring(uc->user->Account(), CHAN_FORBID_REASON)); } } if (Config.WallForbid) - ircdproto->SendGlobops(findbot(Config.s_ChanServ), "\2%s\2 used FORBID on channel \2%s\2", u->nick.c_str(), ci->name.c_str()); + ircdproto->SendGlobops(ChanServ, "\2%s\2 used FORBID on channel \2%s\2", u->nick.c_str(), ci->name.c_str()); if (ircd->chansqline) { @@ -118,7 +118,7 @@ class CSForbid : public Module this->SetAuthor("Anope"); this->SetVersion(VERSION_STRING); this->SetType(CORE); - this->AddCommand(CHANSERV, new CommandCSForbid()); + this->AddCommand(ChanServ, new CommandCSForbid()); ModuleManager::Attach(I_OnChanServHelp, this); } diff --git a/src/core/cs_getkey.c b/src/core/cs_getkey.c index a0937911b..935a2bdbe 100644 --- a/src/core/cs_getkey.c +++ b/src/core/cs_getkey.c @@ -66,7 +66,7 @@ class CSGetKey : public Module this->SetAuthor("Anope"); this->SetVersion(VERSION_STRING); this->SetType(CORE); - this->AddCommand(CHANSERV, new CommandCSGetKey()); + this->AddCommand(ChanServ, new CommandCSGetKey()); ModuleManager::Attach(I_OnChanServHelp, this); } diff --git a/src/core/cs_help.c b/src/core/cs_help.c index d975647b2..941634483 100644 --- a/src/core/cs_help.c +++ b/src/core/cs_help.c @@ -46,7 +46,7 @@ class CommandCSHelp : public Command } } else - mod_help_cmd(Config.s_ChanServ, u, CHANSERV, cmd.c_str()); + mod_help_cmd(ChanServ, u, cmd.c_str()); return MOD_CONT; } @@ -71,7 +71,7 @@ class CSHelp : public Module this->SetAuthor("Anope"); this->SetVersion(VERSION_STRING); this->SetType(CORE); - this->AddCommand(CHANSERV, new CommandCSHelp()); + this->AddCommand(ChanServ, new CommandCSHelp()); } }; diff --git a/src/core/cs_info.c b/src/core/cs_info.c index b3e7a1077..c0c99c856 100644 --- a/src/core/cs_info.c +++ b/src/core/cs_info.c @@ -168,7 +168,7 @@ class CSInfo : public Module this->SetAuthor("Anope"); this->SetVersion(VERSION_STRING); this->SetType(CORE); - this->AddCommand(CHANSERV, new CommandCSInfo()); + this->AddCommand(ChanServ, new CommandCSInfo()); ModuleManager::Attach(I_OnChanServHelp, this); } diff --git a/src/core/cs_invite.c b/src/core/cs_invite.c index b71e487cc..2abcf82bb 100644 --- a/src/core/cs_invite.c +++ b/src/core/cs_invite.c @@ -84,7 +84,7 @@ class CSInvite : public Module this->SetAuthor("Anope"); this->SetVersion(VERSION_STRING); this->SetType(CORE); - this->AddCommand(CHANSERV, new CommandCSInvite()); + this->AddCommand(ChanServ, new CommandCSInvite()); ModuleManager::Attach(I_OnChanServHelp, this); } diff --git a/src/core/cs_kick.c b/src/core/cs_kick.c index 42059a01b..1c05ea77e 100644 --- a/src/core/cs_kick.c +++ b/src/core/cs_kick.c @@ -89,8 +89,8 @@ class CSKick : public Module this->SetAuthor("Anope"); this->SetVersion(VERSION_STRING); this->SetType(CORE); - this->AddCommand(CHANSERV, new CommandCSKick("KICK")); - this->AddCommand(CHANSERV, new CommandCSKick("K")); + this->AddCommand(ChanServ, new CommandCSKick("KICK")); + this->AddCommand(ChanServ, new CommandCSKick("K")); ModuleManager::Attach(I_OnChanServHelp, this); } diff --git a/src/core/cs_list.c b/src/core/cs_list.c index cb86bb300..4b6f1d242 100644 --- a/src/core/cs_list.c +++ b/src/core/cs_list.c @@ -28,8 +28,7 @@ public: const char *pattern = params[0].c_str(); int spattern_size; char *spattern; - ChannelInfo *ci; - unsigned nchans, i; + unsigned nchans; char buf[BUFSIZE]; bool is_servadmin = u->Account()->HasCommand("chanserv/list"); int count = 0, from = 0, to = 0, tofree = 0; @@ -111,55 +110,56 @@ public: snprintf(spattern, spattern_size, "#%s", pattern); notice_lang(Config.s_ChanServ, u, CHAN_LIST_HEADER, pattern); - for (i = 0; i < 256; i++) + + for (registered_channel_map::const_iterator it = RegisteredChannelList.begin(); it != RegisteredChannelList.end(); ++it) { - for (ci = chanlists[i]; ci; ci = ci->next) + ChannelInfo *ci = it->second; + + if (!is_servadmin && ((ci->HasFlag(CI_PRIVATE)) + || (ci->HasFlag(CI_FORBIDDEN)) || (ci->HasFlag(CI_SUSPENDED)))) + continue; + if (forbidden && !ci->HasFlag(CI_FORBIDDEN)) + continue; + else if (suspended && !ci->HasFlag(CI_SUSPENDED)) + continue; + else if (channoexpire && !ci->HasFlag(CI_NO_EXPIRE)) + continue; + + if ((stricmp(pattern, ci->name.c_str()) == 0) + || (stricmp(spattern, ci->name.c_str()) == 0) + || Anope::Match(ci->name, pattern, false) + || Anope::Match(ci->name, spattern, false)) { - if (!is_servadmin && ((ci->HasFlag(CI_PRIVATE)) - || (ci->HasFlag(CI_FORBIDDEN)) || (ci->HasFlag(CI_SUSPENDED)))) - continue; - if (forbidden && !ci->HasFlag(CI_FORBIDDEN)) - continue; - else if (suspended && !ci->HasFlag(CI_SUSPENDED)) - continue; - else if (channoexpire && !ci->HasFlag(CI_NO_EXPIRE)) - continue; - - if ((stricmp(pattern, ci->name.c_str()) == 0) - || (stricmp(spattern, ci->name.c_str()) == 0) - || Anope::Match(ci->name, pattern, false) - || Anope::Match(ci->name, spattern, false)) + if ((((count + 1 >= from) && (count + 1 <= to)) + || ((from == 0) && (to == 0))) + && (++nchans <= Config.CSListMax)) { - if ((((count + 1 >= from) && (count + 1 <= to)) - || ((from == 0) && (to == 0))) - && (++nchans <= Config.CSListMax)) + char noexpire_char = ' '; + if (is_servadmin && (ci->HasFlag(CI_NO_EXPIRE))) + noexpire_char = '!'; + + if (ci->HasFlag(CI_FORBIDDEN)) + { + snprintf(buf, sizeof(buf), + "%-20s [Forbidden]", ci->name.c_str()); + } + else if (ci->HasFlag(CI_SUSPENDED)) { - char noexpire_char = ' '; - if (is_servadmin && (ci->HasFlag(CI_NO_EXPIRE))) - noexpire_char = '!'; - - if (ci->HasFlag(CI_FORBIDDEN)) - { - snprintf(buf, sizeof(buf), - "%-20s [Forbidden]", ci->name.c_str()); - } - else if (ci->HasFlag(CI_SUSPENDED)) - { - snprintf(buf, sizeof(buf), - "%-20s [Suspended]", ci->name.c_str()); - } - else - { - snprintf(buf, sizeof(buf), "%-20s %s", - ci->name.c_str(), ci->desc ? ci->desc : ""); - } - - u->SendMessage(Config.s_ChanServ, " %c%s", noexpire_char, buf); + snprintf(buf, sizeof(buf), + "%-20s [Suspended]", ci->name.c_str()); } - count++; + else + { + snprintf(buf, sizeof(buf), "%-20s %s", + ci->name.c_str(), ci->desc ? ci->desc : ""); + } + + u->SendMessage(Config.s_ChanServ, " %c%s", noexpire_char, buf); } + count++; } } + notice_lang(Config.s_ChanServ, u, CHAN_LIST_END, nchans > Config.CSListMax ? Config.CSListMax : nchans, nchans); delete [] spattern; @@ -188,7 +188,7 @@ public: this->SetAuthor("Anope"); this->SetVersion(VERSION_STRING); this->SetType(CORE); - this->AddCommand(CHANSERV, new CommandCSList()); + this->AddCommand(ChanServ, new CommandCSList()); ModuleManager::Attach(I_OnChanServHelp, this); } diff --git a/src/core/cs_modes.c b/src/core/cs_modes.c index 788c1adac..3480ca1b6 100644 --- a/src/core/cs_modes.c +++ b/src/core/cs_modes.c @@ -375,10 +375,10 @@ class CSModes : public Module this->SetVersion(VERSION_STRING); this->SetType(CORE); - this->AddCommand(CHANSERV, new CommandCSOp()); - this->AddCommand(CHANSERV, new CommandCSDeOp()); - this->AddCommand(CHANSERV, new CommandCSVoice()); - this->AddCommand(CHANSERV, new CommandCSDeVoice()); + this->AddCommand(ChanServ, new CommandCSOp()); + this->AddCommand(ChanServ, new CommandCSDeOp()); + this->AddCommand(ChanServ, new CommandCSVoice()); + this->AddCommand(ChanServ, new CommandCSDeVoice()); if (Me && Me->IsSynced()) OnUplinkSync(); @@ -393,31 +393,31 @@ class CSModes : public Module { if (ModeManager::FindChannelModeByName(CMODE_OWNER)) { - this->AddCommand(CHANSERV, new CommandCSOwner()); - this->AddCommand(CHANSERV, new CommandCSDeOwner()); + this->AddCommand(ChanServ, new CommandCSOwner()); + this->AddCommand(ChanServ, new CommandCSDeOwner()); } if (ModeManager::FindChannelModeByName(CMODE_PROTECT)) { - this->AddCommand(CHANSERV, new CommandCSProtect()); - this->AddCommand(CHANSERV, new CommandCSDeProtect()); + this->AddCommand(ChanServ, new CommandCSProtect()); + this->AddCommand(ChanServ, new CommandCSDeProtect()); } if (ModeManager::FindChannelModeByName(CMODE_HALFOP)) { - this->AddCommand(CHANSERV, new CommandCSHalfOp()); - this->AddCommand(CHANSERV, new CommandCSDeHalfOp()); + this->AddCommand(ChanServ, new CommandCSHalfOp()); + this->AddCommand(ChanServ, new CommandCSDeHalfOp()); } } void OnServerDisconnect() { - this->DelCommand(CHANSERV, "OWNER"); - this->DelCommand(CHANSERV, "DEOWNER"); - this->DelCommand(CHANSERV, "PROTECT"); - this->DelCommand(CHANSERV, "DEPROTECT"); - this->DelCommand(CHANSERV, "HALFOP"); - this->DelCommand(CHANSERV, "DEHALFOP"); + this->DelCommand(ChanServ, FindCommand(ChanServ, "OWNER")); + this->DelCommand(ChanServ, FindCommand(ChanServ, "DEOWNER")); + this->DelCommand(ChanServ, FindCommand(ChanServ, "PROTECT")); + this->DelCommand(ChanServ, FindCommand(ChanServ, "DEPROTECT")); + this->DelCommand(ChanServ, FindCommand(ChanServ, "HALFOP")); + this->DelCommand(ChanServ, FindCommand(ChanServ, "DEHALFOP")); } void OnChanServHelp(User *u) diff --git a/src/core/cs_register.c b/src/core/cs_register.c index 2c6531226..882e0e17c 100644 --- a/src/core/cs_register.c +++ b/src/core/cs_register.c @@ -44,8 +44,6 @@ class CommandCSRegister : public Command notice_lang(Config.s_ChanServ, u, CHAN_X_INVALID, chan); else if ((ci = cs_findchan(chan))) notice_lang(Config.s_ChanServ, u, CHAN_ALREADY_REGISTERED, chan); - else if (!stricmp(chan, "#")) - notice_lang(Config.s_ChanServ, u, CHAN_MAY_NOT_BE_REGISTERED, chan); else if (c && !c->HasUserStatus(u, CMODE_OP)) notice_lang(Config.s_ChanServ, u, CHAN_MUST_BE_CHANOP); else if (Config.CSMaxReg && u->Account()->channelcount >= Config.CSMaxReg && !u->Account()->HasPriv("chanserv/no-register-limit")) @@ -125,7 +123,7 @@ class CSRegister : public Module this->SetVersion(VERSION_STRING); this->SetType(CORE); - this->AddCommand(CHANSERV, new CommandCSRegister()); + this->AddCommand(ChanServ, new CommandCSRegister()); ModuleManager::Attach(I_OnChanServHelp, this); } diff --git a/src/core/cs_set.c b/src/core/cs_set.c index c964d26fc..0a8d6ac5b 100644 --- a/src/core/cs_set.c +++ b/src/core/cs_set.c @@ -557,7 +557,7 @@ class CommandCSSet : public Command /* Give them ChanServ * Yes, this works fine with no Config.s_BotServ */ - findbot(Config.s_ChanServ)->Assign(NULL, ci); + ChanServ->Assign(NULL, ci); } /* Set the perm mode */ @@ -587,7 +587,7 @@ class CommandCSSet : public Command if (!cm && !Config.s_BotServ && ci->bi) { /* Unassign bot */ - findbot(Config.s_ChanServ)->UnAssign(NULL, ci); + ChanServ->UnAssign(NULL, ci); } if (ci->c && ci->c->users.empty()) @@ -700,7 +700,7 @@ class CommandCSSet : public Command DoSetOpNotice(u, ci, param); else if (cmd == "XOP") { - if (!findModule("cs_xop")) + if (!FindModule("cs_xop")) notice_lang(Config.s_ChanServ, u, CHAN_XOP_NOT_AVAILABLE, cmd.c_str()); else DoSetXOP(u, ci, param); @@ -826,7 +826,7 @@ class CSSet : public Module this->SetAuthor("Anope"); this->SetVersion(VERSION_STRING); this->SetType(CORE); - this->AddCommand(CHANSERV, new CommandCSSet()); + this->AddCommand(ChanServ, new CommandCSSet()); ModuleManager::Attach(I_OnChanServHelp, this); } diff --git a/src/core/cs_status.c b/src/core/cs_status.c index 18d175f34..9db2b2d00 100644 --- a/src/core/cs_status.c +++ b/src/core/cs_status.c @@ -66,7 +66,7 @@ class CSStatus : public Module this->SetVersion(VERSION_STRING); this->SetType(CORE); - this->AddCommand(CHANSERV, new CommandCSStatus()); + this->AddCommand(ChanServ, new CommandCSStatus()); ModuleManager::Attach(I_OnChanServHelp, this); } diff --git a/src/core/cs_suspend.c b/src/core/cs_suspend.c index 39b1f9fd5..654dd9711 100644 --- a/src/core/cs_suspend.c +++ b/src/core/cs_suspend.c @@ -73,7 +73,7 @@ class CommandCSSuspend : public Command } if (Config.WallForbid) - ircdproto->SendGlobops(findbot(Config.s_ChanServ), "\2%s\2 used SUSPEND on channel \2%s\2", u->nick.c_str(), ci->name.c_str()); + ircdproto->SendGlobops(ChanServ, "\2%s\2 used SUSPEND on channel \2%s\2", u->nick.c_str(), ci->name.c_str()); Alog() << Config.s_ChanServ << ": " << u->GetMask() << " set SUSPEND for channel " << ci->name; notice_lang(Config.s_ChanServ, u, CHAN_SUSPEND_SUCCEEDED, chan); @@ -143,7 +143,7 @@ class CommandCSUnSuspend : public Command } if (Config.WallForbid) - ircdproto->SendGlobops(findbot(Config.s_ChanServ), "\2%s\2 used UNSUSPEND on channel \2%s\2", u->nick.c_str(), ci->name.c_str()); + ircdproto->SendGlobops(ChanServ, "\2%s\2 used UNSUSPEND on channel \2%s\2", u->nick.c_str(), ci->name.c_str()); Alog() << Config.s_ChanServ << ": " << u->GetMask() << " set UNSUSPEND for channel " << ci->name; notice_lang(Config.s_ChanServ, u, CHAN_UNSUSPEND_SUCCEEDED, chan); @@ -179,8 +179,8 @@ class CSSuspend : public Module this->SetVersion(VERSION_STRING); this->SetType(CORE); - this->AddCommand(CHANSERV, new CommandCSSuspend()); - this->AddCommand(CHANSERV, new CommandCSUnSuspend()); + this->AddCommand(ChanServ, new CommandCSSuspend()); + this->AddCommand(ChanServ, new CommandCSUnSuspend()); ModuleManager::Attach(I_OnChanServHelp, this); } diff --git a/src/core/cs_topic.c b/src/core/cs_topic.c index da41e0ac3..b8642666c 100644 --- a/src/core/cs_topic.c +++ b/src/core/cs_topic.c @@ -55,14 +55,14 @@ class CommandCSTopic : public Command if (!check_access(u, ci, CA_TOPIC)) Alog() << Config.s_NickServ << ": " << u->GetMask() << " changed topic of " << c->name << " as services admin."; - if (ircd->join2set && whosends(ci) == findbot(Config.s_ChanServ)) + if (ircd->join2set && whosends(ci) == ChanServ) { - ircdproto->SendJoin(findbot(Config.s_ChanServ), c->name.c_str(), c->creation_time); + ircdproto->SendJoin(ChanServ, c->name.c_str(), c->creation_time); ircdproto->SendMode(NULL, c, "+o %s", Config.s_ChanServ); } ircdproto->SendTopic(whosends(ci), c, u->nick.c_str(), topic ? topic : ""); - if (ircd->join2set && whosends(ci) == findbot(Config.s_ChanServ)) - ircdproto->SendPart(findbot(Config.s_ChanServ), c, NULL); + if (ircd->join2set && whosends(ci) == ChanServ) + ircdproto->SendPart(ChanServ, c, NULL); } return MOD_CONT; } @@ -88,7 +88,7 @@ class CSTopic : public Module this->SetVersion(VERSION_STRING); this->SetType(CORE); - this->AddCommand(CHANSERV, new CommandCSTopic()); + this->AddCommand(ChanServ, new CommandCSTopic()); ModuleManager::Attach(I_OnChanServHelp, this); } diff --git a/src/core/cs_unban.c b/src/core/cs_unban.c index aa6184fbb..0ae2077ed 100644 --- a/src/core/cs_unban.c +++ b/src/core/cs_unban.c @@ -78,7 +78,7 @@ class CSUnban : public Module this->SetVersion(VERSION_STRING); this->SetType(CORE); - this->AddCommand(CHANSERV, new CommandCSUnban()); + this->AddCommand(ChanServ, new CommandCSUnban()); ModuleManager::Attach(I_OnChanServHelp, this); } diff --git a/src/core/cs_xop.c b/src/core/cs_xop.c index 18ff222b1..522c28001 100644 --- a/src/core/cs_xop.c +++ b/src/core/cs_xop.c @@ -540,9 +540,9 @@ class CSXOP : public Module this->SetVersion(VERSION_STRING); this->SetType(CORE); - this->AddCommand(CHANSERV, new CommandCSSOP()); - this->AddCommand(CHANSERV, new CommandCSAOP()); - this->AddCommand(CHANSERV, new CommandCSVOP()); + this->AddCommand(ChanServ, new CommandCSSOP()); + this->AddCommand(ChanServ, new CommandCSAOP()); + this->AddCommand(ChanServ, new CommandCSVOP()); if (Me && Me->IsSynced()) OnUplinkSync(); @@ -556,15 +556,15 @@ class CSXOP : public Module void OnUplinkSync() { if (ModeManager::FindChannelModeByName(CMODE_OWNER)) - this->AddCommand(CHANSERV, new CommandCSQOP()); + this->AddCommand(ChanServ, new CommandCSQOP()); if (ModeManager::FindChannelModeByName(CMODE_HALFOP)) - this->AddCommand(CHANSERV, new CommandCSHOP()); + this->AddCommand(ChanServ, new CommandCSHOP()); } void OnServerDisconnect() { - this->DelCommand(CHANSERV, "QOP"); - this->DelCommand(CHANSERV, "HOP"); + this->DelCommand(ChanServ, FindCommand(ChanServ, "QOP")); + this->DelCommand(ChanServ, FindCommand(ChanServ, "HOP")); } void OnChanServHelp(User *u) diff --git a/src/core/db_plain.cpp b/src/core/db_plain.cpp index 24b494d82..095082009 100644 --- a/src/core/db_plain.cpp +++ b/src/core/db_plain.cpp @@ -422,11 +422,11 @@ static void LoadBotInfo(const std::vector ¶ms) BotInfo *bi = findbot(params[0]); if (!bi) bi = new BotInfo(params[0]); - bi->user = sstrdup(params[1].c_str()); - bi->host = sstrdup(params[2].c_str()); + bi->user = params[1]; + bi->host = params[2]; bi->created = atol(params[3].c_str()); bi->chancount = atol(params[4].c_str()); - bi->real = sstrdup(params[5].c_str()); + bi->real = params[5]; Alog(LOG_DEBUG_2) << "[db_plain]: Loaded botinfo for " << bi->nick; } @@ -560,7 +560,7 @@ class DBPlain : public Module Alog(LOG_DEBUG) << "db_plain: Attemping to rename " << DatabaseFile << " to " << newname; if (rename(DatabaseFile.c_str(), newname) != 0) { - ircdproto->SendGlobops(findbot(Config.s_OperServ), "Unable to backup database!"); + ircdproto->SendGlobops(OperServ, "Unable to backup database!"); Alog() << "Unable to back up database!"; if (!Config.NoBackupOkay) @@ -698,20 +698,6 @@ class DBPlain : public Module { if (params[j] == "PRIVATE") bi->SetFlag(BI_PRIVATE); - else if (params[j] == "CHANSERV") - bi->SetFlag(BI_CHANSERV); - else if (params[j] == "BOTSERV") - bi->SetFlag(BI_BOTSERV); - else if (params[j] == "HOSTSERV") - bi->SetFlag(BI_HOSTSERV); - else if (params[j] == "OPERSERV") - bi->SetFlag(BI_OPERSERV); - else if (params[j] == "MEMOSERV") - bi->SetFlag(BI_MEMOSERV); - else if (params[j] == "NICKSERV") - bi->SetFlag(BI_NICKSERV); - else if (params[j] == "GLOBAL") - bi->SetFlag(BI_GLOBAL); } } @@ -936,277 +922,255 @@ class DBPlain : public Module db << "VER 1" << endl; - for (int i = 0; i < 1024; ++i) + for (nickrequest_map::const_iterator it = NickRequestList.begin(); it != NickRequestList.end(); ++it) { - for (NickRequest *nr = nrlists[i]; nr; nr = nr->next) - { - db << "NR " << nr->nick << " " << nr->passcode << " " << nr->password << " " << nr->email << " " << nr->requested << endl; + NickRequest *nr = it->second; + + db << "NR " << nr->nick << " " << nr->passcode << " " << nr->password << " " << nr->email << " " << nr->requested << endl; - FOREACH_MOD(I_OnDatabaseWriteMetadata, OnDatabaseWriteMetadata(WriteMetadata, nr)); - } + FOREACH_MOD(I_OnDatabaseWriteMetadata, OnDatabaseWriteMetadata(WriteMetadata, nr)); } - for (int i = 0; i < 1024; ++i) + for (nickcore_map::const_iterator nit = NickCoreList.begin(); nit != NickCoreList.end(); ++nit) { - for (NickCore *nc = nclists[i]; nc; nc = nc->next) + NickCore *nc = nit->second; + + if (nc->HasFlag(NI_FORBIDDEN)) { - if (nc->HasFlag(NI_FORBIDDEN)) - { - db << "NC " << nc->display << endl; - db << "MD FLAGS FORBIDDEN" << endl; - FOREACH_MOD(I_OnDatabaseWriteMetadata, OnDatabaseWriteMetadata(WriteMetadata, nc)); - continue; - } - else - { - db << "NC " << nc->display << " " << nc->pass << " "; - } - for (int j = 0; LangInfos[j].LanguageId != -1; ++j) - if (nc->language == LangInfos[j].LanguageId) - db << LangInfos[j].Name; - db << " " << nc->memos.memomax << " " << nc->channelcount << endl; - - if (nc->email) - db << "MD EMAIL " << nc->email << endl; - if (nc->greet) - db << "MD GREET :" << nc->greet << endl; - if (nc->icq) - db << "MD ICQ :" << nc->icq << endl; - if (nc->url) - db << "MD URL :" << nc->url << endl; - if (!nc->access.empty()) - { - for (std::vector::iterator it = nc->access.begin(); it != nc->access.end(); ++it) - db << "MD ACCESS " << *it << endl; - } - if (nc->FlagCount()) - { - db << "MD FLAGS"; - for (int j = 0; NickCoreFlags[j].Flag != -1; ++j) - if (nc->HasFlag(NickCoreFlags[j].Flag)) - db << " " << NickCoreFlags[j].Name; - db << endl; - } - if (!nc->memos.memos.empty()) + db << "NC " << nc->display << endl; + db << "MD FLAGS FORBIDDEN" << endl; + FOREACH_MOD(I_OnDatabaseWriteMetadata, OnDatabaseWriteMetadata(WriteMetadata, nc)); + continue; + } + else + { + db << "NC " << nc->display << " " << nc->pass << " "; + } + for (int j = 0; LangInfos[j].LanguageId != -1; ++j) + if (nc->language == LangInfos[j].LanguageId) + db << LangInfos[j].Name; + db << " " << nc->memos.memomax << " " << nc->channelcount << endl; + + if (nc->email) + db << "MD EMAIL " << nc->email << endl; + if (nc->greet) + db << "MD GREET :" << nc->greet << endl; + if (nc->icq) + db << "MD ICQ :" << nc->icq << endl; + if (nc->url) + db << "MD URL :" << nc->url << endl; + if (!nc->access.empty()) + { + for (std::vector::iterator it = nc->access.begin(); it != nc->access.end(); ++it) + db << "MD ACCESS " << *it << endl; + } + if (nc->FlagCount()) + { + db << "MD FLAGS"; + for (int j = 0; NickCoreFlags[j].Flag != -1; ++j) + if (nc->HasFlag(NickCoreFlags[j].Flag)) + db << " " << NickCoreFlags[j].Name; + db << endl; + } + if (!nc->memos.memos.empty()) + { + MemoInfo *mi = &nc->memos; + for (unsigned k = 0; k < mi->memos.size(); ++k) { - MemoInfo *mi = &nc->memos; - for (unsigned k = 0; k < mi->memos.size(); ++k) - { - db << "MD MI " << mi->memos[k]->number << " " << mi->memos[k]->time << " " << mi->memos[k]->sender; - if (mi->memos[k]->HasFlag(MF_UNREAD)) - db << " UNREAD"; - if (mi->memos[k]->HasFlag(MF_RECEIPT)) - db << " RECEIPT"; - if (mi->memos[k]->HasFlag(MF_NOTIFYS)) - db << " NOTIFYS"; - db << " :" << mi->memos[k]->text << endl; - } + db << "MD MI " << mi->memos[k]->number << " " << mi->memos[k]->time << " " << mi->memos[k]->sender; + if (mi->memos[k]->HasFlag(MF_UNREAD)) + db << " UNREAD"; + if (mi->memos[k]->HasFlag(MF_RECEIPT)) + db << " RECEIPT"; + if (mi->memos[k]->HasFlag(MF_NOTIFYS)) + db << " NOTIFYS"; + db << " :" << mi->memos[k]->text << endl; } - - FOREACH_MOD(I_OnDatabaseWriteMetadata, OnDatabaseWriteMetadata(WriteMetadata, nc)); - } + FOREACH_MOD(I_OnDatabaseWriteMetadata, OnDatabaseWriteMetadata(WriteMetadata, nc)); + } - for (int i = 0; i < 1024; ++i) + for (nickalias_map::const_iterator it = NickAliasList.begin(); it != NickAliasList.end(); ++it) { - for (NickAlias *na = nalists[i]; na; na = na->next) + NickAlias *na = it->second; + + db << "NA " << na->nc->display << " " << na->nick << " " << na->time_registered << " " << na->last_seen << endl; + if (na->last_usermask) + db << "MD LAST_USERMASK " << na->last_usermask << endl; + if (na->last_realname) + db << "MD LAST_REALNAME :" << na->last_realname << endl; + if (na->last_quit) + db << "MD LAST_QUIT :" << na->last_quit << endl; + if (na->HasFlag(NS_FORBIDDEN) || na->HasFlag(NS_NO_EXPIRE)) { - db << "NA " << na->nc->display << " " << na->nick << " " << na->time_registered << " " << na->last_seen << endl; - if (na->last_usermask) - db << "MD LAST_USERMASK " << na->last_usermask << endl; - if (na->last_realname) - db << "MD LAST_REALNAME :" << na->last_realname << endl; - if (na->last_quit) - db << "MD LAST_QUIT :" << na->last_quit << endl; - if (na->HasFlag(NS_FORBIDDEN) || na->HasFlag(NS_NO_EXPIRE)) - { - db << "MD FLAGS" << (na->HasFlag(NS_FORBIDDEN) ? " FORBIDDEN" : "") << (na->HasFlag(NS_NO_EXPIRE) ? " NOEXPIRE " : "") << endl; - } - if (na->hostinfo.HasVhost()) - { - db << "MD VHOST " << na->hostinfo.GetCreator() << " " << na->hostinfo.GetTime() << " " << na->hostinfo.GetHost() << " :" << na->hostinfo.GetIdent() << endl; - } - - FOREACH_MOD(I_OnDatabaseWriteMetadata, OnDatabaseWriteMetadata(WriteMetadata, na)); + db << "MD FLAGS" << (na->HasFlag(NS_FORBIDDEN) ? " FORBIDDEN" : "") << (na->HasFlag(NS_NO_EXPIRE) ? " NOEXPIRE " : "") << endl; + } + if (na->hostinfo.HasVhost()) + { + db << "MD VHOST " << na->hostinfo.GetCreator() << " " << na->hostinfo.GetTime() << " " << na->hostinfo.GetHost() << " :" << na->hostinfo.GetIdent() << endl; } + + FOREACH_MOD(I_OnDatabaseWriteMetadata, OnDatabaseWriteMetadata(WriteMetadata, na)); } - for (int i = 0; i < 256; ++i) + for (botinfo_map::const_iterator it = BotList.begin(); it != BotList.end(); ++it) { - for (BotInfo *bi = botlists[i]; bi; bi = bi->next) + BotInfo *bi = it->second; + + db << "BI " << bi->nick << " " << bi->user << " " << bi->host << " " << bi->created << " " << bi->chancount << " :" << bi->real << endl; + if (bi->FlagCount()) { - db << "BI " << bi->nick << " " << bi->user << " " << bi->host << " " << bi->created << " " << bi->chancount << " :" << bi->real << endl; - if (bi->FlagCount()) - { - db << "MD FLAGS"; - if (bi->HasFlag(BI_PRIVATE)) - db << " PRIVATE"; - if (bi->HasFlag(BI_CHANSERV)) - db << " CHANSERV"; - else if (bi->HasFlag(BI_BOTSERV)) - db << " BOTSERV"; - else if (bi->HasFlag(BI_HOSTSERV)) - db << " HOSTSERV"; - else if (bi->HasFlag(BI_OPERSERV)) - db << " OPERSERV"; - else if (bi->HasFlag(BI_MEMOSERV)) - db << " MEMOSERV"; - else if (bi->HasFlag(BI_NICKSERV)) - db << " NICKSERV"; - else if (bi->HasFlag(BI_GLOBAL)) - db << " GLOBAL"; - db << endl; - } - - FOREACH_MOD(I_OnDatabaseWriteMetadata, OnDatabaseWriteMetadata(WriteMetadata, bi)); + db << "MD FLAGS"; + if (bi->HasFlag(BI_PRIVATE)) + db << " PRIVATE"; + db << endl; } } - for (int i = 0; i < 256; ++i) + for (registered_channel_map::const_iterator cit = RegisteredChannelList.begin(); cit != RegisteredChannelList.end(); ++cit) { - for (ChannelInfo *ci = chanlists[i]; ci; ci = ci->next) + ChannelInfo *ci = cit->second; + + db << "CH " << ci->name << " " << ci->time_registered << " " << ci->last_used; + db << " " << ci->bantype << " " << ci->memos.memomax << endl; + if (ci->founder) + db << "MD FOUNDER " << ci->founder->display << endl; + if (ci->successor) + db << "MD SUCCESSOR " << ci->successor->display << endl; + if (ci->desc) + db << "MD DESC :" << ci->desc << endl; + if (ci->url) + db << "MD URL :" << ci->url << endl; + if (ci->email) + db << "MD EMAIL :" << ci->email << endl; + if (ci->last_topic) + db << "MD TOPIC " << ci->last_topic_setter << " " << ci->last_topic_time << " :" << ci->last_topic << endl; + db << "MD LEVELS"; + for (int j = 0; ChannelLevels[j].Level != -1; ++j) + db << " " << ChannelLevels[j].Name << " " << ci->levels[ChannelLevels[j].Level]; + db << endl; + if (ci->FlagCount()) { - db << "CH " << ci->name << " " << ci->time_registered << " " << ci->last_used; - db << " " << ci->bantype << " " << ci->memos.memomax << endl; - if (ci->founder) - db << "MD FOUNDER " << ci->founder->display << endl; - if (ci->successor) - db << "MD SUCCESSOR " << ci->successor->display << endl; - if (ci->desc) - db << "MD DESC :" << ci->desc << endl; - if (ci->url) - db << "MD URL :" << ci->url << endl; - if (ci->email) - db << "MD EMAIL :" << ci->email << endl; - if (ci->last_topic) - db << "MD TOPIC " << ci->last_topic_setter << " " << ci->last_topic_time << " :" << ci->last_topic << endl; - db << "MD LEVELS"; - for (int j = 0; ChannelLevels[j].Level != -1; ++j) - db << " " << ChannelLevels[j].Name << " " << ci->levels[ChannelLevels[j].Level]; + db << "MD FLAGS"; + for (int j = 0; ChannelInfoFlags[j].Flag != -1; ++j) + if (ci->HasFlag(ChannelInfoFlags[j].Flag)) + db << " " << ChannelInfoFlags[j].Name; db << endl; - if (ci->FlagCount()) - { - db << "MD FLAGS"; - for (int j = 0; ChannelInfoFlags[j].Flag != -1; ++j) - if (ci->HasFlag(ChannelInfoFlags[j].Flag)) - db << " " << ChannelInfoFlags[j].Name; - db << endl; - if (ci->HasFlag(CI_FORBIDDEN)) - db << "MD FORBID " << ci->forbidby << " :" << ci->forbidreason << endl; - } - for (unsigned k = 0; k < ci->GetAccessCount(); ++k) - if (ci->GetAccess(k)->in_use) - db << "MD ACCESS " << ci->GetAccess(k)->nc->display << " " << ci->GetAccess(k)->level << " " - << ci->GetAccess(k)->last_seen << " " << ci->GetAccess(k)->creator << endl; - for (unsigned k = 0; k < ci->GetAkickCount(); ++k) - { - db << "MD AKICK " - << (ci->GetAkick(k)->HasFlag(AK_STUCK) ? "STUCK " : "UNSTUCK ") - << (ci->GetAkick(k)->HasFlag(AK_ISNICK) ? "NICK " : "MASK ") - << (ci->GetAkick(k)->HasFlag(AK_ISNICK) ? ci->GetAkick(k)->nc->display : ci->GetAkick(k)->mask) - << " " << ci->GetAkick(k)->creator << " " << ci->GetAkick(k)->addtime - << " " << ci->last_used << " :"; - if (!ci->GetAkick(k)->reason.empty()) - db << ci->GetAkick(k)->reason; - db << endl; - } - if (ci->GetMLockCount(true)) + if (ci->HasFlag(CI_FORBIDDEN)) + db << "MD FORBID " << ci->forbidby << " :" << ci->forbidreason << endl; + } + for (unsigned k = 0; k < ci->GetAccessCount(); ++k) + if (ci->GetAccess(k)->in_use) + db << "MD ACCESS " << ci->GetAccess(k)->nc->display << " " << ci->GetAccess(k)->level << " " + << ci->GetAccess(k)->last_seen << " " << ci->GetAccess(k)->creator << endl; + for (unsigned k = 0; k < ci->GetAkickCount(); ++k) + { + db << "MD AKICK " + << (ci->GetAkick(k)->HasFlag(AK_STUCK) ? "STUCK " : "UNSTUCK ") + << (ci->GetAkick(k)->HasFlag(AK_ISNICK) ? "NICK " : "MASK ") + << (ci->GetAkick(k)->HasFlag(AK_ISNICK) ? ci->GetAkick(k)->nc->display : ci->GetAkick(k)->mask) + << " " << ci->GetAkick(k)->creator << " " << ci->GetAkick(k)->addtime + << " " << ci->last_used << " :"; + if (!ci->GetAkick(k)->reason.empty()) + db << ci->GetAkick(k)->reason; + db << endl; + } + if (ci->GetMLockCount(true)) + { + db << "MD MLOCK_ON"; + for (std::list::iterator it = ModeManager::Modes.begin(); it != ModeManager::Modes.end(); ++it) { - db << "MD MLOCK_ON"; - for (std::list::iterator it = ModeManager::Modes.begin(); it != ModeManager::Modes.end(); ++it) + if ((*it)->Class == MC_CHANNEL) { - if ((*it)->Class == MC_CHANNEL) - { - ChannelMode *cm = dynamic_cast(*it); + ChannelMode *cm = dynamic_cast(*it); - if (ci->HasMLock(cm->Name, true)) - { - db << " " << cm->NameAsString; - } - } - } - db << endl; - } - if (ci->GetMLockCount(false)) - { - db << "MD MLOCK_OFF"; - for (std::list::iterator it = ModeManager::Modes.begin(); it != ModeManager::Modes.end(); ++it) - { - if ((*it)->Class == MC_CHANNEL) + if (ci->HasMLock(cm->Name, true)) { - ChannelMode *cm = dynamic_cast(*it); - - if (ci->HasMLock(cm->Name, false)) - { - db << " " << cm->NameAsString; - } + db << " " << cm->NameAsString; } } - db << endl; } - std::string Param; + db << endl; + } + if (ci->GetMLockCount(false)) + { + db << "MD MLOCK_OFF"; for (std::list::iterator it = ModeManager::Modes.begin(); it != ModeManager::Modes.end(); ++it) { if ((*it)->Class == MC_CHANNEL) { ChannelMode *cm = dynamic_cast(*it); - if (ci->GetParam(cm->Name, Param)) + if (ci->HasMLock(cm->Name, false)) { - db << "MD MLP " << cm->NameAsString << " " << Param << endl; + db << " " << cm->NameAsString; } } } - if (!ci->memos.memos.empty()) + db << endl; + } + std::string Param; + for (std::list::iterator it = ModeManager::Modes.begin(); it != ModeManager::Modes.end(); ++it) + { + if ((*it)->Class == MC_CHANNEL) { - MemoInfo *memos = &ci->memos; + ChannelMode *cm = dynamic_cast(*it); - for (unsigned k = 0; k < memos->memos.size(); ++k) + if (ci->GetParam(cm->Name, Param)) { - db << "MD MI " << memos->memos[k]->number << " " << memos->memos[k]->time << " " << memos->memos[k]->sender; - if (memos->memos[k]->HasFlag(MF_UNREAD)) - db << " UNREAD"; - if (memos->memos[k]->HasFlag(MF_RECEIPT)) - db << " RECEIPT"; - if (memos->memos[k]->HasFlag(MF_NOTIFYS)) - db << " NOTIFYS"; - db << " :" << memos->memos[k]->text << endl; + db << "MD MLP " << cm->NameAsString << " " << Param << endl; } } - if (ci->entry_message) - db << "MD ENTRYMSG :" << ci->entry_message << endl; - if (ci->bi) - db << "MD BI NAME " << ci->bi->nick << endl; - if (ci->botflags.FlagCount()) + } + if (!ci->memos.memos.empty()) + { + MemoInfo *memos = &ci->memos; + + for (unsigned k = 0; k < memos->memos.size(); ++k) { - db << "MD BI FLAGS"; - for (int j = 0; BotFlags[j].Flag != -1; ++j) - if (ci->botflags.HasFlag(BotFlags[j].Flag)) - db << " " << BotFlags[j].Name; - db << endl; + db << "MD MI " << memos->memos[k]->number << " " << memos->memos[k]->time << " " << memos->memos[k]->sender; + if (memos->memos[k]->HasFlag(MF_UNREAD)) + db << " UNREAD"; + if (memos->memos[k]->HasFlag(MF_RECEIPT)) + db << " RECEIPT"; + if (memos->memos[k]->HasFlag(MF_NOTIFYS)) + db << " NOTIFYS"; + db << " :" << memos->memos[k]->text << endl; } - db << "MD BI TTB BOLDS " << ci->ttb[0] << " COLORS " << ci->ttb[1] << " REVERSES " << ci->ttb[2] << " UNDERLINES " << ci->ttb[3] << " BADWORDS " << ci->ttb[4] << " CAPS " << ci->ttb[5] << " FLOOD " << ci->ttb[6] << " REPEAT " << ci->ttb[7] << endl; - if (ci->capsmin) - db << "MD BI CAPSMIN " << ci->capsmin << endl; - if (ci->capspercent) - db << "MD BI CAPSPERCENT " << ci->capspercent << endl; - if (ci->floodlines) - db << "MD BI FLOODLINES " << ci->floodlines << endl; - if (ci->floodsecs) - db << "MD BI FLOODSECS " << ci->floodsecs << endl; - if (ci->repeattimes) - db << "MD BI REPEATTIMES " << ci->repeattimes << endl; - for (unsigned k = 0; k < ci->GetBadWordCount(); ++k) - db << "MD BI BADWORD " - << (ci->GetBadWord(k)->type == BW_ANY ? "ANY " : "") - << (ci->GetBadWord(k)->type == BW_SINGLE ? "SINGLE " : "") - << (ci->GetBadWord(k)->type == BW_START ? "START " : "") - << (ci->GetBadWord(k)->type == BW_END ? "END " : "") - << ":" << ci->GetBadWord(k)->word << endl; - - FOREACH_MOD(I_OnDatabaseWriteMetadata, OnDatabaseWriteMetadata(WriteMetadata, ci)); } + if (ci->entry_message) + db << "MD ENTRYMSG :" << ci->entry_message << endl; + if (ci->bi) + db << "MD BI NAME " << ci->bi->nick << endl; + if (ci->botflags.FlagCount()) + { + db << "MD BI FLAGS"; + for (int j = 0; BotFlags[j].Flag != -1; ++j) + if (ci->botflags.HasFlag(BotFlags[j].Flag)) + db << " " << BotFlags[j].Name; + db << endl; + } + db << "MD BI TTB BOLDS " << ci->ttb[0] << " COLORS " << ci->ttb[1] << " REVERSES " << ci->ttb[2] << " UNDERLINES " << ci->ttb[3] << " BADWORDS " << ci->ttb[4] << " CAPS " << ci->ttb[5] << " FLOOD " << ci->ttb[6] << " REPEAT " << ci->ttb[7] << endl; + if (ci->capsmin) + db << "MD BI CAPSMINS " << ci->capsmin << endl; + if (ci->capspercent) + db << "MD BI CAPSPERCENT " << ci->capspercent << endl; + if (ci->floodlines) + db << "MD BI FLOODLINES " << ci->floodlines << endl; + if (ci->floodsecs) + db << "MD BI FLOODSECS " << ci->floodsecs << endl; + if (ci->repeattimes) + db << "MD BI REPEATTIMES " << ci->repeattimes << endl; + for (unsigned k = 0; k < ci->GetBadWordCount(); ++k) + db << "MD BI BADWORD " + << (ci->GetBadWord(k)->type == BW_ANY ? "ANY " : "") + << (ci->GetBadWord(k)->type == BW_SINGLE ? "SINGLE " : "") + << (ci->GetBadWord(k)->type == BW_START ? "START " : "") + << (ci->GetBadWord(k)->type == BW_END ? "END " : "") + << ":" << ci->GetBadWord(k)->word << endl; + + FOREACH_MOD(I_OnDatabaseWriteMetadata, OnDatabaseWriteMetadata(WriteMetadata, ci)); } for (int i = 0; i < akills.count; ++i) diff --git a/src/core/hs_del.c b/src/core/hs_del.c index 286366735..12610d31f 100644 --- a/src/core/hs_del.c +++ b/src/core/hs_del.c @@ -63,7 +63,7 @@ class HSDel : public Module this->SetVersion(VERSION_STRING); this->SetType(CORE); - this->AddCommand(HOSTSERV, new CommandHSDel()); + this->AddCommand(HostServ, new CommandHSDel()); ModuleManager::Attach(I_OnHostServHelp, this); } diff --git a/src/core/hs_delall.c b/src/core/hs_delall.c index b40565e3d..05c67660d 100644 --- a/src/core/hs_delall.c +++ b/src/core/hs_delall.c @@ -70,7 +70,7 @@ class HSDelAll : public Module this->SetVersion(VERSION_STRING); this->SetType(CORE); - this->AddCommand(HOSTSERV, new CommandHSDelAll()); + this->AddCommand(HostServ, new CommandHSDelAll()); ModuleManager::Attach(I_OnHostServHelp, this); } diff --git a/src/core/hs_group.c b/src/core/hs_group.c index e4117ba9c..3c744ef90 100644 --- a/src/core/hs_group.c +++ b/src/core/hs_group.c @@ -56,7 +56,7 @@ class HSGroup : public Module this->SetVersion(VERSION_STRING); this->SetType(CORE); - this->AddCommand(HOSTSERV, new CommandHSGroup()); + this->AddCommand(HostServ, new CommandHSGroup()); ModuleManager::Attach(I_OnHostServHelp, this); } diff --git a/src/core/hs_help.c b/src/core/hs_help.c index 0522c09d4..7e8d1e69a 100644 --- a/src/core/hs_help.c +++ b/src/core/hs_help.c @@ -24,7 +24,7 @@ class CommandHSHelp : public Command CommandReturn Execute(User *u, const std::vector ¶ms) { - mod_help_cmd(Config.s_HostServ, u, HOSTSERV, params[0].c_str()); + mod_help_cmd(HostServ, u, params[0].c_str()); return MOD_CONT; } @@ -44,7 +44,7 @@ class HSHelp : public Module this->SetVersion(VERSION_STRING); this->SetType(CORE); - this->AddCommand(HOSTSERV, new CommandHSHelp()); + this->AddCommand(HostServ, new CommandHSHelp()); } }; diff --git a/src/core/hs_list.c b/src/core/hs_list.c index e86f2d0dc..427864e54 100644 --- a/src/core/hs_list.c +++ b/src/core/hs_list.c @@ -53,47 +53,46 @@ class CommandHSList : public Command } } - for (int j = 0; j < 1024; ++j) + for (nickalias_map::const_iterator it = NickAliasList.begin(); it != NickAliasList.end(); ++it) { - for (NickAlias *na = nalists[j]; na; na = na->next) - { - if (!na->hostinfo.HasVhost()) - continue; + NickAlias *na = it->second; + + if (!na->hostinfo.HasVhost()) + continue; - if (!key.empty() && key[0] != '#') + if (!key.empty() && key[0] != '#') + { + if ((Anope::Match(na->nick, key) || Anope::Match(na->hostinfo.GetHost(), key.c_str())) && display_counter < Config.NSListMax) { - if ((Anope::Match(na->nick, key) || Anope::Match(na->hostinfo.GetHost(), key.c_str())) && display_counter < Config.NSListMax) - { - ++display_counter; - time_t time = na->hostinfo.GetTime(); - tm = localtime(&time); - strftime_lang(buf, sizeof(buf), u, STRFTIME_DATE_TIME_FORMAT, tm); - if (!na->hostinfo.GetIdent().empty()) - notice_lang(Config.s_HostServ, u, HOST_IDENT_ENTRY, counter, na->nick, na->hostinfo.GetIdent().c_str(), na->hostinfo.GetHost().c_str(), na->hostinfo.GetCreator().c_str(), buf); - else - notice_lang(Config.s_HostServ, u, HOST_ENTRY, counter, na->nick, na->hostinfo.GetHost().c_str(), na->hostinfo.GetCreator().c_str(), buf); - } + ++display_counter; + time_t time = na->hostinfo.GetTime(); + tm = localtime(&time); + strftime_lang(buf, sizeof(buf), u, STRFTIME_DATE_TIME_FORMAT, tm); + if (!na->hostinfo.GetIdent().empty()) + notice_lang(Config.s_HostServ, u, HOST_IDENT_ENTRY, counter, na->nick, na->hostinfo.GetIdent().c_str(), na->hostinfo.GetHost().c_str(), na->hostinfo.GetCreator().c_str(), buf); + else + notice_lang(Config.s_HostServ, u, HOST_ENTRY, counter, na->nick, na->hostinfo.GetHost().c_str(), na->hostinfo.GetCreator().c_str(), buf); } - else + } + else + { + /** + * List the host if its in the display range, and not more + * than NSListMax records have been displayed... + **/ + if (((counter >= from && counter <= to) || (!from && !to)) && display_counter < Config.NSListMax) { - /** - * List the host if its in the display range, and not more - * than NSListMax records have been displayed... - **/ - if (((counter >= from && counter <= to) || (!from && !to)) && display_counter < Config.NSListMax) - { - ++display_counter; - time_t time = na->hostinfo.GetTime(); - tm = localtime(&time); - strftime_lang(buf, sizeof(buf), u, STRFTIME_DATE_TIME_FORMAT, tm); - if (!na->hostinfo.GetIdent().empty()) - notice_lang(Config.s_HostServ, u, HOST_IDENT_ENTRY, counter, na->nick, na->hostinfo.GetIdent().c_str(), na->hostinfo.GetHost().c_str(), na->hostinfo.GetCreator().c_str(), buf); - else - notice_lang(Config.s_HostServ, u, HOST_ENTRY, counter, na->nick, na->hostinfo.GetHost().c_str(), na->hostinfo.GetCreator().c_str(), buf); - } + ++display_counter; + time_t time = na->hostinfo.GetTime(); + tm = localtime(&time); + strftime_lang(buf, sizeof(buf), u, STRFTIME_DATE_TIME_FORMAT, tm); + if (!na->hostinfo.GetIdent().empty()) + notice_lang(Config.s_HostServ, u, HOST_IDENT_ENTRY, counter, na->nick, na->hostinfo.GetIdent().c_str(), na->hostinfo.GetHost().c_str(), na->hostinfo.GetCreator().c_str(), buf); + else + notice_lang(Config.s_HostServ, u, HOST_ENTRY, counter, na->nick, na->hostinfo.GetHost().c_str(), na->hostinfo.GetCreator().c_str(), buf); } - ++counter; } + ++counter; } if (!key.empty()) notice_lang(Config.s_HostServ, u, HOST_LIST_KEY_FOOTER, key.c_str(), display_counter); @@ -123,7 +122,7 @@ class HSList : public Module this->SetVersion(VERSION_STRING); this->SetType(CORE); - this->AddCommand(HOSTSERV, new CommandHSList()); + this->AddCommand(HostServ, new CommandHSList()); ModuleManager::Attach(I_OnHostServHelp, this); } diff --git a/src/core/hs_off.c b/src/core/hs_off.c index 5943e8850..ac6416cea 100644 --- a/src/core/hs_off.c +++ b/src/core/hs_off.c @@ -52,7 +52,7 @@ class HSOff : public Module this->SetVersion(VERSION_STRING); this->SetType(CORE); - this->AddCommand(HOSTSERV, new CommandHSOff()); + this->AddCommand(HostServ, new CommandHSOff()); ModuleManager::Attach(I_OnHostServHelp, this); } diff --git a/src/core/hs_on.c b/src/core/hs_on.c index 2194e2d2b..d04040de1 100644 --- a/src/core/hs_on.c +++ b/src/core/hs_on.c @@ -66,7 +66,7 @@ class HSOn : public Module this->SetVersion(VERSION_STRING); this->SetType(CORE); - this->AddCommand(HOSTSERV, new CommandHSOn()); + this->AddCommand(HostServ, new CommandHSOn()); ModuleManager::Attach(I_OnHostServHelp, this); } diff --git a/src/core/hs_set.c b/src/core/hs_set.c index b382cb0ea..a570986ac 100644 --- a/src/core/hs_set.c +++ b/src/core/hs_set.c @@ -160,7 +160,7 @@ class HSSet : public Module this->SetVersion(VERSION_STRING); this->SetType(CORE); - this->AddCommand(HOSTSERV, new CommandHSSet()); + this->AddCommand(HostServ, new CommandHSSet()); ModuleManager::Attach(I_OnHostServHelp, this); } diff --git a/src/core/hs_setall.c b/src/core/hs_setall.c index 9afb26206..dd90d4153 100644 --- a/src/core/hs_setall.c +++ b/src/core/hs_setall.c @@ -158,7 +158,7 @@ class HSSetAll : public Module this->SetVersion(VERSION_STRING); this->SetType(CORE); - this->AddCommand(HOSTSERV, new CommandHSSetAll()); + this->AddCommand(HostServ, new CommandHSSetAll()); ModuleManager::Attach(I_OnHostServHelp, this); } diff --git a/src/core/ms_cancel.c b/src/core/ms_cancel.c index c2eeee4c5..33d8006db 100644 --- a/src/core/ms_cancel.c +++ b/src/core/ms_cancel.c @@ -79,7 +79,7 @@ class MSCancel : public Module this->SetAuthor("Anope"); this->SetVersion(VERSION_STRING); this->SetType(CORE); - this->AddCommand(MEMOSERV, new CommandMSCancel()); + this->AddCommand(MemoServ, new CommandMSCancel()); ModuleManager::Attach(I_OnMemoServHelp, this); } diff --git a/src/core/ms_check.c b/src/core/ms_check.c index 47270a4ab..51281574e 100644 --- a/src/core/ms_check.c +++ b/src/core/ms_check.c @@ -95,7 +95,7 @@ class MSCheck : public Module this->SetAuthor("Anope"); this->SetVersion(VERSION_STRING); this->SetType(CORE); - this->AddCommand(MEMOSERV, new CommandMSCheck()); + this->AddCommand(MemoServ, new CommandMSCheck()); ModuleManager::Attach(I_OnMemoServHelp, this); } diff --git a/src/core/ms_del.c b/src/core/ms_del.c index f5c27cc4e..b2fd08fa1 100644 --- a/src/core/ms_del.c +++ b/src/core/ms_del.c @@ -168,7 +168,7 @@ class MSDel : public Module this->SetAuthor("Anope"); this->SetVersion(VERSION_STRING); this->SetType(CORE); - this->AddCommand(MEMOSERV, new CommandMSDel()); + this->AddCommand(MemoServ, new CommandMSDel()); ModuleManager::Attach(I_OnMemoServHelp, this); } diff --git a/src/core/ms_help.c b/src/core/ms_help.c index baa74aa93..09570eca2 100644 --- a/src/core/ms_help.c +++ b/src/core/ms_help.c @@ -24,7 +24,7 @@ class CommandMSHelp : public Command CommandReturn Execute(User *u, const std::vector ¶ms) { - mod_help_cmd(Config.s_MemoServ, u, MEMOSERV, params[0].c_str()); + mod_help_cmd(MemoServ, u, params[0].c_str()); return MOD_CONT; } @@ -44,7 +44,7 @@ class MSHelp : public Module this->SetAuthor("Anope"); this->SetVersion(VERSION_STRING); this->SetType(CORE); - this->AddCommand(MEMOSERV, new CommandMSHelp()); + this->AddCommand(MemoServ, new CommandMSHelp()); } }; diff --git a/src/core/ms_info.c b/src/core/ms_info.c index a1066f466..0519fd5b8 100644 --- a/src/core/ms_info.c +++ b/src/core/ms_info.c @@ -208,7 +208,7 @@ class MSInfo : public Module this->SetAuthor("Anope"); this->SetVersion(VERSION_STRING); this->SetType(CORE); - this->AddCommand(MEMOSERV, new CommandMSInfo()); + this->AddCommand(MemoServ, new CommandMSInfo()); ModuleManager::Attach(I_OnMemoServHelp, this); } diff --git a/src/core/ms_list.c b/src/core/ms_list.c index 5e97615ab..a2e63c2da 100644 --- a/src/core/ms_list.c +++ b/src/core/ms_list.c @@ -115,7 +115,7 @@ class MSList : public Module this->SetAuthor("Anope"); this->SetVe