From 35e328bcb60a431d9e8ee86c40df571d3653c451 Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 24 Dec 2010 01:23:22 -0500 Subject: Fixed Windows build --- src/chanserv.cpp | 4 ++-- src/regchannel.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/chanserv.cpp b/src/chanserv.cpp index 504bdea2a..35fd8975c 100644 --- a/src/chanserv.cpp +++ b/src/chanserv.cpp @@ -111,7 +111,7 @@ Anope::string get_mlock_modes(ChannelInfo *ci, int complete) { Anope::string pos = "+", neg = "-", params; - for (std::map::const_iterator it = ci->GetMLock().begin(), it_end = ci->GetMLock().end(); it != it_end; ++it) + for (std::multimap::const_iterator it = ci->GetMLock().begin(), it_end = ci->GetMLock().end(); it != it_end; ++it) { const ModeLock &ml = it->second; ChannelMode *cm = ModeManager::FindChannelModeByName(ml.name); @@ -241,7 +241,7 @@ void check_modes(Channel *c) return; } - for (std::map::const_iterator it = ci->GetMLock().begin(), it_end = ci->GetMLock().end(); it != it_end; ++it) + for (std::multimap::const_iterator it = ci->GetMLock().begin(), it_end = ci->GetMLock().end(); it != it_end; ++it) { const ModeLock &ml = it->second; ChannelMode *cm = ModeManager::FindChannelModeByName(ml.name); diff --git a/src/regchannel.cpp b/src/regchannel.cpp index 62dc94b3d..17c141ea7 100644 --- a/src/regchannel.cpp +++ b/src/regchannel.cpp @@ -579,13 +579,13 @@ void ChannelInfo::LoadMLock() */ bool ChannelInfo::HasMLock(ChannelMode *mode, const Anope::string ¶m, bool status) const { - std::map::const_iterator it = this->mode_locks.find(mode->Name); + std::multimap::const_iterator it = this->mode_locks.find(mode->Name); if (it != this->mode_locks.end()) { if (mode->Type != MODE_REGULAR) { - std::map::const_iterator it_end = this->mode_locks.upper_bound(mode->Name); + std::multimap::const_iterator it_end = this->mode_locks.upper_bound(mode->Name); for (; it != it_end; ++it) { const ModeLock &ml = it->second; -- cgit From 86900175c83375e4d3ad21749d8d6b65cc9f6732 Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 24 Dec 2010 19:07:47 -0500 Subject: Made clearing SXLines remove the XLine from the IRCd too --- src/operserv.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/operserv.cpp b/src/operserv.cpp index c76b34375..553126218 100644 --- a/src/operserv.cpp +++ b/src/operserv.cpp @@ -324,9 +324,8 @@ XLine *XLineManager::GetEntry(unsigned index) */ void XLineManager::Clear() { - for (std::vector::iterator it = this->XLines.begin(), it_end = this->XLines.end(); it != it_end; ++it) - delete *it; - this->XLines.clear(); + while (!this->XLines.empty()) + this->DelXLine(this->XLines.front()); } /** Add an entry to this XLine Manager -- cgit From aa9e33cf74cbbb4572465a15cc9919511c297216 Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 24 Dec 2010 19:55:09 -0500 Subject: Bug #1216 - Do not apply SQLines on our own clients --- src/operserv.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/operserv.cpp b/src/operserv.cpp index 553126218..6437fa2c9 100644 --- a/src/operserv.cpp +++ b/src/operserv.cpp @@ -605,7 +605,7 @@ XLine *SNLineManager::Add(BotInfo *bi, User *u, const Anope::string &mask, time_ User *user = *it; ++it; - if (!user->HasMode(UMODE_OPER) && Anope::Match(user->realname, x->Mask)) + if (!user->HasMode(UMODE_OPER) && user->server != Me && Anope::Match(user->realname, x->Mask)) kill_user(Config->ServerName, user, rreason); } } @@ -697,7 +697,7 @@ XLine *SQLineManager::Add(BotInfo *bi, User *u, const Anope::string &mask, time_ UserContainer *uc = *it; ++it; - if (uc->user->HasMode(UMODE_OPER)) + if (uc->user->HasMode(UMODE_OPER) || uc->user->server == Me) continue; c->Kick(NULL, uc->user, "%s", reason.c_str()); } @@ -710,7 +710,7 @@ XLine *SQLineManager::Add(BotInfo *bi, User *u, const Anope::string &mask, time_ User *user = *it; ++it; - if (!user->HasMode(UMODE_OPER) && Anope::Match(user->nick, x->Mask)) + if (!user->HasMode(UMODE_OPER) && user->server != Me && Anope::Match(user->nick, x->Mask)) kill_user(Config->ServerName, user, rreason); } } -- cgit From 80721d1873e770eddd4c232d42d9ba920e6e644a Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 25 Dec 2010 02:30:39 -0500 Subject: Forward port part of 821995bf604b5c6e18e6c0c93a31e149565160c8 --- src/bots.cpp | 8 ++++++++ src/modules.cpp | 3 +++ 2 files changed, 11 insertions(+) (limited to 'src') diff --git a/src/bots.cpp b/src/bots.cpp index 87a646923..07ea91b3a 100644 --- a/src/bots.cpp +++ b/src/bots.cpp @@ -72,6 +72,14 @@ BotInfo::~BotInfo() ci->bi = NULL; } + for (CommandMap::const_iterator it = this->Commands.begin(), it_end = this->Commands.end(); it != it_end; ++it) + { + Command *c = it->second; + + if (c->module) + c->module->DelCommand(this, c); + } + BotListByNick.erase(this->nick); if (!this->uid.empty()) BotListByUID.erase(this->uid); diff --git a/src/modules.cpp b/src/modules.cpp index 63e6bcab3..1ca060108 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -173,6 +173,9 @@ int Module::DelCommand(BotInfo *bi, Command *c) if (!bi->Commands.erase(c->name)) return MOD_ERR_NOEXIST; + + c->module = NULL; + c->service = NULL; return MOD_ERR_OK; } -- cgit From 1b3f2567bc34da051025ba91184b3370f7956c63 Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 26 Dec 2010 00:14:49 -0500 Subject: Fixed a potential crash from dropping nicks --- src/nickcore.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/nickcore.cpp b/src/nickcore.cpp index 40cd873a8..b094c8962 100644 --- a/src/nickcore.cpp +++ b/src/nickcore.cpp @@ -32,9 +32,9 @@ NickCore::~NickCore() /* Clean up this nick core from any users online using it * (ones that /nick but remain unidentified) */ - for (std::list::iterator it = this->Users.begin(), it_end = this->Users.end(); it != it_end; ++it) + for (std::list::iterator it = this->Users.begin(); it != this->Users.end();) { - User *user = *it; + User *user = *it++; ircdproto->SendAccountLogout(user, user->Account()); user->RemoveMode(NickServ, UMODE_REGISTERED); ircdproto->SendUnregisteredNick(user); -- cgit