diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-02 00:43:25 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-02 00:43:25 +0000 |
commit | 219993bc9018d9f0d9568330d7a972b68b785d27 (patch) | |
tree | 9d827a0e1a2ad343ebff21fb7f692b1fd2835650 /src/modules/m_spanningtree | |
parent | 2630a87bb13b089e6d0fdcff4bcd0f3a9612e52f (diff) |
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
Diffstat (limited to 'src/modules/m_spanningtree')
48 files changed, 145 insertions, 148 deletions
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<std::string> ¶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<std::string> ¶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<std::string> ¶m User* source = this->ServerInstance->FindNick(prefix); if (source) { - std::deque<std::string> 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<std::string> ¶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<std::string> ¶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<std::string> ¶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<std::string> ¶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<std::string> ¶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<std::string> &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<std::string> 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<std::string> &p /* Flush mode stacker if we lost the FJOIN or had equal TS */ if (apply_other_sides_modes) { - std::deque<std::string> stackresult; - std::vector<std::string> 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<std::string> ¶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<std::string> if (c) { irc::modestacker stack(ServerInstance, false); - std::deque<std::string> stackresult; - std::vector<std::string> 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<std::string> 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<std::string> ¶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<std::string> ¶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<std::string> ¶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<std::string> ¶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<std::string> 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<std::string> 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<std::string> 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<std::string> 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<std::string> 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<std::string> 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<std::string> 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<std::string> 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<std::string> 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<std::string> 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<std::string> 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<std::string> 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<std::string> 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<std::string> 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<std::string> 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<std::string> 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<std::string> 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<std::string> 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<std::string> 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<std::string> &text, const std::deque<TranslateType> &translate) +void ModuleSpanningTree::OnMode(User* user, void* dest, int target_type, const parameterlist &text, const std::vector<TranslateType> &translate) { if ((IS_LOCAL(user)) && (user->registered == REG_ALL)) { - std::deque<std::string> 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<std::string> params; + parameterlist params; params.clear(); Utils->DoOneToMany(user->uuid,"AWAY",params); } else { - std::deque<std::string> 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<std::string> &modeline, const std::deque<TranslateType> &translate) +void ModuleSpanningTree::ProtoSendMode(void* opaque, TargetTypeFlags target_type, void* target, const parameterlist &modeline, const std::vector<TranslateType> &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<std::string> &text, const std::deque<TranslateType> &translate); + virtual void OnMode(User* user, void* dest, int target_type, const std::vector<std::string> &text, const std::vector<TranslateType> &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<std::string> &modeline, const std::deque<TranslateType> &translate); + virtual void ProtoSendMode(void* opaque, TargetTypeFlags target_type, void* target, const std::vector<std::string> &modeline, const std::vector<TranslateType> &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<std::string> ¶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<std::string> ¶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<std::string> &par } char strbuf[MAXBUF]; - std::deque<std::string> 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<std::string> ¶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<std::string> ¶ms if (source) { - std::deque<std::string> 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<std::string> 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<std::string> ¶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<std::string> ¶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<std::string>& parameters, return 0; /* Remote ADMIN, the server is within the 1st parameter */ - std::deque<std::string> 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<std::string>& parameters, Us } else if (s && s != Utils->TreeRoot) { - std::deque<std::string> 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<std::string>& parameters if (InspIRCd::Match(ServerInstance->Config->ServerName, parameters[0])) return 0; - std::deque<std::string> 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<std::string>& parameters, U return 0; /* Remote MOTD, the server is within the 1st parameter */ - std::deque<std::string> 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<std::string>& parameters, return 0; /* Remote STATS, the server is within the 2nd parameter */ - std::deque<std::string> 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<std::string>& parameters, U if (found == Utils->TreeRoot) return 0; - std::deque<std::string> 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<std::string>& parame User* remote = ServerInstance->FindNick(parameters[1]); if ((remote) && (remote->GetFd() < 0)) { - std::deque<std::string> 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<std::string> ¶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<std::string> ¶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<std::string> 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<std::string> ¶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<TranslateType> &translate) +void SpanningTreeProtocolInterface::SendMode(const std::string &target, const parameterlist &modedata, const std::vector<TranslateType> &translate) { if (modedata.empty()) return; @@ -183,7 +183,7 @@ void SpanningTreeProtocolInterface::Introduce(User* user) return; if (IS_LOCAL(user)) { - std::deque<std::string> 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<TranslateType> &types); + virtual void SendMode(const std::string &target, const parameterlist &modedata, const std::vector<TranslateType> &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<std::string> ¶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<std::string> 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<std::string> ¶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<std::string> * 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<std::string> ¶ms) +bool TreeSocket::Outbound_Reply_Server(parameterlist ¶ms) { if (params.size() < 5) { @@ -184,7 +184,7 @@ bool TreeSocket::Outbound_Reply_Server(std::deque<std::string> ¶ms) * Someone else is attempting to connect to us if this is called. Validate their credentials etc. * -- w */ -bool TreeSocket::Inbound_Server(std::deque<std::string> ¶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<std::string> ¶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<std::string> ¶m User* source = this->ServerInstance->FindNick(prefix); if (source) { - std::deque<std::string> 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<std::string> ¶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<std::string> ¶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<std::string> &p if (IS_LOCAL(u)) { - std::deque<std::string> 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<std::string> ¶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<std::string> ¶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<std::string> ¶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<std::string> ¶ms); + bool ForceMode(const std::string &source, parameterlist ¶ms); /** FTOPIC command */ - bool ForceTopic(const std::string &source, std::deque<std::string> ¶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<std::string> ¶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<std::string> ¶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<std::string> ¶ms); + bool Error(parameterlist ¶ms); /** remote MOTD. leet, huh? */ - bool Motd(const std::string &prefix, std::deque<std::string> ¶ms); + bool Motd(const std::string &prefix, parameterlist ¶ms); /** remote ADMIN. leet, huh? */ - bool Admin(const std::string &prefix, std::deque<std::string> ¶ms); + bool Admin(const std::string &prefix, parameterlist ¶ms); /** Remote MODULES */ - bool Modules(const std::string &prefix, std::deque<std::string> ¶ms); + bool Modules(const std::string &prefix, parameterlist ¶ms); - bool Stats(const std::string &prefix, std::deque<std::string> ¶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<std::string> ¶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<std::string> ¶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<std::string> ¶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<std::string> ¶ms); + bool Encap(const std::string &prefix, parameterlist ¶ms); /** OPERQUIT command */ - bool OperQuit(const std::string &prefix, std::deque<std::string> ¶ms); + bool OperQuit(const std::string &prefix, parameterlist ¶ms); /** SVSJOIN */ - bool ServiceJoin(const std::string &prefix, std::deque<std::string> ¶ms); + bool ServiceJoin(const std::string &prefix, parameterlist ¶ms); /** SVSPART */ - bool ServicePart(const std::string &prefix, std::deque<std::string> ¶ms); + bool ServicePart(const std::string &prefix, parameterlist ¶ms); /** KILL */ - bool RemoteKill(const std::string &prefix, std::deque<std::string> ¶ms); + bool RemoteKill(const std::string &prefix, parameterlist ¶ms); /** PONG */ - bool LocalPong(const std::string &prefix, std::deque<std::string> ¶ms); + bool LocalPong(const std::string &prefix, parameterlist ¶ms); /** METADATA */ - bool MetaData(const std::string &prefix, std::deque<std::string> ¶ms); + bool MetaData(const std::string &prefix, parameterlist ¶ms); /** VERSION */ - bool ServerVersion(const std::string &prefix, std::deque<std::string> ¶ms); + bool ServerVersion(const std::string &prefix, parameterlist ¶ms); /** CHGHOST */ - bool ChangeHost(const std::string &prefix, std::deque<std::string> ¶ms); + bool ChangeHost(const std::string &prefix, parameterlist ¶ms); /** ADDLINE */ - bool AddLine(const std::string &prefix, std::deque<std::string> ¶ms); + bool AddLine(const std::string &prefix, parameterlist ¶ms); /** DELLINE */ - bool DelLine(const std::string &prefix, std::deque<std::string> ¶ms); + bool DelLine(const std::string &prefix, parameterlist ¶ms); /** CHGNAME */ - bool ChangeName(const std::string &prefix, std::deque<std::string> ¶ms); + bool ChangeName(const std::string &prefix, parameterlist ¶ms); /** WHOIS */ - bool Whois(const std::string &prefix, std::deque<std::string> ¶ms); + bool Whois(const std::string &prefix, parameterlist ¶ms); /** PUSH */ - bool Push(const std::string &prefix, std::deque<std::string> ¶ms); + bool Push(const std::string &prefix, parameterlist ¶ms); /** TIME */ - bool Time(const std::string &prefix, std::deque<std::string> ¶ms); + bool Time(const std::string &prefix, parameterlist ¶ms); /** PING */ - bool LocalPing(const std::string &prefix, std::deque<std::string> ¶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<std::string> ¶ms); + bool RemoveStatus(const std::string &prefix, parameterlist ¶ms); /** <- (remote) <- SERVER */ - bool RemoteServer(const std::string &prefix, std::deque<std::string> ¶ms); + bool RemoteServer(const std::string &prefix, parameterlist ¶ms); /** (local) -> SERVER */ - bool Outbound_Reply_Server(std::deque<std::string> ¶ms); + bool Outbound_Reply_Server(parameterlist ¶ms); /** (local) <- SERVER */ - bool Inbound_Server(std::deque<std::string> ¶ms); + bool Inbound_Server(parameterlist ¶ms); /** Handle netsplit */ - void Split(const std::string &line, std::deque<std::string> &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<std::string> 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<std::string> ¶ms) +bool TreeSocket::Error(parameterlist ¶ms) { if (params.size() < 1) return false; @@ -47,7 +47,7 @@ bool TreeSocket::Error(std::deque<std::string> ¶ms) return false; } -void TreeSocket::Split(const std::string &line, std::deque<std::string> &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<std::string> &n) bool TreeSocket::ProcessLine(std::string &line) { - std::deque<std::string> 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<std::string> ¶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<std::string> ¶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<std::string> 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<std::string> 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<std::string> ¶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<std::string> ¶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<std::string> ¶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<std::string> ¶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<std::string> ¶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<std::string> ¶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<std::string> ¶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<std::string> ¶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<std::string> ¶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<std::string> ¶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<std::string> ¶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<std::string> ¶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<std::string> ¶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<std::string> ¶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<std::string> par; + parameterlist par; par.push_back(prefix); par.push_back(signon); par.push_back(idle); |