From 219993bc9018d9f0d9568330d7a972b68b785d27 Mon Sep 17 00:00:00 2001 From: danieldg Date: Wed, 2 Sep 2009 00:43:25 +0000 Subject: [PATCH] Replace std::deque with std::vector in spanningtree and related modules git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11593 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/command_parse.h | 2 +- include/hashcomp.h | 13 +++- include/mode.h | 8 +-- include/modules.h | 4 +- include/protocol.h | 6 +- include/u_listmode.h | 16 ++--- src/command_parse.cpp | 6 +- src/hashcomp.cpp | 15 ++-- src/mode.cpp | 3 +- src/modules.cpp | 4 +- src/modules/extra/m_sqloper.cpp | 2 +- src/modules/m_sasl.cpp | 8 +-- src/modules/m_spanningtree/addline.cpp | 2 +- src/modules/m_spanningtree/admin.cpp | 4 +- src/modules/m_spanningtree/capab.cpp | 2 +- src/modules/m_spanningtree/delline.cpp | 2 +- src/modules/m_spanningtree/encap.cpp | 2 +- src/modules/m_spanningtree/fhost.cpp | 2 +- src/modules/m_spanningtree/fjoin.cpp | 26 +++---- src/modules/m_spanningtree/fmode.cpp | 2 +- src/modules/m_spanningtree/fname.cpp | 2 +- src/modules/m_spanningtree/ftopic.cpp | 2 +- src/modules/m_spanningtree/kill.cpp | 2 +- src/modules/m_spanningtree/main.cpp | 50 +++++++------- src/modules/m_spanningtree/main.h | 4 +- src/modules/m_spanningtree/metadata.cpp | 2 +- src/modules/m_spanningtree/modules.cpp | 4 +- src/modules/m_spanningtree/motd.cpp | 4 +- src/modules/m_spanningtree/nickcollide.cpp | 2 +- src/modules/m_spanningtree/operquit.cpp | 2 +- src/modules/m_spanningtree/opertype.cpp | 2 +- src/modules/m_spanningtree/override_admin.cpp | 2 +- src/modules/m_spanningtree/override_map.cpp | 2 +- .../m_spanningtree/override_modules.cpp | 2 +- src/modules/m_spanningtree/override_motd.cpp | 2 +- src/modules/m_spanningtree/override_stats.cpp | 2 +- src/modules/m_spanningtree/override_time.cpp | 2 +- src/modules/m_spanningtree/override_whois.cpp | 2 +- src/modules/m_spanningtree/ping.cpp | 2 +- src/modules/m_spanningtree/pong.cpp | 2 +- src/modules/m_spanningtree/postcommand.cpp | 2 +- src/modules/m_spanningtree/privmsg.cpp | 2 +- .../m_spanningtree/protocolinterface.cpp | 4 +- .../m_spanningtree/protocolinterface.h | 2 +- src/modules/m_spanningtree/push.cpp | 2 +- src/modules/m_spanningtree/rsquit.cpp | 2 +- src/modules/m_spanningtree/server.cpp | 6 +- src/modules/m_spanningtree/stats.cpp | 4 +- src/modules/m_spanningtree/svsjoin.cpp | 2 +- src/modules/m_spanningtree/svsnick.cpp | 4 +- src/modules/m_spanningtree/svspart.cpp | 2 +- src/modules/m_spanningtree/time.cpp | 2 +- src/modules/m_spanningtree/treesocket.h | 68 +++++++++---------- src/modules/m_spanningtree/treesocket1.cpp | 2 +- src/modules/m_spanningtree/treesocket2.cpp | 17 +++-- src/modules/m_spanningtree/uid.cpp | 2 +- src/modules/m_spanningtree/utils.cpp | 16 ++--- src/modules/m_spanningtree/utils.h | 12 ++-- src/modules/m_spanningtree/version.cpp | 2 +- src/modules/m_spanningtree/whois.cpp | 4 +- 60 files changed, 194 insertions(+), 186 deletions(-) diff --git a/include/command_parse.h b/include/command_parse.h index f1d9d1b1c..62f47bd2d 100644 --- a/include/command_parse.h +++ b/include/command_parse.h @@ -203,7 +203,7 @@ class CoreExport CommandParser : public classbase */ int TranslateUIDs(TranslateType to, const std::string &source, std::string &dest); - int TranslateUIDs(const std::deque to, const std::deque &source, std::string &dest); + int TranslateUIDs(const std::vector to, const std::vector &source, std::string &dest); }; /** Command handler class for the RELOAD command. diff --git a/include/hashcomp.h b/include/hashcomp.h index 536c42937..c5d849529 100644 --- a/include/hashcomp.h +++ b/include/hashcomp.h @@ -304,7 +304,7 @@ namespace irc * characters. As specified below, this function * should be called in a loop until it returns zero, * indicating there are no more modes to return. - * @param result The deque to populate. This will + * @param result The vector to populate. This will not * be cleared before it is used. * @param max_line_size The maximum size of the line * to build, in characters, seperate to MAXMODES. @@ -313,7 +313,16 @@ namespace irc * returns 0, in case there are multiple lines of * mode changes to be obtained. */ - int GetStackedLine(std::deque &result, int max_line_size = 360); + int GetStackedLine(std::vector &result, int max_line_size = 360); + + /** deprecated compatability interface - TODO remove */ + int GetStackedLine(std::deque &result, int max_line_size = 360) { + std::vector r; + int n = GetStackedLine(r, max_line_size); + result.clear(); + result.insert(result.end(), r.begin(), r.end()); + return n; + } }; /** irc::tokenstream reads a string formatted as per RFC1459 and RFC2812. diff --git a/include/mode.h b/include/mode.h index 280284bfa..e80455acc 100644 --- a/include/mode.h +++ b/include/mode.h @@ -445,8 +445,8 @@ class CoreExport ModeParser : public classbase * Use GetLastParse() to get this value, to be used for display purposes. */ std::string LastParse; - std::deque LastParseParams; - std::deque LastParseTranslate; + std::vector LastParseParams; + std::vector LastParseTranslate; unsigned int sent[256]; @@ -488,8 +488,8 @@ class CoreExport ModeParser : public classbase * @return Last parsed string, as seen by users. */ const std::string& GetLastParse(); - const std::deque& GetLastParseParams() { return LastParseParams; } - const std::deque& GetLastParseTranslate() { return LastParseTranslate; } + const std::vector& GetLastParseParams() { return LastParseParams; } + const std::vector& GetLastParseTranslate() { return LastParseTranslate; } /** Add a mode to the mode parser. * @return True if the mode was successfully added. */ diff --git a/include/modules.h b/include/modules.h index f6678e931..21e476089 100644 --- a/include/modules.h +++ b/include/modules.h @@ -776,7 +776,7 @@ class CoreExport Module : public Extensible * @param text The actual modes and their parameters if any * @param translate The translation types of the mode parameters */ - virtual void OnMode(User* user, void* dest, int target_type, const std::deque &text, const std::deque &translate); + virtual void OnMode(User* user, void* dest, int target_type, const std::vector &text, const std::vector &translate); /** Allows modules to alter or create server descriptions * Whenever a module requires a server description, for example for display in @@ -885,7 +885,7 @@ class CoreExport Module : public Extensible * @param modeline The modes and parameters to be sent * @param translate The translation types of the mode parameters */ - virtual void ProtoSendMode(void* opaque, TargetTypeFlags target_type, void* target, const std::deque &modeline, const std::deque &translate); + virtual void ProtoSendMode(void* opaque, TargetTypeFlags target_type, void* target, const std::vector &modeline, const std::vector &translate); /** Implemented by modules which provide the ability to link servers. * These modules will implement this method, which allows metadata (extra data added to diff --git a/include/protocol.h b/include/protocol.h index 60fcf4df2..49288fd3b 100644 --- a/include/protocol.h +++ b/include/protocol.h @@ -19,7 +19,7 @@ class InspIRCd; class User; -typedef std::deque parameterlist; +typedef std::vector parameterlist; class ProtoServer { @@ -68,7 +68,7 @@ class ProtocolInterface : public Extensible * @param target The channel name or user to send mode changes for. * @param The mode changes to send. */ - virtual void SendMode(const std::string &target, const parameterlist &modedata, const std::deque &translate) { } + virtual void SendMode(const std::string &target, const parameterlist &modedata, const std::vector &translate) { } /** Convenience function, string wrapper around the above. */ @@ -76,7 +76,7 @@ class ProtocolInterface : public Extensible { irc::spacesepstream x(modeline); parameterlist n; - std::deque types; + std::vector types; std::string v; while (x.GetToken(v)) { diff --git a/include/u_listmode.h b/include/u_listmode.h index eb3cf18b7..0a2c25710 100644 --- a/include/u_listmode.h +++ b/include/u_listmode.h @@ -200,9 +200,6 @@ class ListModeBase : public ModeHandler if (el) { irc::modestacker modestack(ServerInstance, false); - std::deque stackresult; - std::vector mode_junk; - mode_junk.push_back(channel->name); for (modelist::iterator it = el->begin(); it != el->end(); it++) { @@ -215,11 +212,13 @@ class ListModeBase : public ModeHandler if (stack) return; + std::vector stackresult; + stackresult.push_back(channel->name); while (modestack.GetStackedLine(stackresult)) { - mode_junk.insert(mode_junk.end(), stackresult.begin(), stackresult.end()); - ServerInstance->SendMode(mode_junk, ServerInstance->FakeClient); - mode_junk.erase(mode_junk.begin() + 1, mode_junk.end()); + ServerInstance->SendMode(stackresult, ServerInstance->FakeClient); + stackresult.clear(); + stackresult.push_back(channel->name); } } } @@ -419,8 +418,8 @@ class ListModeBase : public ModeHandler modelist* mlist; chan->GetExt(infokey, mlist); irc::modestacker modestack(ServerInstance, true); - std::deque stackresult; - std::deque types; + std::vector stackresult; + std::vector types; types.push_back(TR_TEXT); if (mlist) { @@ -433,6 +432,7 @@ class ListModeBase : public ModeHandler { types.assign(stackresult.size(), this->GetTranslateType()); proto->ProtoSendMode(opaque, TYPE_CHANNEL, chan, stackresult, types); + stackresult.clear(); } } diff --git a/src/command_parse.cpp b/src/command_parse.cpp index a76ca2d4f..b446d2b9a 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -607,10 +607,10 @@ void CommandParser::SetupCommandTable() this->CreateCommand(new CommandReload(ServerInstance)); } -int CommandParser::TranslateUIDs(const std::deque to, const std::deque &source, std::string &dest) +int CommandParser::TranslateUIDs(const std::vector to, const std::vector &source, std::string &dest) { - std::deque::const_iterator items = source.begin(); - std::deque::const_iterator types = to.begin(); + std::vector::const_iterator items = source.begin(); + std::vector::const_iterator types = to.begin(); User* user = NULL; int translations = 0; dest.clear(); diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp index 6c0ce82b8..04c24418c 100644 --- a/src/hashcomp.cpp +++ b/src/hashcomp.cpp @@ -343,26 +343,26 @@ void irc::modestacker::PushMinus() this->Push('-',""); } -int irc::modestacker::GetStackedLine(std::deque &result, int max_line_size) +int irc::modestacker::GetStackedLine(std::vector &result, int max_line_size) { if (sequence.empty()) { - result.clear(); return 0; } - int n = 0; + unsigned int n = 0; int size = 1; /* Account for initial +/- char */ int nextsize = 0; - result.clear(); - result.push_back(adding ? "+" : "-"); + int start = result.size(); + std::string modeline = adding ? "+" : "-"; + result.push_back(modeline); if (sequence.size() > 1) nextsize = sequence[1].length() + 2; - while (!sequence[0].empty() && (sequence.size() > 1) && (result.size() < ServerInstance->Config->Limits.MaxModes) && ((size + nextsize) < max_line_size)) + while (!sequence[0].empty() && (sequence.size() > 1) && (n < ServerInstance->Config->Limits.MaxModes) && ((size + nextsize) < max_line_size)) { - result[0] += *(sequence[0].begin()); + modeline += *(sequence[0].begin()); if (!sequence[1].empty()) { result.push_back(sequence[1]); @@ -376,6 +376,7 @@ int irc::modestacker::GetStackedLine(std::deque &result, int max_li n++; } + result[start] = modeline; return n; } diff --git a/src/mode.cpp b/src/mode.cpp index 78993caad..947f3c4fb 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -513,6 +513,7 @@ void ModeParser::Process(const std::vector& parameters, User *user, unsigned int parameter_counter = 2; /* Index of first parameter */ unsigned int parameter_count = 0; bool last_successful_state_change = false; + LastParseParams.push_back(output_sequence); LastParseTranslate.push_back(TR_TEXT); /* A mode sequence that doesnt start with + or -. Assume +. - Thanks for the suggestion spike (bug#132) */ @@ -762,7 +763,7 @@ void ModeParser::Process(const std::vector& parameters, User *user, /* Was there at least one valid mode in the sequence? */ if (!output_sequence.empty()) { - LastParseParams.push_front(output_sequence); + LastParseParams[0] = output_sequence; if (!user) { if (type == MODETYPE_CHANNEL) diff --git a/src/modules.cpp b/src/modules.cpp index ab8ff37d4..aae65e816 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -118,7 +118,7 @@ void Module::OnPreRehash(User*, const std::string&) { } void Module::OnModuleRehash(User*, const std::string&) { } void Module::OnRehash(User*) { } int Module::OnUserPreJoin(User*, Channel*, const char*, std::string&, const std::string&) { return 0; } -void Module::OnMode(User*, void*, int, const std::deque&, const std::deque&) { } +void Module::OnMode(User*, void*, int, const std::vector&, const std::vector&) { } Version Module::GetVersion() { return Version("Misconfigured", VF_VENDOR, -1); } void Module::OnOper(User*, const std::string&) { } void Module::OnPostOper(User*, const std::string&, const std::string &) { } @@ -172,7 +172,7 @@ void Module::OnPostLocalTopicChange(User*, Channel*, const std::string&) { } void Module::OnGetServerDescription(const std::string&, std::string&) { } void Module::OnSyncUser(User*, Module*, void*) { } void Module::OnSyncChannel(Channel*, Module*, void*) { } -void Module::ProtoSendMode(void*, TargetTypeFlags, void*, const std::deque&, const std::deque&) { } +void Module::ProtoSendMode(void*, TargetTypeFlags, void*, const std::vector&, const std::vector&) { } void Module::OnSyncChannelMetaData(Channel*, Module*, void*, const std::string&, bool) { } void Module::OnSyncUserMetaData(User*, Module*, void*, const std::string&, bool) { } void Module::OnSyncOtherMetaData(Module*, void*, bool) { } diff --git a/src/modules/extra/m_sqloper.cpp b/src/modules/extra/m_sqloper.cpp index e898165a0..52a73eba9 100644 --- a/src/modules/extra/m_sqloper.cpp +++ b/src/modules/extra/m_sqloper.cpp @@ -29,7 +29,7 @@ class ModuleSQLOper : public Module irc::string hashtype; hashymodules hashers; bool diduseiface; - std::deque names; + parameterlist names; public: ModuleSQLOper(InspIRCd* Me) diff --git a/src/modules/m_sasl.cpp b/src/modules/m_sasl.cpp index 7867c245d..5241a14e5 100644 --- a/src/modules/m_sasl.cpp +++ b/src/modules/m_sasl.cpp @@ -40,7 +40,7 @@ class SaslAuthenticator : public classbase { this->user->Extend("sasl_authenticator", this); - std::deque params; + parameterlist params; params.push_back("*"); params.push_back("SASL"); params.push_back(user->uuid); @@ -63,7 +63,7 @@ class SaslAuthenticator : public classbase } /* checks for and deals with a state change. */ - SaslState ProcessInboundMessage(std::deque &msg) + SaslState ProcessInboundMessage(parameterlist &msg) { switch (this->state) { @@ -106,7 +106,7 @@ class SaslAuthenticator : public classbase if (this->state != SASL_COMM) return true; - std::deque params; + parameterlist params; params.push_back("*"); params.push_back("SASL"); params.push_back(this->user->uuid); @@ -258,7 +258,7 @@ class ModuleSASL : public Module if (ev->GetEventID() == "encap_received") { - std::deque* parameters = (std::deque*)ev->GetData(); + parameterlist* parameters = (parameterlist*)ev->GetData(); if ((*parameters)[1] != "SASL") return; diff --git a/src/modules/m_spanningtree/addline.cpp b/src/modules/m_spanningtree/addline.cpp index 304a23001..858abe3a6 100644 --- a/src/modules/m_spanningtree/addline.cpp +++ b/src/modules/m_spanningtree/addline.cpp @@ -20,7 +20,7 @@ /* $ModDep: m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/treesocket.h */ -bool TreeSocket::AddLine(const std::string &prefix, std::deque ¶ms) +bool TreeSocket::AddLine(const std::string &prefix, parameterlist ¶ms) { if (params.size() < 6) { diff --git a/src/modules/m_spanningtree/admin.cpp b/src/modules/m_spanningtree/admin.cpp index d58af5caf..133da928b 100644 --- a/src/modules/m_spanningtree/admin.cpp +++ b/src/modules/m_spanningtree/admin.cpp @@ -21,7 +21,7 @@ /* $ModDep: m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/treesocket.h */ /** remote ADMIN. leet, huh? */ -bool TreeSocket::Admin(const std::string &prefix, std::deque ¶ms) +bool TreeSocket::Admin(const std::string &prefix, parameterlist ¶ms) { if (params.size() > 0) { @@ -32,7 +32,7 @@ bool TreeSocket::Admin(const std::string &prefix, std::deque ¶m User* source = this->ServerInstance->FindNick(prefix); if (source) { - std::deque par; + parameterlist par; par.push_back(prefix); par.push_back(""); par[1] = std::string("::")+ServerInstance->Config->ServerName+" 256 "+source->nick+" :Administrative info for "+ServerInstance->Config->ServerName; diff --git a/src/modules/m_spanningtree/capab.cpp b/src/modules/m_spanningtree/capab.cpp index 7c37e67eb..a1980790f 100644 --- a/src/modules/m_spanningtree/capab.cpp +++ b/src/modules/m_spanningtree/capab.cpp @@ -129,7 +129,7 @@ std::string TreeSocket::ListDifference(const std::string &one, const std::string return result; } -bool TreeSocket::Capab(const std::deque ¶ms) +bool TreeSocket::Capab(const parameterlist ¶ms) { if (params.size() < 1) { diff --git a/src/modules/m_spanningtree/delline.cpp b/src/modules/m_spanningtree/delline.cpp index fc0a51ce8..5b01e3e98 100644 --- a/src/modules/m_spanningtree/delline.cpp +++ b/src/modules/m_spanningtree/delline.cpp @@ -21,7 +21,7 @@ /* $ModDep: m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/treesocket.h */ -bool TreeSocket::DelLine(const std::string &prefix, std::deque ¶ms) +bool TreeSocket::DelLine(const std::string &prefix, parameterlist ¶ms) { if (params.size() < 2) return true; diff --git a/src/modules/m_spanningtree/encap.cpp b/src/modules/m_spanningtree/encap.cpp index c1f8081c8..c56f8dc74 100644 --- a/src/modules/m_spanningtree/encap.cpp +++ b/src/modules/m_spanningtree/encap.cpp @@ -23,7 +23,7 @@ /** remote MOTD. leet, huh? */ -bool TreeSocket::Encap(const std::string &prefix, std::deque ¶ms) +bool TreeSocket::Encap(const std::string &prefix, parameterlist ¶ms) { if (params.size() > 1) { diff --git a/src/modules/m_spanningtree/fhost.cpp b/src/modules/m_spanningtree/fhost.cpp index f2d5a3888..1595b98aa 100644 --- a/src/modules/m_spanningtree/fhost.cpp +++ b/src/modules/m_spanningtree/fhost.cpp @@ -21,7 +21,7 @@ /* $ModDep: m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/treesocket.h */ -bool TreeSocket::ChangeHost(const std::string &prefix, std::deque ¶ms) +bool TreeSocket::ChangeHost(const std::string &prefix, parameterlist ¶ms) { if (params.size() < 1) return true; diff --git a/src/modules/m_spanningtree/fjoin.cpp b/src/modules/m_spanningtree/fjoin.cpp index 4367186b9..2c3606db1 100644 --- a/src/modules/m_spanningtree/fjoin.cpp +++ b/src/modules/m_spanningtree/fjoin.cpp @@ -22,7 +22,7 @@ /** FJOIN, almost identical to TS6 SJOIN, except for nicklist handling. */ -bool TreeSocket::ForceJoin(const std::string &source, std::deque ¶ms) +bool TreeSocket::ForceJoin(const std::string &source, parameterlist ¶ms) { /* 1.1 FJOIN works as follows: * @@ -97,7 +97,7 @@ bool TreeSocket::ForceJoin(const std::string &source, std::deque &p { /* Our TS greater than theirs, clear all our modes from the channel, accept theirs. */ ServerInstance->SNO->WriteToSnoMask('d', "Removing our modes, accepting remote"); - std::deque param_list; + parameterlist param_list; if (Utils->AnnounceTSChange && chan) chan->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :TS for %s changed from %lu to %lu", chan->name.c_str(), chan->name.c_str(), (unsigned long) ourTS, (unsigned long) TS); ourTS = TS; @@ -181,22 +181,20 @@ bool TreeSocket::ForceJoin(const std::string &source, std::deque &p /* Flush mode stacker if we lost the FJOIN or had equal TS */ if (apply_other_sides_modes) { - std::deque stackresult; - std::vector mode_junk; - mode_junk.push_back(channel); + parameterlist stackresult; + stackresult.push_back(channel); while (modestack.GetStackedLine(stackresult)) { - mode_junk.insert(mode_junk.end(), stackresult.begin(), stackresult.end()); - ServerInstance->SendMode(mode_junk, Utils->ServerUser); - mode_junk.erase(mode_junk.begin() + 1, mode_junk.end()); + ServerInstance->SendMode(stackresult, Utils->ServerUser); + stackresult.erase(stackresult.begin() + 1, stackresult.end()); } } return true; } -bool TreeSocket::RemoveStatus(const std::string &prefix, std::deque ¶ms) +bool TreeSocket::RemoveStatus(const std::string &prefix, parameterlist ¶ms) { if (params.size() < 1) return true; @@ -206,9 +204,8 @@ bool TreeSocket::RemoveStatus(const std::string &prefix, std::deque if (c) { irc::modestacker stack(ServerInstance, false); - std::deque stackresult; - std::vector mode_junk; - mode_junk.push_back(c->name); + parameterlist stackresult; + stackresult.push_back(c->name); for (char modeletter = 'A'; modeletter <= 'z'; ++modeletter) { @@ -224,9 +221,8 @@ bool TreeSocket::RemoveStatus(const std::string &prefix, std::deque while (stack.GetStackedLine(stackresult)) { - mode_junk.insert(mode_junk.end(), stackresult.begin(), stackresult.end()); - ServerInstance->SendMode(mode_junk, Utils->ServerUser); - mode_junk.erase(mode_junk.begin() + 1, mode_junk.end()); + ServerInstance->SendMode(stackresult, Utils->ServerUser); + stackresult.erase(stackresult.begin() + 1, stackresult.end()); } } return true; diff --git a/src/modules/m_spanningtree/fmode.cpp b/src/modules/m_spanningtree/fmode.cpp index 880f25086..3421f8045 100644 --- a/src/modules/m_spanningtree/fmode.cpp +++ b/src/modules/m_spanningtree/fmode.cpp @@ -22,7 +22,7 @@ /** FMODE command - server mode with timestamp checks */ -bool TreeSocket::ForceMode(const std::string &source, std::deque ¶ms) +bool TreeSocket::ForceMode(const std::string &source, parameterlist ¶ms) { /* Chances are this is a 1.0 FMODE without TS */ if (params.size() < 3) diff --git a/src/modules/m_spanningtree/fname.cpp b/src/modules/m_spanningtree/fname.cpp index 656b68363..a83591a4f 100644 --- a/src/modules/m_spanningtree/fname.cpp +++ b/src/modules/m_spanningtree/fname.cpp @@ -21,7 +21,7 @@ /* $ModDep: m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/treesocket.h */ -bool TreeSocket::ChangeName(const std::string &prefix, std::deque ¶ms) +bool TreeSocket::ChangeName(const std::string &prefix, parameterlist ¶ms) { if (params.size() < 1) return true; diff --git a/src/modules/m_spanningtree/ftopic.cpp b/src/modules/m_spanningtree/ftopic.cpp index 8ba5f90ab..34e97dd11 100644 --- a/src/modules/m_spanningtree/ftopic.cpp +++ b/src/modules/m_spanningtree/ftopic.cpp @@ -22,7 +22,7 @@ /** FTOPIC command */ -bool TreeSocket::ForceTopic(const std::string &source, std::deque ¶ms) +bool TreeSocket::ForceTopic(const std::string &source, parameterlist ¶ms) { if (params.size() != 4) return true; diff --git a/src/modules/m_spanningtree/kill.cpp b/src/modules/m_spanningtree/kill.cpp index 798524221..c2026d0bb 100644 --- a/src/modules/m_spanningtree/kill.cpp +++ b/src/modules/m_spanningtree/kill.cpp @@ -23,7 +23,7 @@ -bool TreeSocket::RemoteKill(const std::string &prefix, std::deque ¶ms) +bool TreeSocket::RemoteKill(const std::string &prefix, parameterlist ¶ms) { if (params.size() != 2) return true; diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 28473fdf9..2e92f8374 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -442,7 +442,7 @@ void ModuleSpanningTree::OnUserInvite(User* source,User* dest,Channel* channel, { if (IS_LOCAL(source)) { - std::deque params; + parameterlist params; params.push_back(dest->uuid); params.push_back(channel->name); params.push_back(ConvToStr(expiry)); @@ -452,7 +452,7 @@ void ModuleSpanningTree::OnUserInvite(User* source,User* dest,Channel* channel, void ModuleSpanningTree::OnPostLocalTopicChange(User* user, Channel* chan, const std::string &topic) { - std::deque params; + parameterlist params; params.push_back(chan->name); params.push_back(":"+topic); Utils->DoOneToMany(user->uuid,"TOPIC",params); @@ -462,7 +462,7 @@ void ModuleSpanningTree::OnWallops(User* user, const std::string &text) { if (IS_LOCAL(user)) { - std::deque params; + parameterlist params; params.push_back(":"+text); Utils->DoOneToMany(user->uuid,"WALLOPS",params); } @@ -479,8 +479,7 @@ void ModuleSpanningTree::OnUserNotice(User* user, void* dest, int target_type, c User* d = (User*)dest; if ((d->GetFd() < 0) && (IS_LOCAL(user))) { - std::deque params; - params.clear(); + parameterlist params; params.push_back(d->uuid); params.push_back(":"+text); Utils->DoOneToOne(user->uuid,"NOTICE",params,d->server); @@ -512,7 +511,7 @@ void ModuleSpanningTree::OnUserNotice(User* user, void* dest, int target_type, c if (IS_LOCAL(user)) { char* target = (char*)dest; - std::deque par; + parameterlist par; par.push_back(target); par.push_back(":"+text); Utils->DoOneToMany(user->uuid,"NOTICE",par); @@ -533,8 +532,7 @@ void ModuleSpanningTree::OnUserMessage(User* user, void* dest, int target_type, User* d = (User*)dest; if ((d->GetFd() < 0) && (IS_LOCAL(user))) { - std::deque params; - params.clear(); + parameterlist params; params.push_back(d->uuid); params.push_back(":"+text); Utils->DoOneToOne(user->uuid,"PRIVMSG",params,d->server); @@ -566,7 +564,7 @@ void ModuleSpanningTree::OnUserMessage(User* user, void* dest, int target_type, if (IS_LOCAL(user)) { char* target = (char*)dest; - std::deque par; + parameterlist par; par.push_back(target); par.push_back(":"+text); Utils->DoOneToMany(user->uuid,"PRIVMSG",par); @@ -586,7 +584,7 @@ void ModuleSpanningTree::OnUserJoin(User* user, Channel* channel, bool sync, boo // Only do this for local users if (IS_LOCAL(user)) { - std::deque params; + parameterlist params; // set up their permissions and the channel TS with FJOIN. // All users are FJOINed now, because a module may specify // new joining permissions for the user. @@ -603,7 +601,7 @@ int ModuleSpanningTree::OnChangeLocalUserHost(User* user, const std::string &new if (user->registered != REG_ALL) return 0; - std::deque params; + parameterlist params; params.push_back(newhost); Utils->DoOneToMany(user->uuid,"FHOST",params); return 0; @@ -615,7 +613,7 @@ void ModuleSpanningTree::OnChangeName(User* user, const std::string &gecos) if (user->registered != REG_ALL) return; - std::deque params; + parameterlist params; params.push_back(gecos); Utils->DoOneToMany(user->uuid,"FNAME",params); } @@ -624,7 +622,7 @@ void ModuleSpanningTree::OnUserPart(User* user, Channel* channel, std::string & { if (IS_LOCAL(user)) { - std::deque params; + parameterlist params; params.push_back(channel->name); if (!partmessage.empty()) params.push_back(":"+partmessage); @@ -636,7 +634,7 @@ void ModuleSpanningTree::OnUserQuit(User* user, const std::string &reason, const { if ((IS_LOCAL(user)) && (user->registered == REG_ALL)) { - std::deque params; + parameterlist params; if (oper_message != reason) { @@ -660,7 +658,7 @@ void ModuleSpanningTree::OnUserPostNick(User* user, const std::string &oldnick) { if (IS_LOCAL(user)) { - std::deque params; + parameterlist params; params.push_back(user->nick); /** IMPORTANT: We don't update the TS if the oldnick is just a case change of the newnick! @@ -675,7 +673,7 @@ void ModuleSpanningTree::OnUserPostNick(User* user, const std::string &oldnick) void ModuleSpanningTree::OnUserKick(User* source, User* user, Channel* chan, const std::string &reason, bool &silent) { - std::deque params; + parameterlist params; params.push_back(chan->name); params.push_back(user->uuid); params.push_back(":"+reason); @@ -694,7 +692,7 @@ void ModuleSpanningTree::OnRemoteKill(User* source, User* dest, const std::strin if (!IS_LOCAL(source)) return; // Only start routing if we're origin. - std::deque params; + parameterlist params; params.push_back(":"+reason); Utils->DoOneToMany(dest->uuid,"OPERQUIT",params); params.clear(); @@ -711,7 +709,7 @@ void ModuleSpanningTree::OnPreRehash(User* user, const std::string ¶meter) // Send out to other servers if (!parameter.empty() && parameter[0] != '-') { - std::deque params; + parameterlist params; params.push_back(parameter); Utils->DoOneToAllButSender(user ? user->uuid : ServerInstance->Config->GetSID(), "REHASH", params, user ? user->server : ServerInstance->Config->ServerName); } @@ -758,7 +756,7 @@ void ModuleSpanningTree::OnOper(User* user, const std::string &opertype) { if (IS_LOCAL(user)) { - std::deque params; + parameterlist params; params.push_back(opertype); Utils->DoOneToMany(user->uuid,"OPERTYPE",params); } @@ -772,7 +770,7 @@ void ModuleSpanningTree::OnAddLine(User* user, XLine *x) char data[MAXBUF]; snprintf(data,MAXBUF,"%s %s %s %lu %lu :%s", x->type.c_str(), x->Displayable(), ServerInstance->Config->ServerName, (unsigned long)x->set_time, (unsigned long)x->duration, x->reason); - std::deque params; + parameterlist params; params.push_back(data); if (!user) @@ -794,7 +792,7 @@ void ModuleSpanningTree::OnDelLine(User* user, XLine *x) char data[MAXBUF]; snprintf(data,MAXBUF,"%s %s", x->type.c_str(), x->Displayable()); - std::deque params; + parameterlist params; params.push_back(data); if (!user) @@ -809,11 +807,11 @@ void ModuleSpanningTree::OnDelLine(User* user, XLine *x) } } -void ModuleSpanningTree::OnMode(User* user, void* dest, int target_type, const std::deque &text, const std::deque &translate) +void ModuleSpanningTree::OnMode(User* user, void* dest, int target_type, const parameterlist &text, const std::vector &translate) { if ((IS_LOCAL(user)) && (user->registered == REG_ALL)) { - std::deque params; + parameterlist params; std::string command; std::string output_text; @@ -845,13 +843,13 @@ int ModuleSpanningTree::OnSetAway(User* user, const std::string &awaymsg) { if (awaymsg.empty()) { - std::deque params; + parameterlist params; params.clear(); Utils->DoOneToMany(user->uuid,"AWAY",params); } else { - std::deque params; + parameterlist params; params.push_back(":" + awaymsg); Utils->DoOneToMany(user->uuid,"AWAY",params); } @@ -860,7 +858,7 @@ int ModuleSpanningTree::OnSetAway(User* user, const std::string &awaymsg) return 0; } -void ModuleSpanningTree::ProtoSendMode(void* opaque, TargetTypeFlags target_type, void* target, const std::deque &modeline, const std::deque &translate) +void ModuleSpanningTree::ProtoSendMode(void* opaque, TargetTypeFlags target_type, void* target, const parameterlist &modeline, const std::vector &translate) { TreeSocket* s = (TreeSocket*)opaque; std::string output_text; diff --git a/src/modules/m_spanningtree/main.h b/src/modules/m_spanningtree/main.h index 4e7a8a426..375d99b14 100644 --- a/src/modules/m_spanningtree/main.h +++ b/src/modules/m_spanningtree/main.h @@ -180,10 +180,10 @@ class ModuleSpanningTree : public Module void OnLine(User* source, const std::string &host, bool adding, char linetype, long duration, const std::string &reason); virtual void OnAddLine(User *u, XLine *x); virtual void OnDelLine(User *u, XLine *x); - virtual void OnMode(User* user, void* dest, int target_type, const std::deque &text, const std::deque &translate); + virtual void OnMode(User* user, void* dest, int target_type, const std::vector &text, const std::vector &translate); virtual int OnStats(char statschar, User* user, string_list &results); virtual int OnSetAway(User* user, const std::string &awaymsg); - virtual void ProtoSendMode(void* opaque, TargetTypeFlags target_type, void* target, const std::deque &modeline, const std::deque &translate); + virtual void ProtoSendMode(void* opaque, TargetTypeFlags target_type, void* target, const std::vector &modeline, const std::vector &translate); virtual void ProtoSendMetaData(void* opaque, TargetTypeFlags target_type, void* target, const std::string &extname, const std::string &extdata); virtual void OnEvent(Event* event); virtual void OnLoadModule(Module* mod,const std::string &name); diff --git a/src/modules/m_spanningtree/metadata.cpp b/src/modules/m_spanningtree/metadata.cpp index 72aff0012..eece14b0c 100644 --- a/src/modules/m_spanningtree/metadata.cpp +++ b/src/modules/m_spanningtree/metadata.cpp @@ -21,7 +21,7 @@ /* $ModDep: m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/treesocket.h */ -bool TreeSocket::MetaData(const std::string &prefix, std::deque ¶ms) +bool TreeSocket::MetaData(const std::string &prefix, parameterlist ¶ms) { if (params.size() < 2) return true; diff --git a/src/modules/m_spanningtree/modules.cpp b/src/modules/m_spanningtree/modules.cpp index 70709eb40..6c9132794 100644 --- a/src/modules/m_spanningtree/modules.cpp +++ b/src/modules/m_spanningtree/modules.cpp @@ -21,7 +21,7 @@ /* $ModDep: m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/treesocket.h */ -bool TreeSocket::Modules(const std::string &prefix, std::deque ¶ms) +bool TreeSocket::Modules(const std::string &prefix, parameterlist ¶ms) { if (params.empty()) return true; @@ -34,7 +34,7 @@ bool TreeSocket::Modules(const std::string &prefix, std::deque &par } char strbuf[MAXBUF]; - std::deque par; + parameterlist par; par.push_back(prefix); par.push_back(""); diff --git a/src/modules/m_spanningtree/motd.cpp b/src/modules/m_spanningtree/motd.cpp index 66de93e18..e42c53152 100644 --- a/src/modules/m_spanningtree/motd.cpp +++ b/src/modules/m_spanningtree/motd.cpp @@ -23,7 +23,7 @@ /** remote MOTD. leet, huh? */ -bool TreeSocket::Motd(const std::string &prefix, std::deque ¶ms) +bool TreeSocket::Motd(const std::string &prefix, parameterlist ¶ms) { if (params.size() > 0) { @@ -35,7 +35,7 @@ bool TreeSocket::Motd(const std::string &prefix, std::deque ¶ms if (source) { - std::deque par; + parameterlist par; par.push_back(prefix); par.push_back(""); diff --git a/src/modules/m_spanningtree/nickcollide.cpp b/src/modules/m_spanningtree/nickcollide.cpp index 9661200db..ba83b62db 100644 --- a/src/modules/m_spanningtree/nickcollide.cpp +++ b/src/modules/m_spanningtree/nickcollide.cpp @@ -102,7 +102,7 @@ int TreeSocket::DoCollision(User *u, time_t remotets, const std::string &remotei * Local-side nick needs to change. Just in case we are hub, and * this "local" nick is actually behind us, send an SVSNICK out. */ - std::deque params; + parameterlist params; params.push_back(u->uuid); params.push_back(u->uuid); params.push_back(ConvToStr(u->age)); diff --git a/src/modules/m_spanningtree/operquit.cpp b/src/modules/m_spanningtree/operquit.cpp index bbaa2cb62..a71f73da7 100644 --- a/src/modules/m_spanningtree/operquit.cpp +++ b/src/modules/m_spanningtree/operquit.cpp @@ -21,7 +21,7 @@ /* $ModDep: m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/treesocket.h */ -bool TreeSocket::OperQuit(const std::string &prefix, std::deque ¶ms) +bool TreeSocket::OperQuit(const std::string &prefix, parameterlist ¶ms) { if (params.size() < 1) return true; diff --git a/src/modules/m_spanningtree/opertype.cpp b/src/modules/m_spanningtree/opertype.cpp index 54d4127b3..c1105aa71 100644 --- a/src/modules/m_spanningtree/opertype.cpp +++ b/src/modules/m_spanningtree/opertype.cpp @@ -24,7 +24,7 @@ /** Because the core won't let users or even SERVERS set +o, * we use the OPERTYPE command to do this. */ -bool TreeSocket::OperType(const std::string &prefix, std::deque ¶ms) +bool TreeSocket::OperType(const std::string &prefix, parameterlist ¶ms) { if (params.size() != 1) return true; diff --git a/src/modules/m_spanningtree/override_admin.cpp b/src/modules/m_spanningtree/override_admin.cpp index d9649ff9c..50ab04566 100644 --- a/src/modules/m_spanningtree/override_admin.cpp +++ b/src/modules/m_spanningtree/override_admin.cpp @@ -35,7 +35,7 @@ int ModuleSpanningTree::HandleAdmin(const std::vector& parameters, return 0; /* Remote ADMIN, the server is within the 1st parameter */ - std::deque params; + parameterlist params; params.push_back(parameters[0]); /* Send it out remotely, generate no reply yet */ TreeServer* s = Utils->FindServerMask(parameters[0]); diff --git a/src/modules/m_spanningtree/override_map.cpp b/src/modules/m_spanningtree/override_map.cpp index b49417f8a..989ee8900 100644 --- a/src/modules/m_spanningtree/override_map.cpp +++ b/src/modules/m_spanningtree/override_map.cpp @@ -94,7 +94,7 @@ int ModuleSpanningTree::HandleMap(const std::vector& parameters, Us } else if (s && s != Utils->TreeRoot) { - std::deque params; + parameterlist params; params.push_back(parameters[0]); params[0] = s->GetName(); diff --git a/src/modules/m_spanningtree/override_modules.cpp b/src/modules/m_spanningtree/override_modules.cpp index 154b4684c..039cbb0d0 100644 --- a/src/modules/m_spanningtree/override_modules.cpp +++ b/src/modules/m_spanningtree/override_modules.cpp @@ -34,7 +34,7 @@ int ModuleSpanningTree::HandleModules(const std::vector& parameters if (InspIRCd::Match(ServerInstance->Config->ServerName, parameters[0])) return 0; - std::deque params; + parameterlist params; params.push_back(parameters[0]); TreeServer* s = Utils->FindServerMask(parameters[0].c_str()); if (s) diff --git a/src/modules/m_spanningtree/override_motd.cpp b/src/modules/m_spanningtree/override_motd.cpp index 23e835f78..bee75975d 100644 --- a/src/modules/m_spanningtree/override_motd.cpp +++ b/src/modules/m_spanningtree/override_motd.cpp @@ -35,7 +35,7 @@ int ModuleSpanningTree::HandleMotd(const std::vector& parameters, U return 0; /* Remote MOTD, the server is within the 1st parameter */ - std::deque params; + parameterlist params; params.push_back(parameters[0]); /* Send it out remotely, generate no reply yet */ TreeServer* s = Utils->FindServerMask(parameters[0]); diff --git a/src/modules/m_spanningtree/override_stats.cpp b/src/modules/m_spanningtree/override_stats.cpp index 4bde25fbe..76522a3dd 100644 --- a/src/modules/m_spanningtree/override_stats.cpp +++ b/src/modules/m_spanningtree/override_stats.cpp @@ -36,7 +36,7 @@ int ModuleSpanningTree::HandleStats(const std::vector& parameters, return 0; /* Remote STATS, the server is within the 2nd parameter */ - std::deque params; + parameterlist params; params.push_back(parameters[0]); params.push_back(parameters[1]); /* Send it out remotely, generate no reply yet */ diff --git a/src/modules/m_spanningtree/override_time.cpp b/src/modules/m_spanningtree/override_time.cpp index bd1c5d489..d8498cd02 100644 --- a/src/modules/m_spanningtree/override_time.cpp +++ b/src/modules/m_spanningtree/override_time.cpp @@ -38,7 +38,7 @@ int ModuleSpanningTree::HandleTime(const std::vector& parameters, U if (found == Utils->TreeRoot) return 0; - std::deque params; + parameterlist params; params.push_back(found->GetName()); params.push_back(user->uuid); Utils->DoOneToOne(ServerInstance->Config->GetSID(),"TIME",params,found->GetName()); diff --git a/src/modules/m_spanningtree/override_whois.cpp b/src/modules/m_spanningtree/override_whois.cpp index 9302ac50f..68b0919c9 100644 --- a/src/modules/m_spanningtree/override_whois.cpp +++ b/src/modules/m_spanningtree/override_whois.cpp @@ -34,7 +34,7 @@ int ModuleSpanningTree::HandleRemoteWhois(const std::vector& parame User* remote = ServerInstance->FindNick(parameters[1]); if ((remote) && (remote->GetFd() < 0)) { - std::deque params; + parameterlist params; params.push_back(remote->uuid); Utils->DoOneToOne(user->uuid,"IDLE",params,remote->server); return 1; diff --git a/src/modules/m_spanningtree/ping.cpp b/src/modules/m_spanningtree/ping.cpp index e268be7ac..044d6e50c 100644 --- a/src/modules/m_spanningtree/ping.cpp +++ b/src/modules/m_spanningtree/ping.cpp @@ -26,7 +26,7 @@ /* $ModDep: m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/treesocket.h */ -bool TreeSocket::LocalPing(const std::string &prefix, std::deque ¶ms) +bool TreeSocket::LocalPing(const std::string &prefix, parameterlist ¶ms) { if (params.size() < 1) return true; diff --git a/src/modules/m_spanningtree/pong.cpp b/src/modules/m_spanningtree/pong.cpp index 8e1c08e98..6d9cd4193 100644 --- a/src/modules/m_spanningtree/pong.cpp +++ b/src/modules/m_spanningtree/pong.cpp @@ -26,7 +26,7 @@ /* $ModDep: m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/treesocket.h */ -bool TreeSocket::LocalPong(const std::string &prefix, std::deque ¶ms) +bool TreeSocket::LocalPong(const std::string &prefix, parameterlist ¶ms) { if (params.size() < 1) return true; diff --git a/src/modules/m_spanningtree/postcommand.cpp b/src/modules/m_spanningtree/postcommand.cpp index b3f2f80bb..719ff0046 100644 --- a/src/modules/m_spanningtree/postcommand.cpp +++ b/src/modules/m_spanningtree/postcommand.cpp @@ -47,7 +47,7 @@ void ModuleSpanningTree::OnPostCommand(const std::string &command, const std::ve // can just handle commands locally, without having // to have any special provision in place for remote // commands and linking protocols. - std::deque params; + parameterlist params; params.clear(); unsigned int n_translate = thiscmd->translation.size(); TranslateType translate_to; diff --git a/src/modules/m_spanningtree/privmsg.cpp b/src/modules/m_spanningtree/privmsg.cpp index b9b62ad00..67e4a0cdd 100644 --- a/src/modules/m_spanningtree/privmsg.cpp +++ b/src/modules/m_spanningtree/privmsg.cpp @@ -23,7 +23,7 @@ /** remote MOTD. leet, huh? */ -bool TreeSocket::ServerMessage(const std::string &messagetype, const std::string &prefix, std::deque ¶ms, const std::string &sourceserv) +bool TreeSocket::ServerMessage(const std::string &messagetype, const std::string &prefix, parameterlist ¶ms, const std::string &sourceserv) { if (params.size() >= 2) { diff --git a/src/modules/m_spanningtree/protocolinterface.cpp b/src/modules/m_spanningtree/protocolinterface.cpp index 722b7c543..1e5ae7ade 100644 --- a/src/modules/m_spanningtree/protocolinterface.cpp +++ b/src/modules/m_spanningtree/protocolinterface.cpp @@ -68,7 +68,7 @@ void SpanningTreeProtocolInterface::SendTopic(Channel* channel, std::string &top Utils->DoOneToMany(ServerInstance->Config->GetSID(),"FTOPIC", params); } -void SpanningTreeProtocolInterface::SendMode(const std::string &target, const parameterlist &modedata, const std::deque &translate) +void SpanningTreeProtocolInterface::SendMode(const std::string &target, const parameterlist &modedata, const std::vector &translate) { if (modedata.empty()) return; @@ -183,7 +183,7 @@ void SpanningTreeProtocolInterface::Introduce(User* user) return; if (IS_LOCAL(user)) { - std::deque params; + parameterlist params; params.push_back(user->uuid); params.push_back(ConvToStr(user->age)); params.push_back(user->nick); diff --git a/src/modules/m_spanningtree/protocolinterface.h b/src/modules/m_spanningtree/protocolinterface.h index 24b0cee20..de0afcef7 100644 --- a/src/modules/m_spanningtree/protocolinterface.h +++ b/src/modules/m_spanningtree/protocolinterface.h @@ -16,7 +16,7 @@ class SpanningTreeProtocolInterface : public ProtocolInterface virtual void SendEncapsulatedData(parameterlist &encap); virtual void SendMetaData(void* target, TargetTypeFlags type, const std::string &key, const std::string &data); virtual void SendTopic(Channel* channel, std::string &topic); - virtual void SendMode(const std::string &target, const parameterlist &modedata, const std::deque &types); + virtual void SendMode(const std::string &target, const parameterlist &modedata, const std::vector &types); virtual void SendModeNotice(const std::string &modes, const std::string &text); virtual void SendSNONotice(const std::string &snomask, const std::string &text); virtual void PushToClient(User* target, const std::string &rawline); diff --git a/src/modules/m_spanningtree/push.cpp b/src/modules/m_spanningtree/push.cpp index 01e2481bb..e0545f01e 100644 --- a/src/modules/m_spanningtree/push.cpp +++ b/src/modules/m_spanningtree/push.cpp @@ -26,7 +26,7 @@ /* $ModDep: m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/treesocket.h */ -bool TreeSocket::Push(const std::string &prefix, std::deque ¶ms) +bool TreeSocket::Push(const std::string &prefix, parameterlist ¶ms) { if (params.size() < 2) return true; diff --git a/src/modules/m_spanningtree/rsquit.cpp b/src/modules/m_spanningtree/rsquit.cpp index e64a262ca..a5dd31752 100644 --- a/src/modules/m_spanningtree/rsquit.cpp +++ b/src/modules/m_spanningtree/rsquit.cpp @@ -79,7 +79,7 @@ void CommandRSQuit::NoticeUser(User* user, const std::string &msg) } else { - std::deque params; + parameterlist params; params.push_back(user->nick); params.push_back("NOTICE "+ConvToStr(user->nick)+" :"+msg); Utils->DoOneToOne(ServerInstance->Config->GetSID(), "PUSH", params, user->server); diff --git a/src/modules/m_spanningtree/server.cpp b/src/modules/m_spanningtree/server.cpp index cb6e6dcda..24d1a66e7 100644 --- a/src/modules/m_spanningtree/server.cpp +++ b/src/modules/m_spanningtree/server.cpp @@ -31,7 +31,7 @@ * Some server somewhere in the network introducing another server. * -- w */ -bool TreeSocket::RemoteServer(const std::string &prefix, std::deque ¶ms) +bool TreeSocket::RemoteServer(const std::string &prefix, parameterlist ¶ms) { if (params.size() < 5) { @@ -88,7 +88,7 @@ bool TreeSocket::RemoteServer(const std::string &prefix, std::deque * This is used after the other side of a connection has accepted our credentials. * They are then introducing themselves to us, BEFORE either of us burst. -- w */ -bool TreeSocket::Outbound_Reply_Server(std::deque ¶ms) +bool TreeSocket::Outbound_Reply_Server(parameterlist ¶ms) { if (params.size() < 5) { @@ -184,7 +184,7 @@ bool TreeSocket::Outbound_Reply_Server(std::deque ¶ms) * Someone else is attempting to connect to us if this is called. Validate their credentials etc. * -- w */ -bool TreeSocket::Inbound_Server(std::deque ¶ms) +bool TreeSocket::Inbound_Server(parameterlist ¶ms) { if (params.size() < 5) { diff --git a/src/modules/m_spanningtree/stats.cpp b/src/modules/m_spanningtree/stats.cpp index 7c9efecde..810b6dc77 100644 --- a/src/modules/m_spanningtree/stats.cpp +++ b/src/modules/m_spanningtree/stats.cpp @@ -27,7 +27,7 @@ /* $ModDep: m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/link.h m_spanningtree/treesocket.h */ -bool TreeSocket::Stats(const std::string &prefix, std::deque ¶ms) +bool TreeSocket::Stats(const std::string &prefix, parameterlist ¶ms) { /* Get the reply to a STATS query if it matches this servername, * and send it back as a load of PUSH queries @@ -41,7 +41,7 @@ bool TreeSocket::Stats(const std::string &prefix, std::deque ¶m User* source = this->ServerInstance->FindNick(prefix); if (source) { - std::deque par; + parameterlist par; par.push_back(prefix); par.push_back(""); DoStats(this->ServerInstance, *(params[0].c_str()), source, results); diff --git a/src/modules/m_spanningtree/svsjoin.cpp b/src/modules/m_spanningtree/svsjoin.cpp index 40aa80392..dbdcce718 100644 --- a/src/modules/m_spanningtree/svsjoin.cpp +++ b/src/modules/m_spanningtree/svsjoin.cpp @@ -26,7 +26,7 @@ /* $ModDep: m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/treesocket.h */ -bool TreeSocket::ServiceJoin(const std::string &prefix, std::deque ¶ms) +bool TreeSocket::ServiceJoin(const std::string &prefix, parameterlist ¶ms) { if (params.size() < 2) return true; diff --git a/src/modules/m_spanningtree/svsnick.cpp b/src/modules/m_spanningtree/svsnick.cpp index cb4977740..fe08b9ee2 100644 --- a/src/modules/m_spanningtree/svsnick.cpp +++ b/src/modules/m_spanningtree/svsnick.cpp @@ -29,7 +29,7 @@ /** Because Andy insists that services-compatible servers must * implement SVSNICK and SVSJOIN, that's exactly what we do :p */ -bool TreeSocket::ForceNick(const std::string &prefix, std::deque ¶ms) +bool TreeSocket::ForceNick(const std::string &prefix, parameterlist ¶ms) { if (params.size() < 3) return true; @@ -42,7 +42,7 @@ bool TreeSocket::ForceNick(const std::string &prefix, std::deque &p if (IS_LOCAL(u)) { - std::deque par; + parameterlist par; par.push_back(params[1]); if (!u->ForceNickChange(params[1].c_str())) diff --git a/src/modules/m_spanningtree/svspart.cpp b/src/modules/m_spanningtree/svspart.cpp index 8d95395ed..1649b32b6 100644 --- a/src/modules/m_spanningtree/svspart.cpp +++ b/src/modules/m_spanningtree/svspart.cpp @@ -26,7 +26,7 @@ /* $ModDep: m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/treesocket.h */ -bool TreeSocket::ServicePart(const std::string &prefix, std::deque ¶ms) +bool TreeSocket::ServicePart(const std::string &prefix, parameterlist ¶ms) { if (params.size() < 2) return true; diff --git a/src/modules/m_spanningtree/time.cpp b/src/modules/m_spanningtree/time.cpp index 006260a89..d2c8f7989 100644 --- a/src/modules/m_spanningtree/time.cpp +++ b/src/modules/m_spanningtree/time.cpp @@ -26,7 +26,7 @@ /* $ModDep: m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/treesocket.h */ -bool TreeSocket::Time(const std::string &prefix, std::deque ¶ms) +bool TreeSocket::Time(const std::string &prefix, parameterlist ¶ms) { // :source.server TIME remote.server sendernick // :remote.server TIME source.server sendernick TS diff --git a/src/modules/m_spanningtree/treesocket.h b/src/modules/m_spanningtree/treesocket.h index de9c78fef..6d99c2a76 100644 --- a/src/modules/m_spanningtree/treesocket.h +++ b/src/modules/m_spanningtree/treesocket.h @@ -198,7 +198,7 @@ class TreeSocket : public BufferedSocket /* Isolate and return the elements that are different between two comma seperated lists */ std::string ListDifference(const std::string &one, const std::string &two); - bool Capab(const std::deque ¶ms); + bool Capab(const parameterlist ¶ms); /** This function forces this server to quit, removing this server * and any users on it (and servers and users below that, etc etc). @@ -215,19 +215,19 @@ class TreeSocket : public BufferedSocket void Squit(TreeServer* Current, const std::string &reason); /** FMODE command - server mode with timestamp checks */ - bool ForceMode(const std::string &source, std::deque ¶ms); + bool ForceMode(const std::string &source, parameterlist ¶ms); /** FTOPIC command */ - bool ForceTopic(const std::string &source, std::deque ¶ms); + bool ForceTopic(const std::string &source, parameterlist ¶ms); /** FJOIN, similar to TS6 SJOIN, but not quite. */ - bool ForceJoin(const std::string &source, std::deque ¶ms); + bool ForceJoin(const std::string &source, parameterlist ¶ms); /* Used on nick collision ... XXX ugly function HACK */ int DoCollision(User *u, time_t remotets, const std::string &remoteident, const std::string &remoteip, const std::string &remoteuid); /** UID command */ - bool ParseUID(const std::string &source, std::deque ¶ms); + bool ParseUID(const std::string &source, parameterlist ¶ms); /** Send one or more FJOINs for a channel of users. * If the length of a single line is more than 480-NICKMAX @@ -266,117 +266,117 @@ class TreeSocket : public BufferedSocket void WriteLine(std::string line); /** Handle ERROR command */ - bool Error(std::deque ¶ms); + bool Error(parameterlist ¶ms); /** remote MOTD. leet, huh? */ - bool Motd(const std::string &prefix, std::deque ¶ms); + bool Motd(const std::string &prefix, parameterlist ¶ms); /** remote ADMIN. leet, huh? */ - bool Admin(const std::string &prefix, std::deque ¶ms); + bool Admin(const std::string &prefix, parameterlist ¶ms); /** Remote MODULES */ - bool Modules(const std::string &prefix, std::deque ¶ms); + bool Modules(const std::string &prefix, parameterlist ¶ms); - bool Stats(const std::string &prefix, std::deque ¶ms); + bool Stats(const std::string &prefix, parameterlist ¶ms); /** Because the core won't let users or even SERVERS set +o, * we use the OPERTYPE command to do this. */ - bool OperType(const std::string &prefix, std::deque ¶ms); + bool OperType(const std::string &prefix, parameterlist ¶ms); /** Because Andy insists that services-compatible servers must * implement SVSNICK and SVSJOIN, that's exactly what we do :p */ - bool ForceNick(const std::string &prefix, std::deque ¶ms); + bool ForceNick(const std::string &prefix, parameterlist ¶ms); /** PRIVMSG or NOTICE with server origin ONLY */ - bool ServerMessage(const std::string &messagetype, const std::string &prefix, std::deque ¶ms, const std::string &sourceserv); + bool ServerMessage(const std::string &messagetype, const std::string &prefix, parameterlist ¶ms, const std::string &sourceserv); /** ENCAP command */ - bool Encap(const std::string &prefix, std::deque ¶ms); + bool Encap(const std::string &prefix, parameterlist ¶ms); /** OPERQUIT command */ - bool OperQuit(const std::string &prefix, std::deque ¶ms); + bool OperQuit(const std::string &prefix, parameterlist ¶ms); /** SVSJOIN */ - bool ServiceJoin(const std::string &prefix, std::deque ¶ms); + bool ServiceJoin(const std::string &prefix, parameterlist ¶ms); /** SVSPART */ - bool ServicePart(const std::string &prefix, std::deque ¶ms); + bool ServicePart(const std::string &prefix, parameterlist ¶ms); /** KILL */ - bool RemoteKill(const std::string &prefix, std::deque ¶ms); + bool RemoteKill(const std::string &prefix, parameterlist ¶ms); /** PONG */ - bool LocalPong(const std::string &prefix, std::deque ¶ms); + bool LocalPong(const std::string &prefix, parameterlist ¶ms); /** METADATA */ - bool MetaData(const std::string &prefix, std::deque ¶ms); + bool MetaData(const std::string &prefix, parameterlist ¶ms); /** VERSION */ - bool ServerVersion(const std::string &prefix, std::deque ¶ms); + bool ServerVersion(const std::string &prefix, parameterlist ¶ms); /** CHGHOST */ - bool ChangeHost(const std::string &prefix, std::deque ¶ms); + bool ChangeHost(const std::string &prefix, parameterlist ¶ms); /** ADDLINE */ - bool AddLine(const std::string &prefix, std::deque ¶ms); + bool AddLine(const std::string &prefix, parameterlist ¶ms); /** DELLINE */ - bool DelLine(const std::string &prefix, std::deque ¶ms); + bool DelLine(const std::string &prefix, parameterlist ¶ms); /** CHGNAME */ - bool ChangeName(const std::string &prefix, std::deque ¶ms); + bool ChangeName(const std::string &prefix, parameterlist ¶ms); /** WHOIS */ - bool Whois(const std::string &prefix, std::deque ¶ms); + bool Whois(const std::string &prefix, parameterlist ¶ms); /** PUSH */ - bool Push(const std::string &prefix, std::deque ¶ms); + bool Push(const std::string &prefix, parameterlist ¶ms); /** TIME */ - bool Time(const std::string &prefix, std::deque ¶ms); + bool Time(const std::string &prefix, parameterlist ¶ms); /** PING */ - bool LocalPing(const std::string &prefix, std::deque ¶ms); + bool LocalPing(const std::string &prefix, parameterlist ¶ms); /** Remove all modes from a channel, including statusmodes (+qaovh etc), simplemodes, parameter modes. * This does not update the timestamp of the target channel, this must be done seperately. */ - bool RemoveStatus(const std::string &prefix, std::deque ¶ms); + bool RemoveStatus(const std::string &prefix, parameterlist ¶ms); /** <- (remote) <- SERVER */ - bool RemoteServer(const std::string &prefix, std::deque ¶ms); + bool RemoteServer(const std::string &prefix, parameterlist ¶ms); /** (local) -> SERVER */ - bool Outbound_Reply_Server(std::deque ¶ms); + bool Outbound_Reply_Server(parameterlist ¶ms); /** (local) <- SERVER */ - bool Inbound_Server(std::deque ¶ms); + bool Inbound_Server(parameterlist ¶ms); /** Handle netsplit */ - void Split(const std::string &line, std::deque &n); + void Split(const std::string &line, parameterlist &n); /** Process complete line from buffer */ diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp index e98246a35..46f2657ff 100644 --- a/src/modules/m_spanningtree/treesocket1.cpp +++ b/src/modules/m_spanningtree/treesocket1.cpp @@ -231,7 +231,7 @@ void TreeSocket::Squit(TreeServer* Current, const std::string &reason) Event rmode((char*)Current->GetName().c_str(), (Module*)Utils->Creator, "lost_server"); rmode.Send(ServerInstance); - std::deque params; + parameterlist params; params.push_back(Current->GetName()); params.push_back(":"+reason); Utils->DoOneToAllButSender(Current->GetParent()->GetName(),"SQUIT",params,Current->GetName()); diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index b117ebe82..bc9388c94 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -38,7 +38,7 @@ void TreeSocket::WriteLine(std::string line) /* Handle ERROR command */ -bool TreeSocket::Error(std::deque ¶ms) +bool TreeSocket::Error(parameterlist ¶ms) { if (params.size() < 1) return false; @@ -47,7 +47,7 @@ bool TreeSocket::Error(std::deque ¶ms) return false; } -void TreeSocket::Split(const std::string &line, std::deque &n) +void TreeSocket::Split(const std::string &line, parameterlist &n) { n.clear(); irc::tokenstream tokens(line); @@ -61,7 +61,7 @@ void TreeSocket::Split(const std::string &line, std::deque &n) bool TreeSocket::ProcessLine(std::string &line) { - std::deque params; + parameterlist params; irc::string command; std::string prefix; @@ -80,17 +80,20 @@ bool TreeSocket::ProcessLine(std::string &line) if ((params[0][0] == ':') && (params.size() > 1)) { prefix = params[0].substr(1); - params.pop_front(); if (prefix.empty()) { this->SendError("BUG (?) Empty prefix recieved: " + line); return false; } + command = params[1].c_str(); + params.erase(params.begin(), params.begin() + 2); + } + else + { + command = params[0].c_str(); + params.erase(params.begin()); } - - command = params[0].c_str(); - params.pop_front(); switch (this->LinkState) { diff --git a/src/modules/m_spanningtree/uid.cpp b/src/modules/m_spanningtree/uid.cpp index 7565be337..7146f4c01 100644 --- a/src/modules/m_spanningtree/uid.cpp +++ b/src/modules/m_spanningtree/uid.cpp @@ -23,7 +23,7 @@ /* $ModDep: m_spanningtree/resolvers.h m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/link.h m_spanningtree/treesocket.h m_hash.h m_spanningtree/handshaketimer.h */ -bool TreeSocket::ParseUID(const std::string &source, std::deque ¶ms) +bool TreeSocket::ParseUID(const std::string &source, parameterlist ¶ms) { /** Do we have enough parameters: * 0 1 2 3 4 5 6 7 8 9 (n-1) diff --git a/src/modules/m_spanningtree/utils.cpp b/src/modules/m_spanningtree/utils.cpp index e527cd2da..7c1771557 100644 --- a/src/modules/m_spanningtree/utils.cpp +++ b/src/modules/m_spanningtree/utils.cpp @@ -216,7 +216,7 @@ void SpanningTreeUtilities::GetListOfServersForChannel(Channel* c, TreeServerLis return; } -bool SpanningTreeUtilities::DoOneToAllButSenderRaw(const std::string &data, const std::string &omit, const std::string &prefix, const irc::string &command, std::deque ¶ms) +bool SpanningTreeUtilities::DoOneToAllButSenderRaw(const std::string &data, const std::string &omit, const std::string &prefix, const irc::string &command, parameterlist ¶ms) { char pfx = 0; TreeServer* omitroute = this->BestRouteTo(omit); @@ -236,7 +236,7 @@ bool SpanningTreeUtilities::DoOneToAllButSenderRaw(const std::string &data, cons User* d = ServerInstance->FindNick(params[0]); if (d) { - std::deque par; + parameterlist par; par.push_back(params[0]); par.push_back(":"+params[1]); this->DoOneToOne(prefix,command.c_str(),par,d->server); @@ -245,7 +245,7 @@ bool SpanningTreeUtilities::DoOneToAllButSenderRaw(const std::string &data, cons } else if (*(params[0].c_str()) == '$') { - std::deque par; + parameterlist par; par.push_back(params[0]); par.push_back(":"+params[1]); this->DoOneToAllButSender(prefix,command.c_str(),par,omitroute->GetName()); @@ -289,7 +289,7 @@ bool SpanningTreeUtilities::DoOneToAllButSenderRaw(const std::string &data, cons return true; } -bool SpanningTreeUtilities::DoOneToAllButSender(const std::string &prefix, const std::string &command, std::deque ¶ms, std::string omit) +bool SpanningTreeUtilities::DoOneToAllButSender(const std::string &prefix, const std::string &command, parameterlist ¶ms, std::string omit) { TreeServer* omitroute = this->BestRouteTo(omit); std::string FullLine = ":" + prefix + " " + command; @@ -316,7 +316,7 @@ bool SpanningTreeUtilities::DoOneToAllButSender(const std::string &prefix, const return true; } -bool SpanningTreeUtilities::DoOneToMany(const std::string &prefix, const std::string &command, std::deque ¶ms) +bool SpanningTreeUtilities::DoOneToMany(const std::string &prefix, const std::string &command, parameterlist ¶ms) { std::string FullLine = ":" + prefix + " " + command; unsigned int words = params.size(); @@ -338,21 +338,21 @@ bool SpanningTreeUtilities::DoOneToMany(const std::string &prefix, const std::st return true; } -bool SpanningTreeUtilities::DoOneToMany(const char* prefix, const char* command, std::deque ¶ms) +bool SpanningTreeUtilities::DoOneToMany(const char* prefix, const char* command, parameterlist ¶ms) { std::string spfx = prefix; std::string scmd = command; return this->DoOneToMany(spfx, scmd, params); } -bool SpanningTreeUtilities::DoOneToAllButSender(const char* prefix, const char* command, std::deque ¶ms, std::string omit) +bool SpanningTreeUtilities::DoOneToAllButSender(const char* prefix, const char* command, parameterlist ¶ms, std::string omit) { std::string spfx = prefix; std::string scmd = command; return this->DoOneToAllButSender(spfx, scmd, params, omit); } -bool SpanningTreeUtilities::DoOneToOne(const std::string &prefix, const std::string &command, std::deque ¶ms, std::string target) +bool SpanningTreeUtilities::DoOneToOne(const std::string &prefix, const std::string &command, parameterlist ¶ms, std::string target) { TreeServer* Route = this->BestRouteTo(target); if (Route) diff --git a/src/modules/m_spanningtree/utils.h b/src/modules/m_spanningtree/utils.h index 81c47267d..9936ebacf 100644 --- a/src/modules/m_spanningtree/utils.h +++ b/src/modules/m_spanningtree/utils.h @@ -149,27 +149,27 @@ class SpanningTreeUtilities : public classbase /** Send a message from this server to one other local or remote */ - bool DoOneToOne(const std::string &prefix, const std::string &command, std::deque ¶ms, std::string target); + bool DoOneToOne(const std::string &prefix, const std::string &command, parameterlist ¶ms, std::string target); /** Send a message from this server to all but one other, local or remote */ - bool DoOneToAllButSender(const std::string &prefix, const std::string &command, std::deque ¶ms, std::string omit); + bool DoOneToAllButSender(const std::string &prefix, const std::string &command, parameterlist ¶ms, std::string omit); /** Send a message from this server to all but one other, local or remote */ - bool DoOneToAllButSender(const char* prefix, const char* command, std::deque ¶ms, std::string omit); + bool DoOneToAllButSender(const char* prefix, const char* command, parameterlist ¶ms, std::string omit); /** Send a message from this server to all others */ - bool DoOneToMany(const std::string &prefix, const std::string &command, std::deque ¶ms); + bool DoOneToMany(const std::string &prefix, const std::string &command, parameterlist ¶ms); /** Send a message from this server to all others */ - bool DoOneToMany(const char* prefix, const char* command, std::deque ¶ms); + bool DoOneToMany(const char* prefix, const char* command, parameterlist ¶ms); /** Send a message from this server to all others, without doing any processing on the command (e.g. send it as-is with colons and all) */ - bool DoOneToAllButSenderRaw(const std::string &data, const std::string &omit, const std::string &prefix, const irc::string &command, std::deque ¶ms); + bool DoOneToAllButSenderRaw(const std::string &data, const std::string &omit, const std::string &prefix, const irc::string &command, parameterlist ¶ms); /** Read the spanningtree module's tags from the config file */ diff --git a/src/modules/m_spanningtree/version.cpp b/src/modules/m_spanningtree/version.cpp index 4f8391148..abf61611a 100644 --- a/src/modules/m_spanningtree/version.cpp +++ b/src/modules/m_spanningtree/version.cpp @@ -26,7 +26,7 @@ /* $ModDep: m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/treesocket.h */ -bool TreeSocket::ServerVersion(const std::string &prefix, std::deque ¶ms) +bool TreeSocket::ServerVersion(const std::string &prefix, parameterlist ¶ms) { if (params.size() < 1) return true; diff --git a/src/modules/m_spanningtree/whois.cpp b/src/modules/m_spanningtree/whois.cpp index 85f186c40..796713182 100644 --- a/src/modules/m_spanningtree/whois.cpp +++ b/src/modules/m_spanningtree/whois.cpp @@ -26,7 +26,7 @@ /* $ModDep: m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/treesocket.h */ -bool TreeSocket::Whois(const std::string &prefix, std::deque ¶ms) +bool TreeSocket::Whois(const std::string &prefix, parameterlist ¶ms) { if (params.size() < 1) return true; @@ -43,7 +43,7 @@ bool TreeSocket::Whois(const std::string &prefix, std::deque ¶m char idle[MAXBUF]; snprintf(signon, MAXBUF, "%lu", (unsigned long)x->signon); snprintf(idle, MAXBUF, "%lu", (unsigned long)abs((long)((x->idle_lastmsg) - ServerInstance->Time()))); - std::deque par; + parameterlist par; par.push_back(prefix); par.push_back(signon); par.push_back(idle); -- 2.39.2