diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/commands/ns_ghost.cpp | 3 | ||||
-rw-r--r-- | modules/protocol/bahamut.cpp | 23 | ||||
-rw-r--r-- | modules/protocol/hybrid.cpp | 51 | ||||
-rw-r--r-- | modules/protocol/inspircd11.cpp | 61 | ||||
-rw-r--r-- | modules/protocol/inspircd12.cpp | 87 | ||||
-rw-r--r-- | modules/protocol/inspircd20.cpp | 33 | ||||
-rw-r--r-- | modules/protocol/ngircd.cpp | 39 | ||||
-rw-r--r-- | modules/protocol/plexus.cpp | 17 | ||||
-rw-r--r-- | modules/protocol/ratbox.cpp | 24 | ||||
-rw-r--r-- | modules/protocol/unreal.cpp | 82 |
10 files changed, 151 insertions, 269 deletions
diff --git a/modules/commands/ns_ghost.cpp b/modules/commands/ns_ghost.cpp index de85a941f..0f53d849e 100644 --- a/modules/commands/ns_ghost.cpp +++ b/modules/commands/ns_ghost.cpp @@ -198,12 +198,11 @@ class NSGhost : public Module std::map<Anope::string, ChannelStatus>::iterator it = ei->find(c->name); if (it != ei->end()) { - ei->erase(it); - for (size_t j = CMODE_BEGIN + 1; j < CMODE_END; ++j) if (it->second.HasFlag(static_cast<ChannelModeName>(j))) c->SetMode(c->ci->WhoSends(), ModeManager::FindChannelModeByName(static_cast<ChannelModeName>(j)), u->GetUID()); + ei->erase(it); if (ei->empty()) u->Shrink("ns_ghost_info"); } diff --git a/modules/protocol/bahamut.cpp b/modules/protocol/bahamut.cpp index 839876d90..d9963485b 100644 --- a/modules/protocol/bahamut.cpp +++ b/modules/protocol/bahamut.cpp @@ -308,7 +308,7 @@ struct IRCDMessageBurst : IRCDMessage { IRCDMessageBurst(Module *creator) : IRCDMessage(creator, "BURST", 0) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { /* If we found a server with the given source, that one just * finished bursting. If there was no source, then our uplink @@ -319,7 +319,6 @@ struct IRCDMessageBurst : IRCDMessage s = Me->GetLinks().front(); if (s) s->Sync(true); - return true; } }; @@ -327,7 +326,7 @@ struct IRCDMessageMode : IRCDMessage { IRCDMessageMode(Module *creator, const Anope::string &sname) : IRCDMessage(creator, sname, 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { if (params.size() > 2 && IRCD->IsChannelValid(params[0])) { @@ -349,8 +348,6 @@ struct IRCDMessageMode : IRCDMessage if (u) u->SetModesInternal("%s", params[1].c_str()); } - - return true; } }; @@ -376,7 +373,7 @@ struct IRCDMessageNick : IRCDMessage { IRCDMessageNick(Module *creator) : IRCDMessage(creator, "NICK", 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { if (params.size() == 10) { @@ -384,7 +381,7 @@ struct IRCDMessageNick : IRCDMessage if (s == NULL) { Log(LOG_DEBUG) << "User " << params[0] << " introduced from nonexistant server " << params[6] << "?"; - return true; + return; } User *user = new User(params[0], params[4], params[5], "", params[8], s, params[9], params[2].is_pos_number_only() ? convertTo<time_t>(params[2]) : 0, params[3]); @@ -404,8 +401,6 @@ struct IRCDMessageNick : IRCDMessage } else source.GetUser()->ChangeNick(params[0]); - - return true; } }; @@ -413,11 +408,10 @@ struct IRCDMessageServer : IRCDMessage { IRCDMessageServer(Module *creator) : IRCDMessage(creator, "SERVER", 3) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { unsigned int hops = Anope::string(params[1]).is_pos_number_only() ? convertTo<unsigned>(params[1]) : 0; new Server(source.GetServer() == NULL ? Me : source.GetServer(), params[0], hops, params[2]); - return true; } }; @@ -425,7 +419,7 @@ struct IRCDMessageSJoin : IRCDMessage { IRCDMessageSJoin(Module *creator) : IRCDMessage(creator, "SJOIN", 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { Anope::string modes; if (params.size() >= 4) @@ -481,8 +475,6 @@ struct IRCDMessageSJoin : IRCDMessage time_t ts = Anope::string(params[0]).is_pos_number_only() ? convertTo<time_t>(params[0]) : Anope::CurTime; Message::Join::SJoin(source, params[1], ts, modes, users); - - return true; } }; @@ -490,12 +482,11 @@ struct IRCDMessageTopic : IRCDMessage { IRCDMessageTopic(Module *creator) : IRCDMessage(creator, "TOPIC", 4) { } - bool Run(MessageSource &, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &, const std::vector<Anope::string> ¶ms) anope_override { Channel *c = Channel::Find(params[0]); if (c) c->ChangeTopicInternal(params[1], params[3], Anope::string(params[2]).is_pos_number_only() ? convertTo<time_t>(params[2]) : Anope::CurTime); - return true; } }; diff --git a/modules/protocol/hybrid.cpp b/modules/protocol/hybrid.cpp index 1161db3fa..2597197ff 100644 --- a/modules/protocol/hybrid.cpp +++ b/modules/protocol/hybrid.cpp @@ -249,7 +249,7 @@ struct IRCDMessageBMask : IRCDMessage /* 0 1 2 3 */ /* :0MC BMASK 1350157102 #channel b :*!*@*.test.com */ - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { Channel *c = Channel::Find(params[1]); @@ -271,8 +271,6 @@ struct IRCDMessageBMask : IRCDMessage c->SetModeInternal(source, invex, token); } } - - return true; } }; @@ -280,10 +278,9 @@ struct IRCDMessageEOB : IRCDMessage { IRCDMessageEOB(Module *craetor) : IRCDMessage(craetor, "EOB", 0) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { source.GetServer()->Sync(true); - return true; } }; @@ -291,10 +288,10 @@ struct IRCDMessageJoin : Message::Join { IRCDMessageJoin(Module *creator) : Message::Join(creator, "JOIN") { } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { if (params.size() < 2) - return true; + return; std::vector<Anope::string> p = params; p.erase(p.begin()); @@ -309,10 +306,9 @@ struct IRCDMessageNick : IRCDMessage /* 0 1 */ /* :0MCAAAAAB NICK newnick 1350157102 */ - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { source.GetUser()->ChangeNick(params[0], convertTo<time_t>(params[1])); - return true; } }; @@ -322,10 +318,9 @@ struct IRCDMessagePass : IRCDMessage /* 0 1 2 3 */ /* PASS password TS 6 0MC */ - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { UplinkSID = params[3]; - return true; } }; @@ -333,10 +328,9 @@ struct IRCDMessagePong : IRCDMessage { IRCDMessagePong(Module *creator) : IRCDMessage(creator, "PONG", 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { source.GetServer()->Sync(false); - return true; } }; @@ -346,16 +340,15 @@ struct IRCDMessageServer : IRCDMessage /* 0 1 2 */ /* SERVER hades.arpa 1 :ircd-hybrid test server */ - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { /* Servers other than our immediate uplink are introduced via SID */ if (params[1] != "1") - return true; + return; new Server(source.GetServer() == NULL ? Me : source.GetServer(), params[0], 1, params[2], UplinkSID); IRCD->SendPing(Config->ServerName, params[0]); - return true; } }; @@ -365,13 +358,12 @@ struct IRCDMessageSID : IRCDMessage /* 0 1 2 3 */ /* :0MC SID hades.arpa 2 4XY :ircd-hybrid test server */ - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { unsigned int hops = params[1].is_pos_number_only() ? convertTo<unsigned>(params[1]) : 0; new Server(source.GetServer() == NULL ? Me : source.GetServer(), params[0], hops, params[3], params[2]); IRCD->SendPing(Config->ServerName, params[0]); - return true; } }; @@ -379,7 +371,7 @@ struct IRCDMessageSJoin : IRCDMessage { IRCDMessageSJoin(Module *creator) : IRCDMessage(creator, "SJOIN", 2) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { Anope::string modes; if (params.size() >= 3) @@ -424,8 +416,6 @@ struct IRCDMessageSJoin : IRCDMessage time_t ts = Anope::string(params[0]).is_pos_number_only() ? convertTo<time_t>(params[0]) : Anope::CurTime; Message::Join::SJoin(source, params[1], ts, modes, users); - - return true; } }; @@ -439,17 +429,16 @@ struct IRCDMessageSVSMode : IRCDMessage * parv[2] = mode * parv[3] = optional argument (services id) */ - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { User *u = User::Find(params[0]); if (!u) - return true; + return; if (!params[1].is_pos_number_only() || convertTo<time_t>(params[1]) != u->timestamp) - return true; + return; u->SetModesInternal("%s", params[2].c_str()); - return true; } }; @@ -457,7 +446,7 @@ struct IRCDMessageTBurst : IRCDMessage { IRCDMessageTBurst(Module *creator) : IRCDMessage(creator, "TBURST", 5) { } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { Anope::string setter; sepstream(params[3], '!').GetToken(setter, 0); @@ -466,8 +455,6 @@ struct IRCDMessageTBurst : IRCDMessage if (c) c->ChangeTopicInternal(setter, params[4], topic_time); - - return true; } }; @@ -475,7 +462,7 @@ struct IRCDMessageTMode : IRCDMessage { IRCDMessageTMode(Module *creator) : IRCDMessage(creator, "TMODE", 3) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { time_t ts = 0; @@ -493,8 +480,6 @@ struct IRCDMessageTMode : IRCDMessage if (c) c->SetModesInternal(source, modes, ts); - - return true; } }; @@ -504,7 +489,7 @@ struct IRCDMessageUID : IRCDMessage /* 0 1 2 3 4 5 6 7 8 9 */ /* :0MC UID Steve 1 1350157102 +oi ~steve resolved.host 10.0.0.1 0MCAAAAAB 1350157108 :Mining all the time */ - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { Anope::string ip = params[6]; @@ -534,8 +519,6 @@ struct IRCDMessageUID : IRCDMessage else NickServService->Validate(user); } - - return true; } }; diff --git a/modules/protocol/inspircd11.cpp b/modules/protocol/inspircd11.cpp index aaaec9fef..bc93e125e 100644 --- a/modules/protocol/inspircd11.cpp +++ b/modules/protocol/inspircd11.cpp @@ -338,7 +338,7 @@ struct IRCDMessageCapab : Message::Capab { IRCDMessageCapab(Module *creator) : Message::Capab(creator, "CAPAB") { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { if (params[0].equals_cs("START")) { @@ -542,21 +542,21 @@ struct IRCDMessageCapab : Message::Capab UplinkSocket::Message() << "ERROR :m_globops is not loaded. This is required by Anope"; Anope::QuitReason = "ERROR: Remote server does not have the m_globops module loaded, and this is required."; Anope::Quitting = true; - return false; + return; } if (!has_servicesmod) { UplinkSocket::Message() << "ERROR :m_services is not loaded. This is required by Anope"; Anope::QuitReason = "ERROR: Remote server does not have the m_services module loaded, and this is required."; Anope::Quitting = true; - return false; + return; } if (!has_hidechansmod) { UplinkSocket::Message() << "ERROR :m_hidechans.so is not loaded. This is required by Anope"; Anope::QuitReason = "ERROR: Remote server deos not have the m_hidechans module loaded, and this is required."; Anope::Quitting = true; - return false; + return; } if (!IRCD->CanSVSHold) Log() << "SVSHOLD missing, Usage disabled until module is loaded."; @@ -566,7 +566,7 @@ struct IRCDMessageCapab : Message::Capab Log() << "CHGIDENT missing, Usage disabled until module is loaded."; } - return Message::Capab::Run(source, params); + Message::Capab::Run(source, params); } }; @@ -574,17 +574,16 @@ struct IRCDMessageChgIdent : IRCDMessage { IRCDMessageChgIdent(Module *creator, const Anope::string &n) : IRCDMessage(creator, n, 2) { } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { User *u = User::Find(params[0]); if (!u) { Log(LOG_DEBUG) << "CHGIDENT for nonexistent user " << params[0]; - return true; + return; } u->SetIdent(params[1]); - return true; } }; @@ -592,10 +591,9 @@ struct IRCDMessageChgName : IRCDMessage { IRCDMessageChgName(Module *creator, const Anope::string &n) : IRCDMessage(creator, n, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { source.GetUser()->SetRealname(params[0]); - return true; } }; @@ -603,10 +601,9 @@ struct IRCDMessageEndBurst : IRCDMessage { IRCDMessageEndBurst(Module *creator) : IRCDMessage(creator, "ENDBURST", 0) { } - bool Run(MessageSource &, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &, const std::vector<Anope::string> ¶ms) anope_override { Me->GetLinks().front()->Sync(true); - return true; } }; @@ -614,10 +611,9 @@ struct IRCDMessageFHost : IRCDMessage { IRCDMessageFHost(Module *creator, const Anope::string &n) : IRCDMessage(creator, n, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { source.GetUser()->SetDisplayedHost(params[0]); - return true; } }; @@ -625,7 +621,7 @@ struct IRCDMessageFJoin : IRCDMessage { IRCDMessageFJoin(Module *creator) : IRCDMessage(creator, "FJOIN", 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { std::list<Message::Join::SJoinUser> users; @@ -664,8 +660,6 @@ struct IRCDMessageFJoin : IRCDMessage time_t ts = Anope::string(params[1]).is_pos_number_only() ? convertTo<time_t>(params[1]) : Anope::CurTime; Message::Join::SJoin(source, params[0], ts, "", users); - - return true; } }; @@ -673,13 +667,13 @@ struct IRCDMessageFMode : IRCDMessage { IRCDMessageFMode(Module *creator) : IRCDMessage(creator, "FMODE", 3) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { /* :source FMODE #test 12345678 +nto foo */ Channel *c = Channel::Find(params[0]); if (!c) - return true; + return; time_t ts = Anope::string(params[1]).is_pos_number_only() ? convertTo<time_t>(params[1]) : 0; /* TS's are equal now, so we can proceed with parsing */ @@ -689,7 +683,6 @@ struct IRCDMessageFMode : IRCDMessage modes += " " + params[n]; c->SetModesInternal(source, modes, ts); - return true; } }; @@ -697,13 +690,11 @@ struct IRCDMessageFTopic : IRCDMessage { IRCDMessageFTopic(Module *creator) : IRCDMessage(creator, "FTOPIC", 4) { } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { Channel *c = Channel::Find(params[0]); if (c) c->ChangeTopicInternal(params[2], params[3], Anope::string(params[1]).is_pos_number_only() ? convertTo<time_t>(params[1]) : Anope::CurTime); - - return true; } }; @@ -711,11 +702,10 @@ struct IRCDMessageIdle : IRCDMessage { IRCDMessageIdle(Module *creator) : IRCDMessage(creator, "IDLE", 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { const BotInfo *bi = BotInfo::Find(params[0]); UplinkSocket::Message(bi) << "IDLE " << source.GetSource() << " " << Anope::StartTime << " " << (bi ? Anope::CurTime - bi->lastmsg : 0); - return true; } }; @@ -723,7 +713,7 @@ struct IRCDMessageMode : IRCDMessage { IRCDMessageMode(Module *creator) : IRCDMessage(creator, "MODE", 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { if (IRCD->IsChannelValid(params[0])) { @@ -748,8 +738,6 @@ struct IRCDMessageMode : IRCDMessage if (u) u->SetModesInternal("%s", params[1].c_str()); } - - return true; } }; @@ -757,7 +745,7 @@ struct IRCDMessageNick : IRCDMessage { IRCDMessageNick(Module *creator) : IRCDMessage(creator, "NICK", 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { if (params.size() == 8 && source.GetServer()) { @@ -781,8 +769,6 @@ struct IRCDMessageNick : IRCDMessage } else if (params.size() == 1 && source.GetUser()) source.GetUser()->ChangeNick(params[0]); - - return true; } }; @@ -790,15 +776,13 @@ struct IRCDMessageOperType : IRCDMessage { IRCDMessageOperType(Module *creator) : IRCDMessage(creator, "OPERTYPE", 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); SetFlag(IRCDMESSAGE_REQUIRE_USER); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { /* opertype is equivalent to mode +o because servers dont do this directly */ User *u = source.GetUser(); if (!u->HasMode(UMODE_OPER)) u->SetModesInternal("+o"); - - return true; } }; @@ -806,10 +790,10 @@ struct IRCDMessageRSQuit : IRCDMessage { IRCDMessageRSQuit(Module *creator) : IRCDMessage(creator, "RSQUIT", 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { if (params.empty() || params.size() > 3) - return true; + return; Server *s; /* Horrible workaround to an insp bug (#) in how RSQUITs are sent - mark */ @@ -819,8 +803,6 @@ struct IRCDMessageRSQuit : IRCDMessage s = Server::Find(params[0]); source.GetServer()->Delete(source.GetServer()->GetName() + " " + (s ? s->GetName() : "<unknown>")); - - return true; } }; @@ -828,11 +810,10 @@ struct IRCDMessageServer : IRCDMessage { IRCDMessageServer(Module *creator) : IRCDMessage(creator, "SERVER", 4) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { unsigned int hops = Anope::string(params[1]).is_pos_number_only() ? convertTo<unsigned>(params[1]) : 0; new Server(source.GetServer() == NULL ? Me : source.GetServer(), params[0], hops, params[2]); - return true; } }; diff --git a/modules/protocol/inspircd12.cpp b/modules/protocol/inspircd12.cpp index 09ba57f00..242dd41e1 100644 --- a/modules/protocol/inspircd12.cpp +++ b/modules/protocol/inspircd12.cpp @@ -418,7 +418,7 @@ struct IRCDMessageCapab : Message::Capab { IRCDMessageCapab(Module *creator) : Message::Capab(creator, "CAPAB") { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { if (params[0].equals_cs("START")) { @@ -726,21 +726,21 @@ struct IRCDMessageCapab : Message::Capab UplinkSocket::Message() << "ERROR :m_globops is not loaded. This is required by Anope"; Anope::QuitReason = "Remote server does not have the m_globops module loaded, and this is required."; Anope::Quitting = true; - return false; + return; } if (!has_servicesmod) { UplinkSocket::Message() << "ERROR :m_services_account.so is not loaded. This is required by Anope"; Anope::QuitReason = "ERROR: Remote server does not have the m_services_account module loaded, and this is required."; Anope::Quitting = true; - return false; + return; } if (!has_hidechansmod) { UplinkSocket::Message() << "ERROR :m_hidechans.so is not loaded. This is required by Anope"; Anope::QuitReason = "ERROR: Remote server does not have the m_hidechans module loaded, and this is required."; Anope::Quitting = true; - return false; + return; } if (!IRCD->CanSVSHold) Log() << "SVSHOLD missing, Usage disabled until module is loaded."; @@ -750,9 +750,7 @@ struct IRCDMessageCapab : Message::Capab Log() << "CHGIDENT missing, Usage disabled until module is loaded."; } - Servers::Capab.insert("NOQUIT"); - - return Message::Capab::Run(source, params); + Message::Capab::Run(source, params); } }; @@ -760,12 +758,11 @@ struct IRCDMessageChgIdent : IRCDMessage { IRCDMessageChgIdent(Module *creator) : IRCDMessage(creator, "CHGIDENT", 2) { } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { User *u = User::Find(params[0]); if (u) u->SetIdent(params[1]); - return true; } }; @@ -773,10 +770,9 @@ struct IRCDMessageChgName : IRCDMessage { IRCDMessageChgName(Module *creator, const Anope::string &n) : IRCDMessage(creator, n, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { source.GetUser()->SetRealname(params[0]); - return true; } }; @@ -784,14 +780,13 @@ struct IRCDMessageEndburst : IRCDMessage { IRCDMessageEndburst(Module *creator) : IRCDMessage(creator, "ENDBURST", 0) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { Server *s = source.GetServer(); Log(LOG_DEBUG) << "Processed ENDBURST for " << s->GetName(); s->Sync(true); - return true; } }; @@ -799,10 +794,9 @@ struct IRCDMessageFHost : IRCDMessage { IRCDMessageFHost(Module *creator, const Anope::string &n) : IRCDMessage(creator, n, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { source.GetUser()->SetDisplayedHost(params[0]); - return true; } }; @@ -810,7 +804,7 @@ struct IRCDMessageFJoin : IRCDMessage { IRCDMessageFJoin(Module *creator) : IRCDMessage(creator, "FJOIN", 2) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { Anope::string modes; if (params.size() >= 3) @@ -856,8 +850,6 @@ struct IRCDMessageFJoin : IRCDMessage time_t ts = Anope::string(params[1]).is_pos_number_only() ? convertTo<time_t>(params[1]) : Anope::CurTime; Message::Join::SJoin(source, params[0], ts, "", users); - - return true; } }; @@ -865,7 +857,7 @@ struct IRCDMessageFMode : IRCDMessage { IRCDMessageFMode(Module *creator) : IRCDMessage(creator, "FMODE", 3) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { /* :source FMODE #test 12345678 +nto foo */ @@ -887,8 +879,6 @@ struct IRCDMessageFMode : IRCDMessage if (c) c->SetModesInternal(source, modes, ts); - - return true; } }; @@ -896,15 +886,13 @@ struct IRCDMessageFTopic : IRCDMessage { IRCDMessageFTopic(Module *creator) : IRCDMessage(creator, "FTOPIC", 4) { } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { /* :source FTOPIC channel topicts setby :topic */ Channel *c = Channel::Find(params[0]); if (c) c->ChangeTopicInternal(params[2], params[3], Anope::string(params[1]).is_pos_number_only() ? convertTo<time_t>(params[1]) : Anope::CurTime); - - return true; } }; @@ -912,12 +900,11 @@ struct IRCDMessageIdle : IRCDMessage { IRCDMessageIdle(Module *creator) : IRCDMessage(creator, "IDLE", 1) { } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { const BotInfo *bi = BotInfo::Find(params[0]); if (bi) UplinkSocket::Message(bi) << "IDLE " << source.GetSource() << " " << Anope::StartTime << " " << (Anope::CurTime - bi->lastmsg); - return true; } }; @@ -931,7 +918,7 @@ struct IRCDMessageMetadata : IRCDMessage { IRCDMessageMetadata(Module *creator) : IRCDMessage(creator, "METADATA", 3) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { if (isdigit(params[0][0])) { @@ -964,7 +951,7 @@ struct IRCDMessageMetadata : IRCDMessage { User *u = User::Find(params[0]); if (!u) - return true; + return; std::string data = params[2].c_str(); size_t pos1 = data.find(' ') + 1; size_t pos2 = data.find(' ', pos1); @@ -987,11 +974,11 @@ struct IRCDMessageMetadata : IRCDMessage // only interested when it comes from our uplink Server* server = source.GetServer(); if (!server || server->GetUplink() != Me) - return true; + return; bool plus = (params[2][0] == '+'); if (!plus && params[2][0] != '-') - return true; + return; bool required = false; Anope::string module = params[2].substr(1); @@ -1011,7 +998,7 @@ struct IRCDMessageMetadata : IRCDMessage else if (module.equals_cs("m_topiclock.so")) has_svstopic_topiclock = plus; else - return true; + return; if (required) { @@ -1025,8 +1012,6 @@ struct IRCDMessageMetadata : IRCDMessage } } - - return true; } }; @@ -1034,7 +1019,7 @@ struct IRCDMessageMode : IRCDMessage { IRCDMessageMode(Module *creator) : IRCDMessage(creator, "MODE", 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { if (IRCD->IsChannelValid(params[0])) { @@ -1062,8 +1047,6 @@ struct IRCDMessageMode : IRCDMessage if (u) u->SetModesInternal("%s", params[1].c_str()); } - - return true; } }; @@ -1071,10 +1054,9 @@ struct IRCDMessageNick : IRCDMessage { IRCDMessageNick(Module *creator) : IRCDMessage(creator, "NICK", 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { source.GetUser()->ChangeNick(params[0]); - return true; } }; @@ -1082,27 +1064,25 @@ struct IRCDMessageOperType : IRCDMessage { IRCDMessageOperType(Module *creator) : IRCDMessage(creator, "OPERTYPE", 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); SetFlag(IRCDMESSAGE_REQUIRE_USER); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { /* opertype is equivalent to mode +o because servers dont do this directly */ User *u = source.GetUser(); if (!u->HasMode(UMODE_OPER)) u->SetModesInternal("+o"); - - return true; } -} -; +}; + struct IRCDMessageRSQuit : IRCDMessage { IRCDMessageRSQuit(Module *creator) : IRCDMessage(creator, "RSQUIT", 1) { } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { Server *s = Server::Find(params[0]); if (!s) - return true; + return; /* On InspIRCd we must send a SQUIT when we recieve RSQUIT for a server we have juped */ if (s->HasFlag(SERVER_JUPED)) @@ -1111,8 +1091,6 @@ struct IRCDMessageRSQuit : IRCDMessage FOREACH_MOD(I_OnServerQuit, OnServerQuit(s)); s->Delete(s->GetName() + " " + s->GetUplink()->GetName()); - - return true; } }; @@ -1120,10 +1098,9 @@ struct IRCDMessageSetIdent : IRCDMessage { IRCDMessageSetIdent(Module *creator) : IRCDMessage(creator, "SETIDENT", 0) { SetFlag(IRCDMESSAGE_REQUIRE_USER); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { source.GetUser()->SetIdent(params[0]); - return true; } }; @@ -1139,11 +1116,10 @@ struct IRCDMessageServer : IRCDMessage * 3: numeric * 4: desc */ - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { unsigned int hops = Anope::string(params[2]).is_pos_number_only() ? convertTo<unsigned>(params[2]) : 0; new Server(source.GetServer() == NULL ? Me : source.GetServer(), params[0], hops, params[4], params[3]); - return true; } }; @@ -1151,10 +1127,9 @@ struct IRCDMessageTime : IRCDMessage { IRCDMessageTime(Module *creator) : IRCDMessage(creator, "TIME", 2) { } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { UplinkSocket::Message(Me) << "TIME " << source.GetSource() << " " << params[1] << " " << Anope::CurTime; - return true; } }; @@ -1175,7 +1150,7 @@ struct IRCDMessageUID : IRCDMessage * 8+: modes and params -- IMPORTANT, some modes (e.g. +s) may have parameters. So don't assume a fixed position of realname! * last: realname */ - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { time_t ts = convertTo<time_t>(params[1]); @@ -1186,8 +1161,6 @@ struct IRCDMessageUID : IRCDMessage User *u = new User(params[2], params[5], params[3], params[4], params[6], source.GetServer(), params[params.size() - 1], ts, modes, params[0]); if (u->server->IsSynced() && NickServService) NickServService->Validate(u); - - return true; } }; @@ -1247,6 +1220,8 @@ class ProtoInspIRCd : public Module Implementation i[] = { I_OnUserNickChange, I_OnServerSync }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); + Servers::Capab.insert("NOQUIT"); + if (Config->Numeric.empty()) { Anope::string numeric = Servers::TS6_SID_Retrieve(); diff --git a/modules/protocol/inspircd20.cpp b/modules/protocol/inspircd20.cpp index 85cfd9088..965294904 100644 --- a/modules/protocol/inspircd20.cpp +++ b/modules/protocol/inspircd20.cpp @@ -172,7 +172,7 @@ struct IRCDMessageCapab : Message::Capab { IRCDMessageCapab(Module *creator) : Message::Capab(creator, "CAPAB") { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { if (params[0].equals_cs("START")) { @@ -184,7 +184,7 @@ struct IRCDMessageCapab : Message::Capab UplinkSocket::Message() << "ERROR :Protocol mismatch, no or invalid protocol version given in CAPAB START"; Anope::QuitReason = "Protocol mismatch, no or invalid protocol version given in CAPAB START"; Anope::Quitting = true; - return false; + return; } /* reset CAPAB */ @@ -479,14 +479,14 @@ struct IRCDMessageCapab : Message::Capab UplinkSocket::Message() << "ERROR :m_services_account.so is not loaded. This is required by Anope"; Anope::QuitReason = "ERROR: Remote server does not have the m_services_account module loaded, and this is required."; Anope::Quitting = true; - return false; + return; } if (!ModeManager::FindUserModeByName(UMODE_PRIV)) { UplinkSocket::Message() << "ERROR :m_hidechans.so is not loaded. This is required by Anope"; Anope::QuitReason = "ERROR: Remote server does not have the m_hidechans module loaded, and this is required."; Anope::Quitting = true; - return false; + return; } if (!IRCD->CanSVSHold) Log() << "SVSHOLD missing, Usage disabled until module is loaded."; @@ -498,9 +498,7 @@ struct IRCDMessageCapab : Message::Capab Log() << "m_topiclock missing, server side topic locking disabled until module is loaded."; } - Servers::Capab.insert("NOQUIT"); - - return Message::Capab::Run(source, params); + Message::Capab::Run(source, params); } }; @@ -508,16 +506,16 @@ struct IRCDMessageEncap : IRCDMessage { IRCDMessageEncap(Module *creator) : IRCDMessage(creator, "ENCAP", 4) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { if (Anope::Match(Me->GetSID(), params[0]) == false) - return true; + return; if (params[1] == "CHGIDENT") { User *u = User::Find(params[2]); if (!u || u->server != Me) - return true; + return; u->SetIdent(params[3]); UplinkSocket::Message(u) << "FIDENT " << params[3]; @@ -526,7 +524,7 @@ struct IRCDMessageEncap : IRCDMessage { User *u = User::Find(params[2]); if (!u || u->server != Me) - return true; + return; u->SetDisplayedHost(params[3]); UplinkSocket::Message(u) << "FHOST " << params[3]; @@ -535,7 +533,7 @@ struct IRCDMessageEncap : IRCDMessage { User *u = User::Find(params[2]); if (!u || u->server != Me) - return true; + return; u->SetRealname(params[3]); UplinkSocket::Message(u) << "FNAME " << params[3]; @@ -578,26 +576,24 @@ struct IRCDMessageEncap : IRCDMessage size_t p = decoded.find('\0'); if (p == Anope::string::npos) - return true; + return; decoded = decoded.substr(p + 1); p = decoded.find('\0'); if (p == Anope::string::npos) - return true; + return; Anope::string acc = decoded.substr(0, p), pass = decoded.substr(p + 1); if (acc.empty() || pass.empty()) - return true; + return; IdentifyRequest *req = new InspIRCDSASLIdentifyRequest(this->owner, params[2], acc, pass); FOREACH_MOD(I_OnCheckAuthentication, OnCheckAuthentication(NULL, req)); req->Dispatch(); } } - - return true; } }; @@ -605,10 +601,9 @@ struct IRCDMessageFIdent : IRCDMessage { IRCDMessageFIdent(Module *creator) : IRCDMessage(creator, "FIDENT", 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { source.GetUser()->SetIdent(params[0]); - return true; } }; diff --git a/modules/protocol/ngircd.cpp b/modules/protocol/ngircd.cpp index afde10439..40c6a4e5c 100644 --- a/modules/protocol/ngircd.cpp +++ b/modules/protocol/ngircd.cpp @@ -178,7 +178,7 @@ struct IRCDMessage005 : IRCDMessage IRCDMessage005(Module *creator) : IRCDMessage(creator, "005", 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } // Please see <http://www.irc.org/tech_docs/005.html> for details. - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { size_t pos; Anope::string parameter, data; @@ -205,7 +205,6 @@ struct IRCDMessage005 : IRCDMessage } } } - return true; } }; @@ -221,9 +220,8 @@ struct IRCDMessage376 : IRCDMessage * */ - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { - return true; } }; @@ -248,7 +246,7 @@ struct IRCDMessageChaninfo : IRCDMessage * a channel has no user limit (the parameter <modes> doesn't list the "l" * channel mode). In this case <limit> should be "0". */ - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { Channel *c = Channel::Find(params[0]); @@ -279,7 +277,6 @@ struct IRCDMessageChaninfo : IRCDMessage } c->SetModesInternal(source, modes); - return true; } }; @@ -293,7 +290,7 @@ struct IRCDMessageJoin : Message::Join * * if a user joins a new channel, the ircd sends <channelname>\7<umode> */ - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { User *user = source.GetUser(); size_t pos = params[0].find('\7'); @@ -320,8 +317,6 @@ struct IRCDMessageJoin : Message::Join if (c) c->SetModesInternal(source, modes); } - - return true; } }; @@ -342,13 +337,13 @@ struct IRCDMessageMetadata : IRCDMessage * - "user": the user name (ident) of a client (can't be empty) */ - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { User *u = User::Find(params[0]); if (!u) { Log() << "received METADATA for non-existent user " << params[0]; - return true; + return; } if (params[1].equals_cs("host")) { @@ -362,7 +357,6 @@ struct IRCDMessageMetadata : IRCDMessage { u->SetVIdent(params[2]); } - return true; } }; @@ -378,7 +372,7 @@ struct IRCDMessageMode : IRCDMessage * params[n] = parameters */ - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { Anope::string modes = params[1]; @@ -399,7 +393,6 @@ struct IRCDMessageMode : IRCDMessage if (u) u->SetModesInternal("%s", params[1].c_str()); } - return true; } }; @@ -426,7 +419,7 @@ struct IRCDMessageNick : IRCDMessage * params[0] = newnick * */ - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { if (params.size() == 1) { @@ -444,7 +437,6 @@ struct IRCDMessageNick : IRCDMessage { Log(LOG_DEBUG) << "Received NICK with invalid number of parameters. source = " << source.GetName() << "params[0] = " << params[0] << "params.size() = " << params.size(); } - return true; } }; @@ -463,7 +455,7 @@ struct IRCDMessageNJoin : IRCDMessage * * Received: :dev.anope.de NJOIN #test :DukeP2,@DukeP,%test,+test2 */ - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { std::list<Message::Join::SJoinUser> users; @@ -497,8 +489,6 @@ struct IRCDMessageNJoin : IRCDMessage } Message::Join::SJoin(source, params[0], 0, "", users); - - return true; } }; @@ -511,11 +501,10 @@ struct IRCDMessagePong : IRCDMessage * when receiving a new server and then finish sync once we * get a pong back from that server. */ - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { if (!source.GetServer()->IsSynced()) source.GetServer()->Sync(false); - return true; } }; @@ -549,7 +538,7 @@ struct IRCDMessageServer : IRCDMessage * params[3] = server description */ - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { if (params.size() == 3) { @@ -568,7 +557,6 @@ struct IRCDMessageServer : IRCDMessage * get a pong back from that server. */ IRCD->SendPing(Config->ServerName, params[0]); - return true; } }; @@ -577,16 +565,15 @@ struct IRCDMessageTopic : IRCDMessage IRCDMessageTopic(Module *creator) : IRCDMessage(creator, "TOPIC", 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } // Received: :DukeP TOPIC #anope :test - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { Channel *c = Channel::Find(params[0]); if (!c) { Log(LOG_DEBUG) << "TOPIC for nonexistant channel " << params[0]; - return true; + return; } c->ChangeTopicInternal(source.GetName(), params[1], Anope::CurTime); - return true; } }; diff --git a/modules/protocol/plexus.cpp b/modules/protocol/plexus.cpp index 53efdbd88..1faab05b8 100644 --- a/modules/protocol/plexus.cpp +++ b/modules/protocol/plexus.cpp @@ -156,7 +156,7 @@ struct IRCDMessageEncap : IRCDMessage { IRCDMessageEncap(Module *creator) : IRCDMessage(creator, "ENCAP", 4) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { /* * Received: :dev.anope.de ENCAP * SU DukePyrolator DukePyrolator @@ -194,7 +194,7 @@ struct IRCDMessageEncap : IRCDMessage FOREACH_MOD(I_OnFingerprint, OnFingerprint(u)); } } - return true; + return; } }; @@ -202,10 +202,9 @@ struct IRCDMessagePass : IRCDMessage { IRCDMessagePass(Module *creator) : IRCDMessage(creator, "PASS", 4) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { UplinkSID = params[3]; - return true; } }; @@ -215,15 +214,13 @@ struct IRCDMessageServer : IRCDMessage /* 0 1 2 */ /* SERVER hades.arpa 1 :ircd-hybrid test server */ - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { /* Servers other than our immediate uplink are introduced via SID */ if (params[1] != "1") - return true; + return; new Server(source.GetServer() == NULL ? Me : source.GetServer(), params[0], 1, params[2], UplinkSID); - - return true; } }; @@ -245,7 +242,7 @@ struct IRCDMessageUID : IRCDMessage params[10] = info */ // :42X UID Adam 1 1348535644 +aow Adam 192.168.0.5 192.168.0.5 42XAAAAAB 0 192.168.0.5 :Adam - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { /* An IP of 0 means the user is spoofed */ Anope::string ip = params[6]; @@ -261,8 +258,6 @@ struct IRCDMessageUID : IRCDMessage } else if (user && user->server->IsSynced() && NickServService) NickServService->Validate(user); - - return true; } }; diff --git a/modules/protocol/ratbox.cpp b/modules/protocol/ratbox.cpp index 32226fae7..ba8eea82c 100644 --- a/modules/protocol/ratbox.cpp +++ b/modules/protocol/ratbox.cpp @@ -94,7 +94,7 @@ struct IRCDMessageEncap : IRCDMessage IRCDMessageEncap(Module *creator) : IRCDMessage(creator, "ENCAP", 3) { SetFlag(IRCDMESSAGE_REQUIRE_USER); } // Debug: Received: :00BAAAAAB ENCAP * LOGIN Adam - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { if (params[1] == "LOGIN" || params[1] == "SU") { @@ -102,15 +102,13 @@ struct IRCDMessageEncap : IRCDMessage NickCore *nc = NickCore::Find(params[2]); if (!nc) - return true; + return; u->Login(nc); const NickAlias *user_na = NickAlias::Find(u->nick); if (!Config->NoNicknameOwnership && user_na && user_na->nc == nc && user_na->nc->HasFlag(NI_UNCONFIRMED) == false) u->SetMode(NickServ, UMODE_REGISTERED); } - - return true; } }; @@ -118,10 +116,9 @@ struct IRCDMessagePass : IRCDMessage { IRCDMessagePass(Module *creator) : IRCDMessage(creator, "PASS", 4) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { UplinkSID = params[3]; - return true; } }; @@ -130,14 +127,13 @@ struct IRCDMessageServer : IRCDMessage IRCDMessageServer(Module *creator) : IRCDMessage(creator, "SERVER", 3) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } // SERVER hades.arpa 1 :ircd-ratbox test server - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { // Servers other then our immediate uplink are introduced via SID if (params[1] != "1") - return true; + return; new Server(source.GetServer() == NULL ? Me : source.GetServer(), params[0], 1, params[2], UplinkSID); IRCD->SendPing(Config->ServerName, params[0]); - return true; } }; @@ -151,20 +147,18 @@ struct IRCDMessageTBurst : IRCDMessage * params[2] = topic OR who set the topic * params[3] = topic if params[2] isnt the topic */ - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { time_t topic_time = Anope::string(params[1]).is_pos_number_only() ? convertTo<time_t>(params[1]) : Anope::CurTime; Channel *c = Channel::Find(params[0]); if (!c) - return true; + return; const Anope::string &setter = params.size() == 4 ? params[2] : "", topic = params.size() == 4 ? params[3] : params[2]; c->ChangeTopicInternal(setter, topic, topic_time); - - return true; } }; @@ -173,14 +167,12 @@ struct IRCDMessageUID : IRCDMessage IRCDMessageUID(Module *creator) : IRCDMessage(creator, "UID", 9) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } // :42X UID Adam 1 1348535644 +aow Adam 192.168.0.5 192.168.0.5 42XAAAAAB :Adam - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { /* Source is always the server */ User *user = new User(params[0], params[4], params[5], "", params[6], source.GetServer(), params[8], params[2].is_pos_number_only() ? convertTo<time_t>(params[2]) : 0, params[3], params[7]); if (user && user->server->IsSynced() && NickServService) NickServService->Validate(user); - - return true; } }; diff --git a/modules/protocol/unreal.cpp b/modules/protocol/unreal.cpp index 5e7a9f194..01541a93e 100644 --- a/modules/protocol/unreal.cpp +++ b/modules/protocol/unreal.cpp @@ -469,9 +469,16 @@ class ChannelModeFlood : public ChannelModeParam ++p; if (p == arg.length() || !(arg[p] == 'c' || arg[p] == 'j' || arg[p] == 'k' || arg[p] == 'm' || arg[p] == 'n' || arg[p] == 't')) continue; /* continue instead of break for forward compatability. */ - int v = arg.substr(0, p).is_number_only() ? convertTo<int>(arg.substr(0, p)) : 0; - if (v < 1 || v > 999) + try + { + int v = arg.substr(0, p).is_number_only() ? convertTo<int>(arg.substr(0, p)) : 0; + if (v < 1 || v > 999) + return false; + } + catch (const ConvertException &) + { return false; + } } return true; @@ -495,7 +502,7 @@ struct IRCDMessageCapab : Message::Capab { IRCDMessageCapab(Module *creator) : Message::Capab(creator, "PROTOCTL") { } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { for (unsigned i = 0; i < params.size(); ++i) { @@ -642,7 +649,7 @@ struct IRCDMessageCapab : Message::Capab } } - return Message::Capab::Run(source, params); + Message::Capab::Run(source, params); } }; @@ -650,12 +657,11 @@ struct IRCDMessageChgHost : IRCDMessage { IRCDMessageChgHost(Module *creator) : IRCDMessage(creator, "CHGHOST", 2) { } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { User *u = User::Find(params[0]); if (u) u->SetDisplayedHost(params[1]); - return true; } }; @@ -663,12 +669,11 @@ struct IRCDMessageChgIdent : IRCDMessage { IRCDMessageChgIdent(Module *creator) : IRCDMessage(creator, "CHGIDENT", 2) { } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { User *u = User::Find(params[0]); if (u) u->SetVIdent(params[1]); - return true; } }; @@ -676,12 +681,11 @@ struct IRCDMessageChgName : IRCDMessage { IRCDMessageChgName(Module *creator) : IRCDMessage(creator, "CHGNAME", 2) { } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { User *u = User::Find(params[0]); if (u) u->SetRealname(params[1]); - return true; } }; @@ -689,7 +693,7 @@ struct IRCDMessageMode : IRCDMessage { IRCDMessageMode(Module *creator, const Anope::string &mname) : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { bool server_source = source.GetServer() != NULL; Anope::string modes = params[1]; @@ -717,8 +721,6 @@ struct IRCDMessageMode : IRCDMessage if (u) u->SetModesInternal("%s", params[1].c_str()); } - - return true; } }; @@ -736,10 +738,9 @@ struct IRCDMessageNetInfo : IRCDMessage { IRCDMessageNetInfo(Module *creator) : IRCDMessage(creator, "NETINFO", 8) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { UplinkSocket::Message() << "AO " << MaxUserCount << " " << Anope::CurTime << " " << convertTo<int>(params[2]) << " " << params[3] << " 0 0 0 :" << params[7]; - return true; } }; @@ -767,7 +768,7 @@ struct IRCDMessageNick : IRCDMessage ** parv[0] = new nickname ** parv[1] = hopcount */ - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { if (params.size() == 11) { @@ -793,7 +794,7 @@ struct IRCDMessageNick : IRCDMessage if (s == NULL) { Log(LOG_DEBUG) << "User " << params[0] << " introduced from nonexistant server " << params[5] << "?"; - return true; + return; } User *user = new User(params[0], params[3], params[4], vhost, ip, s, params[10], user_ts, params[7]); @@ -823,8 +824,6 @@ struct IRCDMessageNick : IRCDMessage } else source.GetUser()->ChangeNick(params[0]); - - return true; } }; @@ -841,11 +840,10 @@ struct IRCDMessagePong : IRCDMessage { IRCDMessagePong(Module *creator) : IRCDMessage(creator, "PONG", 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { if (!source.GetServer()->IsSynced()) source.GetServer()->Sync(false); - return true; } }; @@ -888,11 +886,11 @@ struct IRCDMessageSASL : IRCDMessage * Received: :irc.foonet.com SASL services.localhost.net irc.foonet.com!3.56270 C QWRhbQBBZGFtAHF3ZXJ0eQ== * uid base64(account\0account\0pass) */ - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { size_t p = params[1].find('!'); if (!Config->NSSASL || p == Anope::string::npos) - return true; + return; if (params[2] == "S") UplinkSocket::Message() << "SASL " << params[1].substr(0, p) << " " << params[1] << " C +"; @@ -903,25 +901,23 @@ struct IRCDMessageSASL : IRCDMessage p = decoded.find('\0'); if (p == Anope::string::npos) - return true; + return; decoded = decoded.substr(p + 1); p = decoded.find('\0'); if (p == Anope::string::npos) - return true; + return; Anope::string acc = decoded.substr(0, p), pass = decoded.substr(p + 1); if (acc.empty() || pass.empty()) - return true; + return; IdentifyRequest *req = new UnrealSASLIdentifyRequest(this->owner, params[1], acc, pass); FOREACH_MOD(I_OnCheckAuthentication, OnCheckAuthentication(NULL, req)); req->Dispatch(); } - - return true; } }; @@ -929,10 +925,9 @@ struct IRCDMessageSDesc : IRCDMessage { IRCDMessageSDesc(Module *creator) : IRCDMessage(creator, "SDESC", 1) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { source.GetServer()->SetDescription(params[0]); - return true; } }; @@ -940,7 +935,7 @@ struct IRCDMessageSetHost : IRCDMessage { IRCDMessageSetHost(Module *creator) : IRCDMessage(creator, "SETHOST", 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { User *u = source.GetUser(); @@ -949,8 +944,6 @@ struct IRCDMessageSetHost : IRCDMessage u->SetDisplayedHost(params[0]); else u->SetCloakedHost(params[0]); - - return true; } }; @@ -958,11 +951,10 @@ struct IRCDMessageSetIdent : IRCDMessage { IRCDMessageSetIdent(Module *creator) : IRCDMessage(creator, "SETIDENT", 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { User *u = source.GetUser(); u->SetVIdent(params[0]); - return true; } }; @@ -970,12 +962,11 @@ struct IRCDMessageSetName : IRCDMessage { IRCDMessageSetName(Module *creator) : IRCDMessage(creator, "SETNAME", 1) { } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { User *u = User::Find(params[0]); if (u) u->SetRealname(params[1]); - return true; } }; @@ -983,7 +974,7 @@ struct IRCDMessageServer : IRCDMessage { IRCDMessageServer(Module *creator) : IRCDMessage(creator, "SERVER", 3) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { unsigned int hops = Anope::string(params[1]).is_pos_number_only() ? convertTo<unsigned>(params[1]) : 0; @@ -998,8 +989,6 @@ struct IRCDMessageServer : IRCDMessage new Server(source.GetServer(), params[0], hops, params[2]); IRCD->SendPing(Config->ServerName, params[0]); - - return true; } }; @@ -1007,7 +996,7 @@ struct IRCDMessageSJoin : IRCDMessage { IRCDMessageSJoin(Module *creator) : IRCDMessage(creator, "SJOIN", 3) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { Anope::string modes; if (params.size() >= 4) @@ -1078,7 +1067,7 @@ struct IRCDMessageSJoin : IRCDMessage Channel *c = Channel::Find(params[1]); if (!c || c->creation_time != ts) - return true; + return; ChannelMode *ban = ModeManager::FindChannelModeByName(CMODE_BAN), *except = ModeManager::FindChannelModeByName(CMODE_EXCEPT), @@ -1094,8 +1083,6 @@ struct IRCDMessageSJoin : IRCDMessage for (std::list<Anope::string>::iterator it = invites.begin(), it_end = invites.end(); it != it_end; ++it) c->SetModeInternal(source, invex, *it); } - - return true; } }; @@ -1110,13 +1097,11 @@ struct IRCDMessageTopic : IRCDMessage ** parv[2] = topic time ** parv[3] = topic text */ - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { Channel *c = Channel::Find(params[0]); if (c) c->ChangeTopicInternal(params[1], params[3], Anope::string(params[2]).is_pos_number_only() ? convertTo<time_t>(params[2]) : Anope::CurTime); - - return true; } }; @@ -1125,10 +1110,9 @@ struct IRCDMessageUmode2 : IRCDMessage { IRCDMessageUmode2(Module *creator) : IRCDMessage(creator, "UMODE2", 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); } - bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { source.GetUser()->SetModesInternal("%s", params[0].c_str()); - return true; } }; |