diff options
author | Peter Powell <petpow@saberuk.com> | 2018-07-26 19:43:54 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2018-07-26 20:12:14 +0100 |
commit | 384ef31bc01e4a1a2e59d082c9066002410ba54a (patch) | |
tree | 06bd81f9e0e48183c1ada07cf7a8757a5028cad1 /src/modules | |
parent | 09c5439c02f31e9875083e51966dad535af005a9 (diff) |
Use CommandBase::Params instead of std::vector<std::string>.
This is presently a typedef but will soon be replaced with a class
that encapsulates both tags and parameters.
Diffstat (limited to 'src/modules')
116 files changed, 273 insertions, 272 deletions
diff --git a/src/modules/m_abbreviation.cpp b/src/modules/m_abbreviation.cpp index c81caf142..22baa916b 100644 --- a/src/modules/m_abbreviation.cpp +++ b/src/modules/m_abbreviation.cpp @@ -38,7 +38,7 @@ class ModuleAbbreviation : public Module return Version("Provides the ability to abbreviate commands a-la BBC BASIC keywords.",VF_VENDOR); } - ModResult OnPreCommand(std::string &command, std::vector<std::string> ¶meters, LocalUser *user, bool validated, const std::string &original_line) CXX11_OVERRIDE + ModResult OnPreCommand(std::string& command, CommandBase::Params& parameters, LocalUser* user, bool validated, const std::string& original_line) CXX11_OVERRIDE { /* Command is already validated, has a length of 0, or last character is not a . */ if (validated || command.empty() || *command.rbegin() != '.') diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp index 01338e8b4..a8e39cb47 100644 --- a/src/modules/m_alias.cpp +++ b/src/modules/m_alias.cpp @@ -129,7 +129,7 @@ class ModuleAlias : public Module return word; } - ModResult OnPreCommand(std::string &command, std::vector<std::string> ¶meters, LocalUser *user, bool validated, const std::string &original_line) CXX11_OVERRIDE + ModResult OnPreCommand(std::string& command, CommandBase::Params& parameters, LocalUser* user, bool validated, const std::string& original_line) CXX11_OVERRIDE { /* If theyre not registered yet, we dont want * to know. @@ -328,7 +328,7 @@ class ModuleAlias : public Module } irc::tokenstream ss(result); - std::vector<std::string> pars; + CommandBase::Params pars; std::string command, token; ss.GetToken(command); diff --git a/src/modules/m_alltime.cpp b/src/modules/m_alltime.cpp index de3e702ac..486ad1c18 100644 --- a/src/modules/m_alltime.cpp +++ b/src/modules/m_alltime.cpp @@ -29,7 +29,7 @@ class CommandAlltime : public Command flags_needed = 'o'; } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { const std::string fmtdate = InspIRCd::TimeString(ServerInstance->Time(), "%Y-%m-%d %H:%M:%S", true); @@ -41,7 +41,7 @@ class CommandAlltime : public Command return CMD_SUCCESS; } - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE { return ROUTE_OPT_BCAST; } diff --git a/src/modules/m_blockamsg.cpp b/src/modules/m_blockamsg.cpp index 097041896..3c8fcd1b5 100644 --- a/src/modules/m_blockamsg.cpp +++ b/src/modules/m_blockamsg.cpp @@ -81,7 +81,7 @@ class ModuleBlockAmsg : public Module action = IBLOCK_KILLOPERS; } - ModResult OnPreCommand(std::string &command, std::vector<std::string> ¶meters, LocalUser *user, bool validated, const std::string &original_line) CXX11_OVERRIDE + ModResult OnPreCommand(std::string& command, CommandBase::Params& parameters, LocalUser* user, bool validated, const std::string& original_line) CXX11_OVERRIDE { // Don't do anything with unregistered users if (user->registered != REG_ALL) diff --git a/src/modules/m_callerid.cpp b/src/modules/m_callerid.cpp index ecccbe91b..b0ec3b8ff 100644 --- a/src/modules/m_callerid.cpp +++ b/src/modules/m_callerid.cpp @@ -201,7 +201,7 @@ public: * /accept nick1,nick2,nick3,* * to add 3 nicks and then show your list */ - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { if (CommandParser::LoopCall(user, this, parameters, 0)) return CMD_SUCCESS; @@ -234,7 +234,7 @@ public: return (RemoveAccept(user, action.first) ? CMD_SUCCESS : CMD_FAILURE); } - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE { // There is a list in parameters[0] in two cases: // Either when the source is remote, this happens because 2.0 servers send comma seperated uuid lists, diff --git a/src/modules/m_cap.cpp b/src/modules/m_cap.cpp index 1465f8a38..80e70d3e5 100644 --- a/src/modules/m_cap.cpp +++ b/src/modules/m_cap.cpp @@ -365,7 +365,7 @@ class CommandCap : public SplitCommand works_before_reg = true; } - CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user) CXX11_OVERRIDE + CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE { if (user->registered != REG_ALL) holdext.set(user, 1); diff --git a/src/modules/m_cban.cpp b/src/modules/m_cban.cpp index 7235a8bef..5f98def8f 100644 --- a/src/modules/m_cban.cpp +++ b/src/modules/m_cban.cpp @@ -85,7 +85,7 @@ class CommandCBan : public Command flags_needed = 'o'; this->syntax = "<channel> [<duration> :<reason>]"; } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { /* syntax: CBAN #channel time :reason goes here */ /* 'time' is a human-readable timestring, like 2d3h2s. */ @@ -132,7 +132,7 @@ class CommandCBan : public Command return CMD_SUCCESS; } - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE { if (IS_LOCAL(user)) return ROUTE_LOCALONLY; // spanningtree will send ADDLINE diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp index 7d4f671b9..ecb07f96e 100644 --- a/src/modules/m_cgiirc.cpp +++ b/src/modules/m_cgiirc.cpp @@ -110,7 +110,7 @@ class CommandWebIRC : public SplitCommand this->syntax = "password gateway hostname ip"; } - CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user) CXX11_OVERRIDE + CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE { if (user->registered == REG_ALL) return CMD_FAILURE; diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp index f2da47f1b..cbb32db48 100644 --- a/src/modules/m_check.cpp +++ b/src/modules/m_check.cpp @@ -140,7 +140,7 @@ class CommandCheck : public Command return ret; } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { if (parameters.size() > 1 && parameters[1] != ServerInstance->Config->ServerName) return CMD_SUCCESS; @@ -301,7 +301,7 @@ class CommandCheck : public Command return CMD_SUCCESS; } - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE { if ((parameters.size() > 1) && (parameters[1].find('.') != std::string::npos)) return ROUTE_OPT_UCAST(parameters[1]); diff --git a/src/modules/m_chghost.cpp b/src/modules/m_chghost.cpp index 10e447b45..6e498a8be 100644 --- a/src/modules/m_chghost.cpp +++ b/src/modules/m_chghost.cpp @@ -37,7 +37,7 @@ class CommandChghost : public Command TRANSLATE2(TR_NICK, TR_TEXT); } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { if (parameters[1].length() > ServerInstance->Config->Limits.MaxHost) { @@ -75,7 +75,7 @@ class CommandChghost : public Command return CMD_SUCCESS; } - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE { return ROUTE_OPT_UCAST(parameters[0]); } diff --git a/src/modules/m_chgident.cpp b/src/modules/m_chgident.cpp index f09bef0ab..9a2d3b2ea 100644 --- a/src/modules/m_chgident.cpp +++ b/src/modules/m_chgident.cpp @@ -35,7 +35,7 @@ class CommandChgident : public Command TRANSLATE2(TR_NICK, TR_TEXT); } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { User* dest = ServerInstance->FindNick(parameters[0]); @@ -68,7 +68,7 @@ class CommandChgident : public Command return CMD_SUCCESS; } - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE { return ROUTE_OPT_UCAST(parameters[0]); } diff --git a/src/modules/m_chgname.cpp b/src/modules/m_chgname.cpp index b6c59d36f..fa35732b8 100644 --- a/src/modules/m_chgname.cpp +++ b/src/modules/m_chgname.cpp @@ -33,7 +33,7 @@ class CommandChgname : public Command TRANSLATE2(TR_NICK, TR_TEXT); } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { User* dest = ServerInstance->FindNick(parameters[0]); @@ -64,7 +64,7 @@ class CommandChgname : public Command return CMD_SUCCESS; } - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE { return ROUTE_OPT_UCAST(parameters[0]); } diff --git a/src/modules/m_clearchan.cpp b/src/modules/m_clearchan.cpp index 0c6d52265..016d28737 100644 --- a/src/modules/m_clearchan.cpp +++ b/src/modules/m_clearchan.cpp @@ -35,7 +35,7 @@ class CommandClearChan : public Command force_manual_route = true; } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { Channel* chan = activechan = ServerInstance->FindChan(parameters[0]); if (!chan) @@ -79,7 +79,7 @@ class CommandClearChan : public Command // The idea is that by the time our QUITs reach the next hop, it has already removed all their // clients from the channel, meaning victims on other servers won't see the victims on this // server quitting. - std::vector<std::string> eparams; + CommandBase::Params eparams; eparams.push_back(chan->name); eparams.push_back(method); eparams.push_back(":"); diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp index ad4b958c5..c277759d1 100644 --- a/src/modules/m_cloaking.cpp +++ b/src/modules/m_cloaking.cpp @@ -137,7 +137,7 @@ class CommandCloak : public Command syntax = "<host>"; } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE; + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE; }; class ModuleCloaking : public Module @@ -403,7 +403,7 @@ class ModuleCloaking : public Module } }; -CmdResult CommandCloak::Handle(const std::vector<std::string> ¶meters, User *user) +CmdResult CommandCloak::Handle(User* user, const Params& parameters) { ModuleCloaking* mod = (ModuleCloaking*)(Module*)creator; irc::sockets::sockaddrs sa; diff --git a/src/modules/m_clones.cpp b/src/modules/m_clones.cpp index 7cce32188..68c9639c2 100644 --- a/src/modules/m_clones.cpp +++ b/src/modules/m_clones.cpp @@ -31,7 +31,7 @@ class CommandClones : public Command flags_needed = 'o'; syntax = "<limit>"; } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { std::string clonesstr = "CLONES "; diff --git a/src/modules/m_close.cpp b/src/modules/m_close.cpp index 8ef93830d..b0b45b4b6 100644 --- a/src/modules/m_close.cpp +++ b/src/modules/m_close.cpp @@ -31,7 +31,7 @@ class CommandClose : public Command flags_needed = 'o'; } - CmdResult Handle(const std::vector<std::string>& parameters, User* src) CXX11_OVERRIDE + CmdResult Handle(User* src, const Params& parameters) CXX11_OVERRIDE { std::map<std::string,int> closed; diff --git a/src/modules/m_conn_umodes.cpp b/src/modules/m_conn_umodes.cpp index c439f3bfe..1f2fe7455 100644 --- a/src/modules/m_conn_umodes.cpp +++ b/src/modules/m_conn_umodes.cpp @@ -49,7 +49,7 @@ class ModuleModesOnConnect : public Module std::string buf; irc::spacesepstream ss(ThisModes); - std::vector<std::string> modes; + CommandBase::Params modes; modes.push_back(user->nick); // split ThisUserModes into modes and mode params diff --git a/src/modules/m_conn_waitpong.cpp b/src/modules/m_conn_waitpong.cpp index 87b6b51f2..f9e9262a7 100644 --- a/src/modules/m_conn_waitpong.cpp +++ b/src/modules/m_conn_waitpong.cpp @@ -56,7 +56,7 @@ class ModuleWaitPong : public Module return MOD_RES_PASSTHRU; } - ModResult OnPreCommand(std::string &command, std::vector<std::string> ¶meters, LocalUser* user, bool validated, const std::string &original_line) CXX11_OVERRIDE + ModResult OnPreCommand(std::string& command, CommandBase::Params& parameters, LocalUser* user, bool validated, const std::string& original_line) CXX11_OVERRIDE { if (command == "PONG") { diff --git a/src/modules/m_customtitle.cpp b/src/modules/m_customtitle.cpp index ea07ba7d0..c16b1eda2 100644 --- a/src/modules/m_customtitle.cpp +++ b/src/modules/m_customtitle.cpp @@ -40,7 +40,7 @@ class CommandTitle : public Command syntax = "<user> <password>"; } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { const std::string userHost = user->ident + "@" + user->GetRealHost(); const std::string userIP = user->ident + "@" + user->GetIPString(); diff --git a/src/modules/m_cycle.cpp b/src/modules/m_cycle.cpp index 1028fa977..3ead72a45 100644 --- a/src/modules/m_cycle.cpp +++ b/src/modules/m_cycle.cpp @@ -31,7 +31,7 @@ class CommandCycle : public SplitCommand Penalty = 3; syntax = "<channel> :[reason]"; } - CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user) CXX11_OVERRIDE + CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE { Channel* channel = ServerInstance->FindChan(parameters[0]); std::string reason = "Cycling"; diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp index 647f69e7a..04f85739a 100644 --- a/src/modules/m_dccallow.cpp +++ b/src/modules/m_dccallow.cpp @@ -114,7 +114,7 @@ class CommandDccallow : public Command /* XXX we need to fix this so it can work with translation stuff (i.e. move +- into a seperate param */ } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { /* syntax: DCCALLOW [+|-]<nick> (<time>) */ if (!parameters.size()) @@ -252,7 +252,7 @@ class CommandDccallow : public Command return CMD_FAILURE; } - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE { return ROUTE_BROADCAST; } diff --git a/src/modules/m_filter.cpp b/src/modules/m_filter.cpp index 0d0b7ae60..343a62a8d 100644 --- a/src/modules/m_filter.cpp +++ b/src/modules/m_filter.cpp @@ -153,9 +153,9 @@ class CommandFilter : public Command flags_needed = 'o'; this->syntax = "<filter-definition> <action> <flags> [<duration>] :<reason>"; } - CmdResult Handle(const std::vector<std::string>& , User* ) CXX11_OVERRIDE; + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE; - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE { return ROUTE_BROADCAST; } @@ -196,7 +196,7 @@ class ModuleFilter : public Module, public ServerEventListener, public Stats::Ev void OnSyncNetwork(ProtocolInterface::Server& server) CXX11_OVERRIDE; void OnDecodeMetaData(Extensible* target, const std::string &extname, const std::string &extdata) CXX11_OVERRIDE; ModResult OnStats(Stats::Context& stats) CXX11_OVERRIDE; - ModResult OnPreCommand(std::string &command, std::vector<std::string> ¶meters, LocalUser *user, bool validated, const std::string &original_line) CXX11_OVERRIDE; + ModResult OnPreCommand(std::string& command, CommandBase::Params& parameters, LocalUser* user, bool validated, const std::string& original_line) CXX11_OVERRIDE; void OnUnloadModule(Module* mod) CXX11_OVERRIDE; bool AppliesToMe(User* user, FilterResult* filter, int flags); void ReadFilters(); @@ -204,7 +204,7 @@ class ModuleFilter : public Module, public ServerEventListener, public Stats::Ev static std::string FilterActionToString(FilterAction fa); }; -CmdResult CommandFilter::Handle(const std::vector<std::string> ¶meters, User *user) +CmdResult CommandFilter::Handle(User* user, const Params& parameters) { if (parameters.size() == 1) { @@ -413,7 +413,7 @@ ModResult ModuleFilter::OnUserPreMessage(User* user, const MessageTarget& msgtar return MOD_RES_PASSTHRU; } -ModResult ModuleFilter::OnPreCommand(std::string &command, std::vector<std::string> ¶meters, LocalUser *user, bool validated, const std::string &original_line) +ModResult ModuleFilter::OnPreCommand(std::string& command, CommandBase::Params& parameters, LocalUser* user, bool validated, const std::string& original_line) { if (validated) { diff --git a/src/modules/m_globalload.cpp b/src/modules/m_globalload.cpp index 1de0aea8b..c0ce025bd 100644 --- a/src/modules/m_globalload.cpp +++ b/src/modules/m_globalload.cpp @@ -35,7 +35,7 @@ class CommandGloadmodule : public Command syntax = "<modulename> [servermask]"; } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { std::string servername = parameters.size() > 1 ? parameters[1] : "*"; @@ -57,7 +57,7 @@ class CommandGloadmodule : public Command return CMD_SUCCESS; } - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE { return ROUTE_BROADCAST; } @@ -74,7 +74,7 @@ class CommandGunloadmodule : public Command syntax = "<modulename> [servermask]"; } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { if (!ServerInstance->Config->ConfValue("security")->getBool("allowcoreunload") && InspIRCd::Match(parameters[0], "core_*.so", ascii_case_insensitive_map)) @@ -109,7 +109,7 @@ class CommandGunloadmodule : public Command return CMD_SUCCESS; } - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE { return ROUTE_BROADCAST; } @@ -125,7 +125,7 @@ class CommandGreloadmodule : public Command flags_needed = 'o'; syntax = "<modulename> [servermask]"; } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { std::string servername = parameters.size() > 1 ? parameters[1] : "*"; @@ -149,7 +149,7 @@ class CommandGreloadmodule : public Command return CMD_SUCCESS; } - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE { return ROUTE_BROADCAST; } diff --git a/src/modules/m_globops.cpp b/src/modules/m_globops.cpp index 1fe911e80..b98adce35 100644 --- a/src/modules/m_globops.cpp +++ b/src/modules/m_globops.cpp @@ -33,7 +33,7 @@ class CommandGlobops : public Command flags_needed = 'o'; syntax = "<any-text>"; } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { ServerInstance->SNO->WriteGlobalSno('g', "From " + user->nick + ": " + parameters[0]); return CMD_SUCCESS; diff --git a/src/modules/m_helpop.cpp b/src/modules/m_helpop.cpp index 8d129e8f5..f88298576 100644 --- a/src/modules/m_helpop.cpp +++ b/src/modules/m_helpop.cpp @@ -57,7 +57,7 @@ class CommandHelpop : public Command syntax = "<any-text>"; } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { const std::string& parameter = (!parameters.empty() ? parameters[0] : startkey); diff --git a/src/modules/m_jumpserver.cpp b/src/modules/m_jumpserver.cpp index e54d1efb2..9f3b41af7 100644 --- a/src/modules/m_jumpserver.cpp +++ b/src/modules/m_jumpserver.cpp @@ -48,7 +48,7 @@ class CommandJumpserver : public Command redirect_new_users = false; } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { int n_done = 0; reason = (parameters.size() < 4) ? "Please use this server/port instead" : parameters[3]; diff --git a/src/modules/m_knock.cpp b/src/modules/m_knock.cpp index 66abda851..a0a8455a8 100644 --- a/src/modules/m_knock.cpp +++ b/src/modules/m_knock.cpp @@ -50,7 +50,7 @@ class CommandKnock : public Command Penalty = 5; } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { Channel* c = ServerInstance->FindChan(parameters[0]); if (!c) @@ -87,7 +87,7 @@ class CommandKnock : public Command return CMD_SUCCESS; } - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE { return ROUTE_OPT_BCAST; } diff --git a/src/modules/m_ldapoper.cpp b/src/modules/m_ldapoper.cpp index 45e83333a..104c3bb21 100644 --- a/src/modules/m_ldapoper.cpp +++ b/src/modules/m_ldapoper.cpp @@ -45,10 +45,10 @@ class LDAPOperBase : public LDAPInterface if (!oper_command) return; - std::vector<std::string> params; + CommandBase::Params params; params.push_back(opername); params.push_back(password); - oper_command->Handle(params, user); + oper_command->Handle(user, params); } void Fallback() @@ -201,7 +201,7 @@ class ModuleLDAPAuth : public Module attribute = tag->getString("attribute"); } - ModResult OnPreCommand(std::string& command, std::vector<std::string>& parameters, LocalUser* user, bool validated, const std::string& original_line) CXX11_OVERRIDE + ModResult OnPreCommand(std::string& command, CommandBase::Params& parameters, LocalUser* user, bool validated, const std::string& original_line) CXX11_OVERRIDE { if (validated && command == "OPER" && parameters.size() >= 2) { diff --git a/src/modules/m_lockserv.cpp b/src/modules/m_lockserv.cpp index 48d9801ee..45a0095d7 100644 --- a/src/modules/m_lockserv.cpp +++ b/src/modules/m_lockserv.cpp @@ -42,7 +42,7 @@ class CommandLockserv : public Command flags_needed = 'o'; } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { if (!locked.empty()) { @@ -67,7 +67,7 @@ class CommandUnlockserv : public Command flags_needed = 'o'; } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { if (locked.empty()) { diff --git a/src/modules/m_maphide.cpp b/src/modules/m_maphide.cpp index 41de2997d..7c5f6b97b 100644 --- a/src/modules/m_maphide.cpp +++ b/src/modules/m_maphide.cpp @@ -28,7 +28,7 @@ class ModuleMapHide : public Module url = ServerInstance->Config->ConfValue("security")->getString("maphide"); } - ModResult OnPreCommand(std::string &command, std::vector<std::string> ¶meters, LocalUser *user, bool validated, const std::string &original_line) CXX11_OVERRIDE + ModResult OnPreCommand(std::string& command, CommandBase::Params& parameters, LocalUser* user, bool validated, const std::string& original_line) CXX11_OVERRIDE { if (validated && !user->IsOper() && !url.empty() && (command == "MAP" || command == "LINKS")) { diff --git a/src/modules/m_modenotice.cpp b/src/modules/m_modenotice.cpp index 3d12f98d1..5311015b7 100644 --- a/src/modules/m_modenotice.cpp +++ b/src/modules/m_modenotice.cpp @@ -28,7 +28,7 @@ class CommandModeNotice : public Command flags_needed = 'o'; } - CmdResult Handle(const std::vector<std::string>& parameters, User* src) CXX11_OVERRIDE + CmdResult Handle(User* src, const Params& parameters) CXX11_OVERRIDE { std::string msg = "*** From " + src->nick + ": " + parameters[1]; int mlen = parameters[0].length(); @@ -47,7 +47,7 @@ next_user: ; return CMD_SUCCESS; } - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE { return ROUTE_OPT_BCAST; } diff --git a/src/modules/m_monitor.cpp b/src/modules/m_monitor.cpp index 75fa11cf0..38e7ccc3e 100644 --- a/src/modules/m_monitor.cpp +++ b/src/modules/m_monitor.cpp @@ -319,7 +319,7 @@ class CommandMonitor : public SplitCommand syntax = "[C|L|S|+ <nick1>[,<nick2>]|- <nick1>[,<nick2>]"; } - CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user) CXX11_OVERRIDE + CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE { char subcmd = toupper(parameters[0][0]); if (subcmd == '+') diff --git a/src/modules/m_namedmodes.cpp b/src/modules/m_namedmodes.cpp index 73c5cb521..8872ba629 100644 --- a/src/modules/m_namedmodes.cpp +++ b/src/modules/m_namedmodes.cpp @@ -59,7 +59,7 @@ class CommandProp : public SplitCommand syntax = "<user|channel> {[+-]<mode> [<value>]}*"; } - CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* src) CXX11_OVERRIDE + CmdResult HandleLocal(LocalUser* src, const Params& parameters) CXX11_OVERRIDE { Channel* const chan = ServerInstance->FindChan(parameters[0]); if (!chan) diff --git a/src/modules/m_namesx.cpp b/src/modules/m_namesx.cpp index beac968ef..98fac8872 100644 --- a/src/modules/m_namesx.cpp +++ b/src/modules/m_namesx.cpp @@ -41,7 +41,7 @@ class ModuleNamesX : public Module tokens["NAMESX"]; } - ModResult OnPreCommand(std::string &command, std::vector<std::string> ¶meters, LocalUser *user, bool validated, const std::string &original_line) CXX11_OVERRIDE + ModResult OnPreCommand(std::string& command, CommandBase::Params& parameters, LocalUser* user, bool validated, const std::string& original_line) CXX11_OVERRIDE { /* We don't actually create a proper command handler class for PROTOCTL, * because other modules might want to have PROTOCTL hooks too. diff --git a/src/modules/m_nicklock.cpp b/src/modules/m_nicklock.cpp index afdb0b1dc..964ed9780 100644 --- a/src/modules/m_nicklock.cpp +++ b/src/modules/m_nicklock.cpp @@ -44,7 +44,7 @@ class CommandNicklock : public Command TRANSLATE2(TR_NICK, TR_TEXT); } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { User* target = ServerInstance->FindNick(parameters[0]); @@ -84,7 +84,7 @@ class CommandNicklock : public Command return CMD_SUCCESS; } - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE { return ROUTE_OPT_UCAST(parameters[0]); } @@ -104,7 +104,7 @@ class CommandNickunlock : public Command TRANSLATE1(TR_NICK); } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { User* target = ServerInstance->FindNick(parameters[0]); @@ -131,7 +131,7 @@ class CommandNickunlock : public Command return CMD_SUCCESS; } - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE { return ROUTE_OPT_UCAST(parameters[0]); } diff --git a/src/modules/m_ojoin.cpp b/src/modules/m_ojoin.cpp index 2752a6ea8..67b79e07c 100644 --- a/src/modules/m_ojoin.cpp +++ b/src/modules/m_ojoin.cpp @@ -38,7 +38,7 @@ class CommandOjoin : public SplitCommand active = false; } - CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user) CXX11_OVERRIDE + CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE { // Make sure the channel name is allowable. if (!ServerInstance->IsChannel(parameters[0])) diff --git a/src/modules/m_operlog.cpp b/src/modules/m_operlog.cpp index 68f50bf6d..49d816fa9 100644 --- a/src/modules/m_operlog.cpp +++ b/src/modules/m_operlog.cpp @@ -41,7 +41,7 @@ class ModuleOperLog : public Module tosnomask = ServerInstance->Config->ConfValue("operlog")->getBool("tosnomask", false); } - ModResult OnPreCommand(std::string &command, std::vector<std::string> ¶meters, LocalUser *user, bool validated, const std::string &original_line) CXX11_OVERRIDE + ModResult OnPreCommand(std::string& command, CommandBase::Params& parameters, LocalUser* user, bool validated, const std::string& original_line) CXX11_OVERRIDE { /* If the command doesnt appear to be valid, we dont want to mess with it. */ if (!validated) diff --git a/src/modules/m_opermodes.cpp b/src/modules/m_opermodes.cpp index 6a18e9c9d..475d561ba 100644 --- a/src/modules/m_opermodes.cpp +++ b/src/modules/m_opermodes.cpp @@ -53,7 +53,7 @@ class ModuleModesOnOper : public Module std::string buf; irc::spacesepstream ss(smodes); - std::vector<std::string> modes; + CommandBase::Params modes; modes.push_back(u->nick); // split into modes and mode params diff --git a/src/modules/m_opermotd.cpp b/src/modules/m_opermotd.cpp index 6884cd447..49409a1c0 100644 --- a/src/modules/m_opermotd.cpp +++ b/src/modules/m_opermotd.cpp @@ -34,14 +34,14 @@ class CommandOpermotd : public Command flags_needed = 'o'; syntax = "[<servername>]"; } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { if ((parameters.empty()) || (parameters[0] == ServerInstance->Config->ServerName)) ShowOperMOTD(user); return CMD_SUCCESS; } - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE { if ((!parameters.empty()) && (parameters[0].find('.') != std::string::npos)) return ROUTE_OPT_UCAST(parameters[0]); diff --git a/src/modules/m_password_hash.cpp b/src/modules/m_password_hash.cpp index b092a37f4..137ddb96c 100644 --- a/src/modules/m_password_hash.cpp +++ b/src/modules/m_password_hash.cpp @@ -32,7 +32,7 @@ class CommandMkpasswd : public Command Penalty = 5; } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { if (!parameters[0].compare(0, 5, "hmac-", 5)) { diff --git a/src/modules/m_remove.cpp b/src/modules/m_remove.cpp index 35b7fbf03..d68a70503 100644 --- a/src/modules/m_remove.cpp +++ b/src/modules/m_remove.cpp @@ -47,7 +47,7 @@ class RemoveBase : public Command { } - CmdResult HandleRMB(const std::vector<std::string>& parameters, User *user, bool fpart) + CmdResult HandleRMB(User* user, const CommandBase::Params& parameters, bool fpart) { User* target; Channel* channel; @@ -102,7 +102,7 @@ class RemoveBase : public Command { /* We'll let everyone remove their level and below, eg: * ops can remove ops, halfops, voices, and those with no mode (no moders actually are set to 1) - * a ulined target will get a higher level than it's possible for a /remover to get..so they're safe. + a ulined target will get a higher level than it's possible for a /remover to get..so they're safe. * Nobody may remove people with >= protectedrank rank. */ unsigned int ulevel = channel->GetPrefixValue(user); @@ -114,7 +114,7 @@ class RemoveBase : public Command { // Send an ENCAP REMOVE with parameters being in the old <user> <chan> order which is // compatible with both 2.0 and 3.0. This also turns FPART into REMOVE. - std::vector<std::string> p; + CommandBase::Params p; p.push_back(target->uuid); p.push_back(channel->name); if (parameters.size() > 2) @@ -169,9 +169,9 @@ class CommandRemove : public RemoveBase TRANSLATE3(TR_NICK, TR_TEXT, TR_TEXT); } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { - return HandleRMB(parameters, user, false); + return HandleRMB(user, parameters, false); } }; @@ -187,9 +187,9 @@ class CommandFpart : public RemoveBase TRANSLATE3(TR_TEXT, TR_NICK, TR_TEXT); } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { - return HandleRMB(parameters, user, true); + return HandleRMB(user, parameters, true); } }; diff --git a/src/modules/m_rline.cpp b/src/modules/m_rline.cpp index e3a84397f..64228caf7 100644 --- a/src/modules/m_rline.cpp +++ b/src/modules/m_rline.cpp @@ -140,7 +140,7 @@ class CommandRLine : public Command flags_needed = 'o'; this->syntax = "<regex> [<rline-duration>] :<reason>"; } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { if (parameters.size() >= 3) @@ -198,7 +198,7 @@ class CommandRLine : public Command return CMD_SUCCESS; } - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE { if (IS_LOCAL(user)) return ROUTE_LOCALONLY; // spanningtree will send ADDLINE diff --git a/src/modules/m_rmode.cpp b/src/modules/m_rmode.cpp index dbe69eca1..ce28630b4 100644 --- a/src/modules/m_rmode.cpp +++ b/src/modules/m_rmode.cpp @@ -31,7 +31,7 @@ class CommandRMode : public Command syntax = "<channel> <mode> [pattern]"; } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { ModeHandler* mh; Channel* chan = ServerInstance->FindChan(parameters[0]); diff --git a/src/modules/m_sajoin.cpp b/src/modules/m_sajoin.cpp index 0af2e1e3e..9aa8837e0 100644 --- a/src/modules/m_sajoin.cpp +++ b/src/modules/m_sajoin.cpp @@ -33,7 +33,7 @@ class CommandSajoin : public Command TRANSLATE2(TR_NICK, TR_TEXT); } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { const unsigned int channelindex = (parameters.size() > 1) ? 1 : 0; if (CommandParser::LoopCall(user, this, parameters, channelindex)) @@ -101,7 +101,7 @@ class CommandSajoin : public Command } } - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE { return ROUTE_OPT_UCAST(parameters[0]); } diff --git a/src/modules/m_sakick.cpp b/src/modules/m_sakick.cpp index 93b1c3912..6a9e11fe7 100644 --- a/src/modules/m_sakick.cpp +++ b/src/modules/m_sakick.cpp @@ -31,7 +31,7 @@ class CommandSakick : public Command TRANSLATE3(TR_TEXT, TR_NICK, TR_TEXT); } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { User* dest = ServerInstance->FindNick(parameters[1]); Channel* channel = ServerInstance->FindChan(parameters[0]); @@ -73,7 +73,7 @@ class CommandSakick : public Command return CMD_FAILURE; } - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE { return ROUTE_OPT_UCAST(parameters[1]); } diff --git a/src/modules/m_samode.cpp b/src/modules/m_samode.cpp index 5c3d59edb..e4b102b92 100644 --- a/src/modules/m_samode.cpp +++ b/src/modules/m_samode.cpp @@ -35,7 +35,7 @@ class CommandSamode : public Command active = false; } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { if (parameters[0].c_str()[0] != '#') { diff --git a/src/modules/m_sanick.cpp b/src/modules/m_sanick.cpp index a6bb4db4c..4744ca1de 100644 --- a/src/modules/m_sanick.cpp +++ b/src/modules/m_sanick.cpp @@ -33,7 +33,7 @@ class CommandSanick : public Command TRANSLATE2(TR_NICK, TR_TEXT); } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { User* target = ServerInstance->FindNick(parameters[0]); @@ -77,7 +77,7 @@ class CommandSanick : public Command return CMD_SUCCESS; } - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE { return ROUTE_OPT_UCAST(parameters[0]); } diff --git a/src/modules/m_sapart.cpp b/src/modules/m_sapart.cpp index bdc78142b..0cd82fa15 100644 --- a/src/modules/m_sapart.cpp +++ b/src/modules/m_sapart.cpp @@ -32,7 +32,7 @@ class CommandSapart : public Command TRANSLATE3(TR_NICK, TR_TEXT, TR_TEXT); } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { if (CommandParser::LoopCall(user, this, parameters, 1)) return CMD_FAILURE; @@ -78,7 +78,7 @@ class CommandSapart : public Command return CMD_FAILURE; } - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE { return ROUTE_OPT_UCAST(parameters[0]); } diff --git a/src/modules/m_saquit.cpp b/src/modules/m_saquit.cpp index 6e8ab6069..9034016d2 100644 --- a/src/modules/m_saquit.cpp +++ b/src/modules/m_saquit.cpp @@ -32,7 +32,7 @@ class CommandSaquit : public Command TRANSLATE2(TR_NICK, TR_TEXT); } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { User* dest = ServerInstance->FindNick(parameters[0]); if ((dest) && (dest->registered == REG_ALL)) @@ -59,7 +59,7 @@ class CommandSaquit : public Command } } - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE { return ROUTE_OPT_UCAST(parameters[0]); } diff --git a/src/modules/m_sasl.cpp b/src/modules/m_sasl.cpp index 2fc0725a9..d37e1c90f 100644 --- a/src/modules/m_sasl.cpp +++ b/src/modules/m_sasl.cpp @@ -143,9 +143,9 @@ enum SaslResult { SASL_OK, SASL_FAIL, SASL_ABORT }; static Events::ModuleEventProvider* saslevprov; -static void SendSASL(LocalUser* user, const std::string& agent, char mode, const parameterlist& parameters) +static void SendSASL(LocalUser* user, const std::string& agent, char mode, const std::vector<std::string>& parameters) { - parameterlist params(parameters.size() + 3); + CommandBase::Params params(parameters.size() + 3); params.push_back(user->uuid); params.push_back(agent); params.push_back(ConvToStr(mode)); @@ -171,7 +171,7 @@ class SaslAuthenticator void SendHostIP() { - parameterlist params; + std::vector<std::string> params; params.push_back(user->GetRealHost()); params.push_back(user->GetIPString()); params.push_back(SSLIOHook::IsSSL(&user->eh) ? "S" : "P"); @@ -185,7 +185,7 @@ class SaslAuthenticator { SendHostIP(); - parameterlist params; + std::vector<std::string> params; params.push_back(method); const std::string fp = SSLClientCert::GetFingerprint(&user->eh); @@ -207,7 +207,7 @@ class SaslAuthenticator } /* checks for and deals with a state change. */ - SaslState ProcessInboundMessage(const std::vector<std::string> &msg) + SaslState ProcessInboundMessage(const CommandBase::Params& msg) { switch (this->state) { @@ -304,7 +304,7 @@ class CommandAuthenticate : public SplitCommand allow_empty_last_param = false; } - CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user) CXX11_OVERRIDE + CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE { { if (!cap.get(user)) @@ -341,7 +341,7 @@ class CommandSASL : public Command this->flags_needed = FLAG_SERVERONLY; // should not be called by users } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { User* target = ServerInstance->FindUUID(parameters[1]); if (!target) @@ -363,7 +363,7 @@ class CommandSASL : public Command return CMD_SUCCESS; } - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE { return ROUTE_BROADCAST; } diff --git a/src/modules/m_satopic.cpp b/src/modules/m_satopic.cpp index 8fe96bcf9..8c8629221 100644 --- a/src/modules/m_satopic.cpp +++ b/src/modules/m_satopic.cpp @@ -29,7 +29,7 @@ class CommandSATopic : public Command flags_needed = 'o'; syntax = "<target> <topic>"; } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { /* * Handles a SATOPIC request. Notifies all +s users. diff --git a/src/modules/m_securelist.cpp b/src/modules/m_securelist.cpp index f7431f1f2..b1aeeb9d4 100644 --- a/src/modules/m_securelist.cpp +++ b/src/modules/m_securelist.cpp @@ -52,7 +52,7 @@ class ModuleSecureList : public Module * OnPreCommand() * Intercept the LIST command. */ - ModResult OnPreCommand(std::string &command, std::vector<std::string> ¶meters, LocalUser *user, bool validated, const std::string &original_line) CXX11_OVERRIDE + ModResult OnPreCommand(std::string& command, CommandBase::Params& parameters, LocalUser* user, bool validated, const std::string& original_line) CXX11_OVERRIDE { /* If the command doesnt appear to be valid, we dont want to mess with it. */ if (!validated) diff --git a/src/modules/m_sethost.cpp b/src/modules/m_sethost.cpp index 678d9d979..87eed4022 100644 --- a/src/modules/m_sethost.cpp +++ b/src/modules/m_sethost.cpp @@ -35,7 +35,7 @@ class CommandSethost : public Command flags_needed = 'o'; syntax = "<new-hostname>"; } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { if (parameters[0].length() > ServerInstance->Config->Limits.MaxHost) { diff --git a/src/modules/m_setident.cpp b/src/modules/m_setident.cpp index beb7611ab..11ce8f015 100644 --- a/src/modules/m_setident.cpp +++ b/src/modules/m_setident.cpp @@ -33,7 +33,7 @@ class CommandSetident : public Command flags_needed = 'o'; syntax = "<new-ident>"; } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { if (parameters[0].size() > ServerInstance->Config->Limits.IdentMax) { diff --git a/src/modules/m_setidle.cpp b/src/modules/m_setidle.cpp index 0f224e9e9..37984030b 100644 --- a/src/modules/m_setidle.cpp +++ b/src/modules/m_setidle.cpp @@ -38,7 +38,7 @@ class CommandSetidle : public SplitCommand flags_needed = 'o'; syntax = "<duration>"; } - CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user) CXX11_OVERRIDE + CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE { int idle = InspIRCd::Duration(parameters[0]); if (idle < 1) diff --git a/src/modules/m_setname.cpp b/src/modules/m_setname.cpp index b8efd98aa..3bede1ad2 100644 --- a/src/modules/m_setname.cpp +++ b/src/modules/m_setname.cpp @@ -32,7 +32,7 @@ class CommandSetname : public Command syntax = "<newname>"; } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { if (parameters[0].size() > ServerInstance->Config->Limits.MaxGecos) { diff --git a/src/modules/m_showfile.cpp b/src/modules/m_showfile.cpp index 83030b7a1..565aaf78b 100644 --- a/src/modules/m_showfile.cpp +++ b/src/modules/m_showfile.cpp @@ -51,7 +51,7 @@ class CommandShowFile : public Command { } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { if (method == SF_NUMERIC) { diff --git a/src/modules/m_showwhois.cpp b/src/modules/m_showwhois.cpp index ab60dbddb..d01e1a83b 100644 --- a/src/modules/m_showwhois.cpp +++ b/src/modules/m_showwhois.cpp @@ -55,7 +55,7 @@ class WhoisNoticeCmd : public Command ") did a /whois on you"); } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { User* dest = ServerInstance->FindNick(parameters[0]); if (!dest) @@ -114,7 +114,7 @@ class ModuleShowwhois : public Module, public Whois::EventListener } else { - std::vector<std::string> params; + CommandBase::Params params; params.push_back(dest->uuid); params.push_back(source->uuid); ServerInstance->PI->SendEncapsulatedData(dest->server->GetName(), cmd.name, params); diff --git a/src/modules/m_shun.cpp b/src/modules/m_shun.cpp index 3e378a74c..267e15ad7 100644 --- a/src/modules/m_shun.cpp +++ b/src/modules/m_shun.cpp @@ -56,7 +56,7 @@ class CommandShun : public Command flags_needed = 'o'; this->syntax = "<nick!user@hostmask> [<shun-duration>] :<reason>"; } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { /* syntax: SHUN nick!user@host time :reason goes here */ /* 'time' is a human-readable timestring, like 2d3h2s. */ @@ -125,7 +125,7 @@ class CommandShun : public Command return CMD_SUCCESS; } - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE { if (IS_LOCAL(user)) return ROUTE_LOCALONLY; // spanningtree will send ADDLINE @@ -198,7 +198,7 @@ class ModuleShun : public Module, public Stats::EventListener affectopers = tag->getBool("affectopers", false); } - ModResult OnPreCommand(std::string &command, std::vector<std::string>& parameters, LocalUser* user, bool validated, const std::string &original_line) CXX11_OVERRIDE + ModResult OnPreCommand(std::string& command, CommandBase::Params& parameters, LocalUser* user, bool validated, const std::string& original_line) CXX11_OVERRIDE { if (validated) return MOD_RES_PASSTHRU; diff --git a/src/modules/m_silence.cpp b/src/modules/m_silence.cpp index e60694470..165e083bb 100644 --- a/src/modules/m_silence.cpp +++ b/src/modules/m_silence.cpp @@ -78,7 +78,7 @@ class CommandSVSSilence : public Command TRANSLATE3(TR_NICK, TR_TEXT, TR_TEXT); } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { /* * XXX: thought occurs to me @@ -96,13 +96,14 @@ class CommandSVSSilence : public Command if (IS_LOCAL(u)) { - ServerInstance->Parser.CallHandler("SILENCE", std::vector<std::string>(parameters.begin() + 1, parameters.end()), u); + CommandBase::Params params(parameters.begin() + 1, parameters.end()); + ServerInstance->Parser.CallHandler("SILENCE", params, u); } return CMD_SUCCESS; } - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE { return ROUTE_OPT_UCAST(parameters[0]); } @@ -121,7 +122,7 @@ class CommandSilence : public Command syntax = "{[+|-]<mask> <p|c|i|n|t|a|x>}"; } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { if (parameters.empty()) { diff --git a/src/modules/m_spanningtree/addline.cpp b/src/modules/m_spanningtree/addline.cpp index 1bf847604..cd11b8d58 100644 --- a/src/modules/m_spanningtree/addline.cpp +++ b/src/modules/m_spanningtree/addline.cpp @@ -24,7 +24,7 @@ #include "utils.h" #include "commands.h" -CmdResult CommandAddLine::Handle(User* usr, std::vector<std::string>& params) +CmdResult CommandAddLine::Handle(User* usr, Params& params) { XLineFactory* xlf = ServerInstance->XLines->GetFactory(params[0]); const std::string& setter = usr->nick; diff --git a/src/modules/m_spanningtree/away.cpp b/src/modules/m_spanningtree/away.cpp index 28cbf8f73..e65b3099b 100644 --- a/src/modules/m_spanningtree/away.cpp +++ b/src/modules/m_spanningtree/away.cpp @@ -23,7 +23,7 @@ #include "utils.h" #include "commands.h" -CmdResult CommandAway::HandleRemote(::RemoteUser* u, std::vector<std::string>& params) +CmdResult CommandAway::HandleRemote(::RemoteUser* u, Params& params) { if (!params.empty()) { diff --git a/src/modules/m_spanningtree/capab.cpp b/src/modules/m_spanningtree/capab.cpp index 7f9f9edb7..79019b668 100644 --- a/src/modules/m_spanningtree/capab.cpp +++ b/src/modules/m_spanningtree/capab.cpp @@ -221,7 +221,7 @@ void TreeSocket::ListDifference(const std::string &one, const std::string &two, } } -bool TreeSocket::Capab(const parameterlist ¶ms) +bool TreeSocket::Capab(const CommandBase::Params& params) { if (params.size() < 1) { diff --git a/src/modules/m_spanningtree/commands.h b/src/modules/m_spanningtree/commands.h index 05fafd1a7..b98512578 100644 --- a/src/modules/m_spanningtree/commands.h +++ b/src/modules/m_spanningtree/commands.h @@ -44,55 +44,55 @@ class CommandRConnect : public Command { public: CommandRConnect(Module* Creator); - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE; - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE; + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE; + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE; }; class CommandRSQuit : public Command { public: CommandRSQuit(Module* Creator); - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE; - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE; + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE; + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE; }; class CommandMap : public Command { public: CommandMap(Module* Creator); - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE; - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE; + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE; + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE; }; class CommandSVSJoin : public ServerCommand { public: CommandSVSJoin(Module* Creator) : ServerCommand(Creator, "SVSJOIN", 2) { } - CmdResult Handle(User* user, std::vector<std::string>& params) CXX11_OVERRIDE; - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE; + CmdResult Handle(User* user, Params& params) CXX11_OVERRIDE; + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE; }; class CommandSVSPart : public ServerCommand { public: CommandSVSPart(Module* Creator) : ServerCommand(Creator, "SVSPART", 2) { } - CmdResult Handle(User* user, std::vector<std::string>& params) CXX11_OVERRIDE; - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE; + CmdResult Handle(User* user, Params& params) CXX11_OVERRIDE; + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE; }; class CommandSVSNick : public ServerCommand { public: CommandSVSNick(Module* Creator) : ServerCommand(Creator, "SVSNICK", 3) { } - CmdResult Handle(User* user, std::vector<std::string>& params) CXX11_OVERRIDE; - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE; + CmdResult Handle(User* user, Params& params) CXX11_OVERRIDE; + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE; }; class CommandMetadata : public ServerCommand { public: CommandMetadata(Module* Creator) : ServerCommand(Creator, "METADATA", 2) { } - CmdResult Handle(User* user, std::vector<std::string>& params) CXX11_OVERRIDE; + CmdResult Handle(User* user, Params& params) CXX11_OVERRIDE; class Builder : public CmdBuilder { @@ -107,7 +107,7 @@ class CommandUID : public ServerOnlyServerCommand<CommandUID> { public: CommandUID(Module* Creator) : ServerOnlyServerCommand<CommandUID>(Creator, "UID", 10) { } - CmdResult HandleServer(TreeServer* server, std::vector<std::string>& params); + CmdResult HandleServer(TreeServer* server, CommandBase::Params& params); class Builder : public CmdBuilder { @@ -120,7 +120,7 @@ class CommandOpertype : public UserOnlyServerCommand<CommandOpertype> { public: CommandOpertype(Module* Creator) : UserOnlyServerCommand<CommandOpertype>(Creator, "OPERTYPE", 1) { } - CmdResult HandleRemote(RemoteUser* user, std::vector<std::string>& params); + CmdResult HandleRemote(RemoteUser* user, Params& params); class Builder : public CmdBuilder { @@ -149,8 +149,8 @@ class CommandFJoin : public ServerCommand void ProcessModeUUIDPair(const std::string& item, TreeServer* sourceserver, Channel* chan, Modes::ChangeList* modechangelist, FwdFJoinBuilder& fwdfjoin); public: CommandFJoin(Module* Creator) : ServerCommand(Creator, "FJOIN", 3) { } - CmdResult Handle(User* user, std::vector<std::string>& params) CXX11_OVERRIDE; - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE { return ROUTE_LOCALONLY; } + CmdResult Handle(User* user, Params& params) CXX11_OVERRIDE; + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE { return ROUTE_LOCALONLY; } class Builder : public CmdBuilder { @@ -186,14 +186,14 @@ class CommandFMode : public ServerCommand { public: CommandFMode(Module* Creator) : ServerCommand(Creator, "FMODE", 3) { } - CmdResult Handle(User* user, std::vector<std::string>& params) CXX11_OVERRIDE; + CmdResult Handle(User* user, Params& params) CXX11_OVERRIDE; }; class CommandFTopic : public ServerCommand { public: CommandFTopic(Module* Creator) : ServerCommand(Creator, "FTOPIC", 4, 5) { } - CmdResult Handle(User* user, std::vector<std::string>& params) CXX11_OVERRIDE; + CmdResult Handle(User* user, Params& params) CXX11_OVERRIDE; class Builder : public CmdBuilder { @@ -207,43 +207,43 @@ class CommandFHost : public UserOnlyServerCommand<CommandFHost> { public: CommandFHost(Module* Creator) : UserOnlyServerCommand<CommandFHost>(Creator, "FHOST", 1) { } - CmdResult HandleRemote(RemoteUser* user, std::vector<std::string>& params); + CmdResult HandleRemote(RemoteUser* user, Params& params); }; class CommandFIdent : public UserOnlyServerCommand<CommandFIdent> { public: CommandFIdent(Module* Creator) : UserOnlyServerCommand<CommandFIdent>(Creator, "FIDENT", 1) { } - CmdResult HandleRemote(RemoteUser* user, std::vector<std::string>& params); + CmdResult HandleRemote(RemoteUser* user, Params& params); }; class CommandFName : public UserOnlyServerCommand<CommandFName> { public: CommandFName(Module* Creator) : UserOnlyServerCommand<CommandFName>(Creator, "FNAME", 1) { } - CmdResult HandleRemote(RemoteUser* user, std::vector<std::string>& params); + CmdResult HandleRemote(RemoteUser* user, Params& params); }; class CommandIJoin : public UserOnlyServerCommand<CommandIJoin> { public: CommandIJoin(Module* Creator) : UserOnlyServerCommand<CommandIJoin>(Creator, "IJOIN", 2) { } - CmdResult HandleRemote(RemoteUser* user, std::vector<std::string>& params); + CmdResult HandleRemote(RemoteUser* user, Params& params); }; class CommandResync : public ServerOnlyServerCommand<CommandResync> { public: CommandResync(Module* Creator) : ServerOnlyServerCommand<CommandResync>(Creator, "RESYNC", 1) { } - CmdResult HandleServer(TreeServer* server, std::vector<std::string>& parameters); - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE { return ROUTE_LOCALONLY; } + CmdResult HandleServer(TreeServer* server, Params& parameters); + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE { return ROUTE_LOCALONLY; } }; class SpanningTree::CommandAway : public UserOnlyServerCommand<SpanningTree::CommandAway> { public: CommandAway(Module* Creator) : UserOnlyServerCommand<SpanningTree::CommandAway>(Creator, "AWAY", 0, 2) { } - CmdResult HandleRemote(::RemoteUser* user, std::vector<std::string>& parameters); + CmdResult HandleRemote(::RemoteUser* user, Params& parameters); class Builder : public CmdBuilder { @@ -258,7 +258,7 @@ class CommandAddLine : public ServerCommand { public: CommandAddLine(Module* Creator) : ServerCommand(Creator, "ADDLINE", 6, 6) { } - CmdResult Handle(User* user, std::vector<std::string>& parameters) CXX11_OVERRIDE; + CmdResult Handle(User* user, Params& parameters) CXX11_OVERRIDE; class Builder : public CmdBuilder { @@ -271,46 +271,46 @@ class CommandDelLine : public ServerCommand { public: CommandDelLine(Module* Creator) : ServerCommand(Creator, "DELLINE", 2, 2) { } - CmdResult Handle(User* user, std::vector<std::string>& parameters) CXX11_OVERRIDE; + CmdResult Handle(User* user, Params& parameters) CXX11_OVERRIDE; }; class CommandEncap : public ServerCommand { public: CommandEncap(Module* Creator) : ServerCommand(Creator, "ENCAP", 2) { } - CmdResult Handle(User* user, std::vector<std::string>& parameters) CXX11_OVERRIDE; - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE; + CmdResult Handle(User* user, Params& parameters) CXX11_OVERRIDE; + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE; }; class CommandIdle : public UserOnlyServerCommand<CommandIdle> { public: CommandIdle(Module* Creator) : UserOnlyServerCommand<CommandIdle>(Creator, "IDLE", 1) { } - CmdResult HandleRemote(RemoteUser* user, std::vector<std::string>& parameters); - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE { return ROUTE_UNICAST(parameters[0]); } + CmdResult HandleRemote(RemoteUser* user, Params& parameters); + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE { return ROUTE_UNICAST(parameters[0]); } }; class SpanningTree::CommandNick : public UserOnlyServerCommand<SpanningTree::CommandNick> { public: CommandNick(Module* Creator) : UserOnlyServerCommand<SpanningTree::CommandNick>(Creator, "NICK", 2) { } - CmdResult HandleRemote(::RemoteUser* user, std::vector<std::string>& parameters); + CmdResult HandleRemote(::RemoteUser* user, Params& parameters); }; class SpanningTree::CommandPing : public ServerCommand { public: CommandPing(Module* Creator) : ServerCommand(Creator, "PING", 1) { } - CmdResult Handle(User* user, std::vector<std::string>& parameters) CXX11_OVERRIDE; - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE { return ROUTE_UNICAST(parameters[0]); } + CmdResult Handle(User* user, Params& parameters) CXX11_OVERRIDE; + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE { return ROUTE_UNICAST(parameters[0]); } }; class SpanningTree::CommandPong : public ServerOnlyServerCommand<SpanningTree::CommandPong> { public: CommandPong(Module* Creator) : ServerOnlyServerCommand<SpanningTree::CommandPong>(Creator, "PONG", 1) { } - CmdResult HandleServer(TreeServer* server, std::vector<std::string>& parameters); - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE { return ROUTE_UNICAST(parameters[0]); } + CmdResult HandleServer(TreeServer* server, Params& parameters); + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE { return ROUTE_UNICAST(parameters[0]); } }; class CommandSave : public ServerCommand @@ -321,16 +321,16 @@ class CommandSave : public ServerCommand static const time_t SavedTimestamp = 100; CommandSave(Module* Creator) : ServerCommand(Creator, "SAVE", 2) { } - CmdResult Handle(User* user, std::vector<std::string>& parameters) CXX11_OVERRIDE; + CmdResult Handle(User* user, Params& parameters) CXX11_OVERRIDE; }; class SpanningTree::CommandServer : public ServerOnlyServerCommand<SpanningTree::CommandServer> { - static void HandleExtra(TreeServer* newserver, const std::vector<std::string>& params); + static void HandleExtra(TreeServer* newserver, Params& params); public: CommandServer(Module* Creator) : ServerOnlyServerCommand<SpanningTree::CommandServer>(Creator, "SERVER", 3) { } - CmdResult HandleServer(TreeServer* server, std::vector<std::string>& parameters); + CmdResult HandleServer(TreeServer* server, Params& parameters); class Builder : public CmdBuilder { @@ -347,28 +347,28 @@ class CommandSQuit : public ServerOnlyServerCommand<CommandSQuit> { public: CommandSQuit(Module* Creator) : ServerOnlyServerCommand<CommandSQuit>(Creator, "SQUIT", 2) { } - CmdResult HandleServer(TreeServer* server, std::vector<std::string>& parameters); + CmdResult HandleServer(TreeServer* server, Params& parameters); }; class CommandSNONotice : public ServerCommand { public: CommandSNONotice(Module* Creator) : ServerCommand(Creator, "SNONOTICE", 2) { } - CmdResult Handle(User* user, std::vector<std::string>& parameters) CXX11_OVERRIDE; + CmdResult Handle(User* user, Params& parameters) CXX11_OVERRIDE; }; class CommandEndBurst : public ServerOnlyServerCommand<CommandEndBurst> { public: CommandEndBurst(Module* Creator) : ServerOnlyServerCommand<CommandEndBurst>(Creator, "ENDBURST") { } - CmdResult HandleServer(TreeServer* server, std::vector<std::string>& parameters); + CmdResult HandleServer(TreeServer* server, Params& parameters); }; class CommandSInfo : public ServerOnlyServerCommand<CommandSInfo> { public: CommandSInfo(Module* Creator) : ServerOnlyServerCommand<CommandSInfo>(Creator, "SINFO", 2) { } - CmdResult HandleServer(TreeServer* server, std::vector<std::string>& parameters); + CmdResult HandleServer(TreeServer* server, Params& parameters); class Builder : public CmdBuilder { @@ -381,8 +381,8 @@ class CommandNum : public ServerOnlyServerCommand<CommandNum> { public: CommandNum(Module* Creator) : ServerOnlyServerCommand<CommandNum>(Creator, "NUM", 3) { } - CmdResult HandleServer(TreeServer* server, std::vector<std::string>& parameters); - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE; + CmdResult HandleServer(TreeServer* server, Params& parameters); + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE; class Builder : public CmdBuilder { diff --git a/src/modules/m_spanningtree/compat.cpp b/src/modules/m_spanningtree/compat.cpp index 98b4be88d..dc00d6ff3 100644 --- a/src/modules/m_spanningtree/compat.cpp +++ b/src/modules/m_spanningtree/compat.cpp @@ -320,7 +320,7 @@ void TreeSocket::WriteLine(const std::string& original_line) namespace { - bool InsertCurrentChannelTS(std::vector<std::string>& params, unsigned int chanindex = 0, unsigned int pos = 1) + bool InsertCurrentChannelTS(CommandBase::Params& params, unsigned int chanindex = 0, unsigned int pos = 1) { Channel* chan = ServerInstance->FindChan(params[chanindex]); if (!chan) @@ -332,7 +332,7 @@ namespace } } -bool TreeSocket::PreProcessOldProtocolMessage(User*& who, std::string& cmd, std::vector<std::string>& params) +bool TreeSocket::PreProcessOldProtocolMessage(User*& who, std::string& cmd, CommandBase::Params& params) { if ((cmd == "METADATA") && (params.size() >= 3) && (params[0][0] == '#')) { @@ -381,7 +381,7 @@ bool TreeSocket::PreProcessOldProtocolMessage(User*& who, std::string& cmd, std: if ((params.size() != 1) && (params.size() != 3)) return false; - parameterlist p; + CommandBase::Params p; p.push_back(cmd.substr(0, 1)); p.push_back(params[0]); diff --git a/src/modules/m_spanningtree/delline.cpp b/src/modules/m_spanningtree/delline.cpp index f790dc885..c64bec654 100644 --- a/src/modules/m_spanningtree/delline.cpp +++ b/src/modules/m_spanningtree/delline.cpp @@ -22,7 +22,7 @@ #include "commands.h" -CmdResult CommandDelLine::Handle(User* user, std::vector<std::string>& params) +CmdResult CommandDelLine::Handle(User* user, Params& params) { const std::string& setter = user->nick; diff --git a/src/modules/m_spanningtree/encap.cpp b/src/modules/m_spanningtree/encap.cpp index 8059d2a39..4bc321065 100644 --- a/src/modules/m_spanningtree/encap.cpp +++ b/src/modules/m_spanningtree/encap.cpp @@ -23,11 +23,11 @@ #include "main.h" /** ENCAP */ -CmdResult CommandEncap::Handle(User* user, std::vector<std::string>& params) +CmdResult CommandEncap::Handle(User* user, Params& params) { if (ServerInstance->Config->GetSID() == params[0] || InspIRCd::Match(ServerInstance->Config->ServerName, params[0])) { - parameterlist plist(params.begin() + 2, params.end()); + CommandBase::Params plist(params.begin() + 2, params.end()); // XXX: Workaround for SVS* commands provided by spanningtree not being registered in the core if ((params[1] == "SVSNICK") || (params[1] == "SVSJOIN") || (params[1] == "SVSPART")) @@ -48,7 +48,7 @@ CmdResult CommandEncap::Handle(User* user, std::vector<std::string>& params) return CMD_SUCCESS; } -RouteDescriptor CommandEncap::GetRouting(User* user, const std::vector<std::string>& params) +RouteDescriptor CommandEncap::GetRouting(User* user, const Params& params) { if (params[0].find_first_of("*?") != std::string::npos) return ROUTE_BROADCAST; diff --git a/src/modules/m_spanningtree/fjoin.cpp b/src/modules/m_spanningtree/fjoin.cpp index c292373b3..cfbaeb917 100644 --- a/src/modules/m_spanningtree/fjoin.cpp +++ b/src/modules/m_spanningtree/fjoin.cpp @@ -42,7 +42,7 @@ class FwdFJoinBuilder : public CommandFJoin::Builder }; /** FJOIN, almost identical to TS6 SJOIN, except for nicklist handling. */ -CmdResult CommandFJoin::Handle(User* srcuser, std::vector<std::string>& params) +CmdResult CommandFJoin::Handle(User* srcuser, Params& params) { /* 1.1+ FJOIN works as follows: * diff --git a/src/modules/m_spanningtree/fmode.cpp b/src/modules/m_spanningtree/fmode.cpp index e6f49c5b9..a15b5ddc2 100644 --- a/src/modules/m_spanningtree/fmode.cpp +++ b/src/modules/m_spanningtree/fmode.cpp @@ -22,7 +22,7 @@ #include "commands.h" /** FMODE command - channel mode change with timestamp checks */ -CmdResult CommandFMode::Handle(User* who, std::vector<std::string>& params) +CmdResult CommandFMode::Handle(User* who, Params& params) { time_t TS = ServerCommand::ExtractTS(params[1]); diff --git a/src/modules/m_spanningtree/ftopic.cpp b/src/modules/m_spanningtree/ftopic.cpp index de72d162a..01826e8f6 100644 --- a/src/modules/m_spanningtree/ftopic.cpp +++ b/src/modules/m_spanningtree/ftopic.cpp @@ -22,7 +22,7 @@ #include "commands.h" /** FTOPIC command */ -CmdResult CommandFTopic::Handle(User* user, std::vector<std::string>& params) +CmdResult CommandFTopic::Handle(User* user, Params& params) { Channel* c = ServerInstance->FindChan(params[0]); if (!c) diff --git a/src/modules/m_spanningtree/idle.cpp b/src/modules/m_spanningtree/idle.cpp index ad58e52f0..11e665531 100644 --- a/src/modules/m_spanningtree/idle.cpp +++ b/src/modules/m_spanningtree/idle.cpp @@ -21,7 +21,7 @@ #include "utils.h" #include "commands.h" -CmdResult CommandIdle::HandleRemote(RemoteUser* issuer, std::vector<std::string>& params) +CmdResult CommandIdle::HandleRemote(RemoteUser* issuer, Params& params) { /** * There are two forms of IDLE: request and reply. Requests have one parameter, diff --git a/src/modules/m_spanningtree/ijoin.cpp b/src/modules/m_spanningtree/ijoin.cpp index c2dbcf7f5..d33ef3d4e 100644 --- a/src/modules/m_spanningtree/ijoin.cpp +++ b/src/modules/m_spanningtree/ijoin.cpp @@ -23,7 +23,7 @@ #include "treeserver.h" #include "treesocket.h" -CmdResult CommandIJoin::HandleRemote(RemoteUser* user, std::vector<std::string>& params) +CmdResult CommandIJoin::HandleRemote(RemoteUser* user, Params& params) { Channel* chan = ServerInstance->FindChan(params[0]); if (!chan) @@ -55,7 +55,7 @@ CmdResult CommandIJoin::HandleRemote(RemoteUser* user, std::vector<std::string>& return CMD_SUCCESS; } -CmdResult CommandResync::HandleServer(TreeServer* server, std::vector<std::string>& params) +CmdResult CommandResync::HandleServer(TreeServer* server, CommandBase::Params& params) { ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Resyncing " + params[0]); Channel* chan = ServerInstance->FindChan(params[0]); diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 21251983c..0d153737f 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -136,7 +136,7 @@ void ModuleSpanningTree::ShowLinks(TreeServer* Current, User* user, int hops) InspIRCd::Format("%d %s", (((Utils->FlatLinks) && (!user->IsOper())) ? 0 : hops), Current->GetDesc().c_str())); } -void ModuleSpanningTree::HandleLinks(const std::vector<std::string>& parameters, User* user) +void ModuleSpanningTree::HandleLinks(const CommandBase::Params& parameters, User* user) { ShowLinks(Utils->TreeRoot,user,0); user->WriteNumeric(RPL_ENDOFLINKS, '*', "End of /LINKS list."); @@ -305,7 +305,7 @@ void ModuleSpanningTree::DoConnectTimeout(time_t curtime) } } -ModResult ModuleSpanningTree::HandleVersion(const std::vector<std::string>& parameters, User* user) +ModResult ModuleSpanningTree::HandleVersion(const CommandBase::Params& parameters, User* user) { // We've already confirmed that !parameters.empty(), so this is safe TreeServer* found = Utils->FindServerMask(parameters[0]); @@ -332,7 +332,7 @@ ModResult ModuleSpanningTree::HandleVersion(const std::vector<std::string>& para return MOD_RES_DENY; } -ModResult ModuleSpanningTree::HandleConnect(const std::vector<std::string>& parameters, User* user) +ModResult ModuleSpanningTree::HandleConnect(const CommandBase::Params& parameters, User* user) { for (std::vector<reference<Link> >::iterator i = Utils->LinkBlocks.begin(); i < Utils->LinkBlocks.end(); i++) { diff --git a/src/modules/m_spanningtree/main.h b/src/modules/m_spanningtree/main.h index 5add15e8a..20c1ac2b9 100644 --- a/src/modules/m_spanningtree/main.h +++ b/src/modules/m_spanningtree/main.h @@ -98,15 +98,15 @@ class ModuleSpanningTree : public Module, public Stats::EventListener /** Handle LINKS command */ - void HandleLinks(const std::vector<std::string>& parameters, User* user); + void HandleLinks(const CommandBase::Params& parameters, User* user); /** Handle SQUIT */ - ModResult HandleSquit(const std::vector<std::string>& parameters, User* user); + ModResult HandleSquit(const CommandBase::Params& parameters, User* user); /** Handle remote WHOIS */ - ModResult HandleRemoteWhois(const std::vector<std::string>& parameters, User* user); + ModResult HandleRemoteWhois(const CommandBase::Params& parameters, User* user); /** Connect a server locally */ @@ -126,11 +126,11 @@ class ModuleSpanningTree : public Module, public Stats::EventListener /** Handle remote VERSON */ - ModResult HandleVersion(const std::vector<std::string>& parameters, User* user); + ModResult HandleVersion(const CommandBase::Params& parameters, User* user); /** Handle CONNECT */ - ModResult HandleConnect(const std::vector<std::string>& parameters, User* user); + ModResult HandleConnect(const CommandBase::Params& parameters, User* user); /** Display a time as a human readable string */ @@ -142,8 +142,8 @@ class ModuleSpanningTree : public Module, public Stats::EventListener ** *** MODULE EVENTS *** **/ - ModResult OnPreCommand(std::string &command, std::vector<std::string>& parameters, LocalUser *user, bool validated, const std::string &original_line) CXX11_OVERRIDE; - void OnPostCommand(Command*, const std::vector<std::string>& parameters, LocalUser* user, CmdResult result, const std::string& original_line) CXX11_OVERRIDE; + ModResult OnPreCommand(std::string& command, CommandBase::Params& parameters, LocalUser* user, bool validated, const std::string& original_line) CXX11_OVERRIDE; + void OnPostCommand(Command*, const CommandBase::Params& parameters, LocalUser* user, CmdResult result, const std::string& original_line) CXX11_OVERRIDE; void OnUserConnect(LocalUser* source) CXX11_OVERRIDE; void OnUserInvite(User* source, User* dest, Channel* channel, time_t timeout, unsigned int notifyrank, CUList& notifyexcepts) CXX11_OVERRIDE; ModResult OnPreTopicChange(User* user, Channel* chan, const std::string& topic) CXX11_OVERRIDE; diff --git a/src/modules/m_spanningtree/metadata.cpp b/src/modules/m_spanningtree/metadata.cpp index 47c2f8bc5..52267c522 100644 --- a/src/modules/m_spanningtree/metadata.cpp +++ b/src/modules/m_spanningtree/metadata.cpp @@ -21,7 +21,7 @@ #include "inspircd.h" #include "commands.h" -CmdResult CommandMetadata::Handle(User* srcuser, std::vector<std::string>& params) +CmdResult CommandMetadata::Handle(User* srcuser, Params& params) { if (params[0] == "*") { diff --git a/src/modules/m_spanningtree/misccommands.cpp b/src/modules/m_spanningtree/misccommands.cpp index 00f31d668..8fc1b178f 100644 --- a/src/modules/m_spanningtree/misccommands.cpp +++ b/src/modules/m_spanningtree/misccommands.cpp @@ -29,13 +29,13 @@ #include "commands.h" #include "treeserver.h" -CmdResult CommandSNONotice::Handle(User* user, std::vector<std::string>& params) +CmdResult CommandSNONotice::Handle(User* user, Params& params) { ServerInstance->SNO->WriteToSnoMask(params[0][0], "From " + user->nick + ": " + params[1]); return CMD_SUCCESS; } -CmdResult CommandEndBurst::HandleServer(TreeServer* server, std::vector<std::string>& params) +CmdResult CommandEndBurst::HandleServer(TreeServer* server, Params& params) { server->FinishBurst(); return CMD_SUCCESS; diff --git a/src/modules/m_spanningtree/nick.cpp b/src/modules/m_spanningtree/nick.cpp index 9e290e07f..4f53941ce 100644 --- a/src/modules/m_spanningtree/nick.cpp +++ b/src/modules/m_spanningtree/nick.cpp @@ -30,7 +30,7 @@ #include "commands.h" #include "treeserver.h" -CmdResult CommandNick::HandleRemote(::RemoteUser* user, std::vector<std::string>& params) +CmdResult CommandNick::HandleRemote(::RemoteUser* user, Params& params) { if ((isdigit(params[0][0])) && (params[0] != user->uuid)) throw ProtocolException("Attempted to change nick to an invalid or non-matching UUID"); diff --git a/src/modules/m_spanningtree/num.cpp b/src/modules/m_spanningtree/num.cpp index 2c8697c9a..f83f91286 100644 --- a/src/modules/m_spanningtree/num.cpp +++ b/src/modules/m_spanningtree/num.cpp @@ -23,7 +23,7 @@ #include "commands.h" #include "remoteuser.h" -CmdResult CommandNum::HandleServer(TreeServer* server, std::vector<std::string>& params) +CmdResult CommandNum::HandleServer(TreeServer* server, CommandBase::Params& params) { User* const target = ServerInstance->FindUUID(params[1]); if (!target) @@ -42,7 +42,7 @@ CmdResult CommandNum::HandleServer(TreeServer* server, std::vector<std::string>& return CMD_SUCCESS; } -RouteDescriptor CommandNum::GetRouting(User* user, const std::vector<std::string>& params) +RouteDescriptor CommandNum::GetRouting(User* user, const Params& params) { return ROUTE_UNICAST(params[1]); } @@ -52,10 +52,10 @@ CommandNum::Builder::Builder(SpanningTree::RemoteUser* target, const Numeric::Nu { TreeServer* const server = (numeric.GetServer() ? (static_cast<TreeServer*>(numeric.GetServer())) : Utils->TreeRoot); push(server->GetID()).push(target->uuid).push(InspIRCd::Format("%03u", numeric.GetNumeric())); - const std::vector<std::string>& params = numeric.GetParams(); + const CommandBase::Params& params = numeric.GetParams(); if (!params.empty()) { - for (std::vector<std::string>::const_iterator i = params.begin(); i != params.end()-1; ++i) + for (CommandBase::Params::const_iterator i = params.begin(); i != params.end()-1; ++i) push(*i); push_last(params.back()); } diff --git a/src/modules/m_spanningtree/opertype.cpp b/src/modules/m_spanningtree/opertype.cpp index 4b1dce23c..473cdb857 100644 --- a/src/modules/m_spanningtree/opertype.cpp +++ b/src/modules/m_spanningtree/opertype.cpp @@ -26,7 +26,7 @@ /** Because the core won't let users or even SERVERS set +o, * we use the OPERTYPE command to do this. */ -CmdResult CommandOpertype::HandleRemote(RemoteUser* u, std::vector<std::string>& params) +CmdResult CommandOpertype::HandleRemote(RemoteUser* u, CommandBase::Params& params) { const std::string& opertype = params[0]; if (!u->IsOper()) diff --git a/src/modules/m_spanningtree/override_map.cpp b/src/modules/m_spanningtree/override_map.cpp index d1a00ed84..693b07bad 100644 --- a/src/modules/m_spanningtree/override_map.cpp +++ b/src/modules/m_spanningtree/override_map.cpp @@ -168,7 +168,7 @@ static std::vector<std::string> GetMap(User* user, TreeServer* current, unsigned return map; } -CmdResult CommandMap::Handle(const std::vector<std::string>& parameters, User* user) +CmdResult CommandMap::Handle(User* user, const Params& parameters) { if (parameters.size() > 0) { @@ -215,7 +215,7 @@ CmdResult CommandMap::Handle(const std::vector<std::string>& parameters, User* u return CMD_SUCCESS; } -RouteDescriptor CommandMap::GetRouting(User* user, const std::vector<std::string>& parameters) +RouteDescriptor CommandMap::GetRouting(User* user, const Params& parameters) { if (!parameters.empty()) return ROUTE_UNICAST(parameters[0]); diff --git a/src/modules/m_spanningtree/override_squit.cpp b/src/modules/m_spanningtree/override_squit.cpp index 9cec527d3..eb224660d 100644 --- a/src/modules/m_spanningtree/override_squit.cpp +++ b/src/modules/m_spanningtree/override_squit.cpp @@ -25,7 +25,7 @@ #include "treeserver.h" #include "treesocket.h" -ModResult ModuleSpanningTree::HandleSquit(const std::vector<std::string>& parameters, User* user) +ModResult ModuleSpanningTree::HandleSquit(const CommandBase::Params& parameters, User* user) { TreeServer* s = Utils->FindServerMask(parameters[0]); if (s) diff --git a/src/modules/m_spanningtree/override_whois.cpp b/src/modules/m_spanningtree/override_whois.cpp index 7f7189854..6a64a9403 100644 --- a/src/modules/m_spanningtree/override_whois.cpp +++ b/src/modules/m_spanningtree/override_whois.cpp @@ -21,7 +21,7 @@ #include "main.h" #include "commandbuilder.h" -ModResult ModuleSpanningTree::HandleRemoteWhois(const std::vector<std::string>& parameters, User* user) +ModResult ModuleSpanningTree::HandleRemoteWhois(const CommandBase::Params& parameters, User* user) { User* remote = ServerInstance->FindNickOnly(parameters[1]); if (remote && !IS_LOCAL(remote)) diff --git a/src/modules/m_spanningtree/ping.cpp b/src/modules/m_spanningtree/ping.cpp index 878f8af3a..844feb35b 100644 --- a/src/modules/m_spanningtree/ping.cpp +++ b/src/modules/m_spanningtree/ping.cpp @@ -24,7 +24,7 @@ #include "commands.h" #include "utils.h" -CmdResult CommandPing::Handle(User* user, std::vector<std::string>& params) +CmdResult CommandPing::Handle(User* user, Params& params) { if (params[0] == ServerInstance->Config->GetSID()) { diff --git a/src/modules/m_spanningtree/pong.cpp b/src/modules/m_spanningtree/pong.cpp index 5d97f2af2..718d5f0bb 100644 --- a/src/modules/m_spanningtree/pong.cpp +++ b/src/modules/m_spanningtree/pong.cpp @@ -24,7 +24,7 @@ #include "commands.h" #include "utils.h" -CmdResult CommandPong::HandleServer(TreeServer* server, std::vector<std::string>& params) +CmdResult CommandPong::HandleServer(TreeServer* server, CommandBase::Params& params) { if (server->IsBursting()) { diff --git a/src/modules/m_spanningtree/postcommand.cpp b/src/modules/m_spanningtree/postcommand.cpp index 64ca72977..b50b5e852 100644 --- a/src/modules/m_spanningtree/postcommand.cpp +++ b/src/modules/m_spanningtree/postcommand.cpp @@ -24,13 +24,13 @@ #include "treeserver.h" #include "commandbuilder.h" -void ModuleSpanningTree::OnPostCommand(Command* command, const std::vector<std::string>& parameters, LocalUser* user, CmdResult result, const std::string& original_line) +void ModuleSpanningTree::OnPostCommand(Command* command, const CommandBase::Params& parameters, LocalUser* user, CmdResult result, const std::string& original_line) { if (result == CMD_SUCCESS) Utils->RouteCommand(NULL, command, parameters, user); } -void SpanningTreeUtilities::RouteCommand(TreeServer* origin, CommandBase* thiscmd, const parameterlist& parameters, User* user) +void SpanningTreeUtilities::RouteCommand(TreeServer* origin, CommandBase* thiscmd, const CommandBase::Params& parameters, User* user) { const std::string& command = thiscmd->name; RouteDescriptor routing = thiscmd->GetRouting(user, parameters); diff --git a/src/modules/m_spanningtree/precommand.cpp b/src/modules/m_spanningtree/precommand.cpp index 4733d0071..0d5268493 100644 --- a/src/modules/m_spanningtree/precommand.cpp +++ b/src/modules/m_spanningtree/precommand.cpp @@ -22,7 +22,7 @@ #include "main.h" -ModResult ModuleSpanningTree::OnPreCommand(std::string &command, std::vector<std::string>& parameters, LocalUser *user, bool validated, const std::string &original_line) +ModResult ModuleSpanningTree::OnPreCommand(std::string &command, CommandBase::Params& parameters, LocalUser *user, bool validated, const std::string &original_line) { /* If the command doesnt appear to be valid, we dont want to mess with it. */ if (!validated) diff --git a/src/modules/m_spanningtree/protocolinterface.cpp b/src/modules/m_spanningtree/protocolinterface.cpp index b3326581b..e54a528d9 100644 --- a/src/modules/m_spanningtree/protocolinterface.cpp +++ b/src/modules/m_spanningtree/protocolinterface.cpp @@ -44,7 +44,7 @@ void SpanningTreeProtocolInterface::GetServerList(ServerList& sl) } } -bool SpanningTreeProtocolInterface::SendEncapsulatedData(const std::string& targetmask, const std::string& cmd, const parameterlist& params, User* source) +bool SpanningTreeProtocolInterface::SendEncapsulatedData(const std::string& targetmask, const std::string& cmd, const CommandBase::Params& params, User* source) { if (!source) source = ServerInstance->FakeClient; @@ -71,7 +71,7 @@ bool SpanningTreeProtocolInterface::SendEncapsulatedData(const std::string& targ return true; } -void SpanningTreeProtocolInterface::BroadcastEncap(const std::string& cmd, const parameterlist& params, User* source, User* omit) +void SpanningTreeProtocolInterface::BroadcastEncap(const std::string& cmd, const CommandBase::Params& params, User* source, User* omit) { if (!source) source = ServerInstance->FakeClient; diff --git a/src/modules/m_spanningtree/protocolinterface.h b/src/modules/m_spanningtree/protocolinterface.h index b0609005c..969ed68bf 100644 --- a/src/modules/m_spanningtree/protocolinterface.h +++ b/src/modules/m_spanningtree/protocolinterface.h @@ -31,8 +31,8 @@ class SpanningTreeProtocolInterface : public ProtocolInterface void SendMetaData(const std::string& key, const std::string& data) CXX11_OVERRIDE; }; - bool SendEncapsulatedData(const std::string& targetmask, const std::string& cmd, const parameterlist& params, User* source) CXX11_OVERRIDE; - void BroadcastEncap(const std::string& cmd, const parameterlist& params, User* source, User* omit) CXX11_OVERRIDE; + bool SendEncapsulatedData(const std::string& targetmask, const std::string& cmd, const CommandBase::Params& params, User* source) CXX11_OVERRIDE; + void BroadcastEncap(const std::string& cmd, const CommandBase::Params& params, User* source, User* omit) CXX11_OVERRIDE; void SendMetaData(User* user, const std::string& key, const std::string& data) CXX11_OVERRIDE; void SendMetaData(Channel* chan, const std::string& key, const std::string& data) CXX11_OVERRIDE; void SendMetaData(const std::string& key, const std::string& data) CXX11_OVERRIDE; diff --git a/src/modules/m_spanningtree/rconnect.cpp b/src/modules/m_spanningtree/rconnect.cpp index 8b8757a07..7779355e2 100644 --- a/src/modules/m_spanningtree/rconnect.cpp +++ b/src/modules/m_spanningtree/rconnect.cpp @@ -31,7 +31,7 @@ CommandRConnect::CommandRConnect (Module* Creator) syntax = "<remote-server-mask> <target-server-mask>"; } -CmdResult CommandRConnect::Handle (const std::vector<std::string>& parameters, User *user) +CmdResult CommandRConnect::Handle(User* user, const Params& parameters) { /* First see if the server which is being asked to connect to another server in fact exists */ if (!Utils->FindServerMask(parameters[0])) @@ -45,7 +45,7 @@ CmdResult CommandRConnect::Handle (const std::vector<std::string>& parameters, U { /* Yes, initiate the given connect */ ServerInstance->SNO->WriteToSnoMask('l',"Remote CONNECT from %s matching \002%s\002, connecting server \002%s\002",user->nick.c_str(),parameters[0].c_str(),parameters[1].c_str()); - std::vector<std::string> para; + CommandBase::Params para; para.push_back(parameters[1]); ((ModuleSpanningTree*)(Module*)creator)->HandleConnect(para, user); } @@ -67,7 +67,7 @@ CmdResult CommandRConnect::Handle (const std::vector<std::string>& parameters, U return CMD_SUCCESS; } -RouteDescriptor CommandRConnect::GetRouting(User* user, const std::vector<std::string>& parameters) +RouteDescriptor CommandRConnect::GetRouting(User* user, const Params& parameters) { return ROUTE_UNICAST(parameters[0]); } diff --git a/src/modules/m_spanningtree/rsquit.cpp b/src/modules/m_spanningtree/rsquit.cpp index 487db2826..7ede80b4c 100644 --- a/src/modules/m_spanningtree/rsquit.cpp +++ b/src/modules/m_spanningtree/rsquit.cpp @@ -32,7 +32,7 @@ CommandRSQuit::CommandRSQuit(Module* Creator) syntax = "<target-server-mask> [reason]"; } -CmdResult CommandRSQuit::Handle (const std::vector<std::string>& parameters, User *user) +CmdResult CommandRSQuit::Handle(User* user, const Params& parameters) { TreeServer *server_target; // Server to squit @@ -60,7 +60,7 @@ CmdResult CommandRSQuit::Handle (const std::vector<std::string>& parameters, Use return CMD_SUCCESS; } -RouteDescriptor CommandRSQuit::GetRouting(User* user, const std::vector<std::string>& parameters) +RouteDescriptor CommandRSQuit::GetRouting(User* user, const Params& parameters) { return ROUTE_UNICAST(parameters[0]); } diff --git a/src/modules/m_spanningtree/save.cpp b/src/modules/m_spanningtree/save.cpp index d77c2a382..be3a0a687 100644 --- a/src/modules/m_spanningtree/save.cpp +++ b/src/modules/m_spanningtree/save.cpp @@ -26,7 +26,7 @@ /** * SAVE command - force nick change to UID on timestamp match */ -CmdResult CommandSave::Handle(User* user, std::vector<std::string>& params) +CmdResult CommandSave::Handle(User* user, Params& params) { User* u = ServerInstance->FindUUID(params[0]); if (!u) diff --git a/src/modules/m_spanningtree/server.cpp b/src/modules/m_spanningtree/server.cpp index ecdad87f8..07004a1e8 100644 --- a/src/modules/m_spanningtree/server.cpp +++ b/src/modules/m_spanningtree/server.cpp @@ -32,7 +32,7 @@ * Some server somewhere in the network introducing another server. * -- w */ -CmdResult CommandServer::HandleServer(TreeServer* ParentOfThis, std::vector<std::string>& params) +CmdResult CommandServer::HandleServer(TreeServer* ParentOfThis, Params& params) { const std::string& servername = params[0]; const std::string& sid = params[1]; @@ -70,9 +70,9 @@ CmdResult CommandServer::HandleServer(TreeServer* ParentOfThis, std::vector<std: return CMD_SUCCESS; } -void CommandServer::HandleExtra(TreeServer* newserver, const std::vector<std::string>& params) +void CommandServer::HandleExtra(TreeServer* newserver, Params& params) { - for (std::vector<std::string>::const_iterator i = params.begin() + 2; i != params.end() - 1; ++i) + for (CommandBase::Params::const_iterator i = params.begin() + 2; i != params.end() - 1; ++i) { const std::string& prop = *i; std::string::size_type p = prop.find('='); @@ -90,7 +90,7 @@ void CommandServer::HandleExtra(TreeServer* newserver, const std::vector<std::st } } -Link* TreeSocket::AuthRemote(const parameterlist& params) +Link* TreeSocket::AuthRemote(const CommandBase::Params& params) { if (params.size() < 5) { @@ -148,7 +148,7 @@ Link* TreeSocket::AuthRemote(const parameterlist& params) * 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(parameterlist ¶ms) +bool TreeSocket::Outbound_Reply_Server(CommandBase::Params& params) { const Link* x = AuthRemote(params); if (x) @@ -200,7 +200,7 @@ bool TreeSocket::CheckDuplicate(const std::string& sname, const std::string& sid * Someone else is attempting to connect to us if this is called. Validate their credentials etc. * -- w */ -bool TreeSocket::Inbound_Server(parameterlist ¶ms) +bool TreeSocket::Inbound_Server(CommandBase::Params& params) { const Link* x = AuthRemote(params); if (x) diff --git a/src/modules/m_spanningtree/servercommand.cpp b/src/modules/m_spanningtree/servercommand.cpp index ef55cd00e..5b8152846 100644 --- a/src/modules/m_spanningtree/servercommand.cpp +++ b/src/modules/m_spanningtree/servercommand.cpp @@ -32,7 +32,7 @@ void ServerCommand::RegisterService() st->CmdManager.AddCommand(this); } -RouteDescriptor ServerCommand::GetRouting(User* user, const std::vector<std::string>& parameters) +RouteDescriptor ServerCommand::GetRouting(User* user, const Params& parameters) { // Broadcast server-to-server commands unless overridden return ROUTE_BROADCAST; diff --git a/src/modules/m_spanningtree/servercommand.h b/src/modules/m_spanningtree/servercommand.h index 84488bd68..6ea5a9251 100644 --- a/src/modules/m_spanningtree/servercommand.h +++ b/src/modules/m_spanningtree/servercommand.h @@ -42,8 +42,8 @@ class ServerCommand : public CommandBase */ void RegisterService() CXX11_OVERRIDE; - virtual CmdResult Handle(User* user, std::vector<std::string>& parameters) = 0; - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE; + virtual CmdResult Handle(User* user, Params& parameters) = 0; + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE; /** * Extract the TS from a string. @@ -65,7 +65,7 @@ class UserOnlyServerCommand : public ServerCommand UserOnlyServerCommand(Module* Creator, const std::string& Name, unsigned int MinPara = 0, unsigned int MaxPara = 0) : ServerCommand(Creator, Name, MinPara, MaxPara) { } - CmdResult Handle(User* user, std::vector<std::string>& parameters) CXX11_OVERRIDE + CmdResult Handle(User* user, Params& parameters) CXX11_OVERRIDE { RemoteUser* remoteuser = IS_REMOTE(user); if (!remoteuser) @@ -84,7 +84,7 @@ class ServerOnlyServerCommand : public ServerCommand ServerOnlyServerCommand(Module* Creator, const std::string& Name, unsigned int MinPara = 0, unsigned int MaxPara = 0) : ServerCommand(Creator, Name, MinPara, MaxPara) { } - CmdResult Handle(User* user, std::vector<std::string>& parameters) CXX11_OVERRIDE + CmdResult Handle(User* user, CommandBase::Params& parameters) CXX11_OVERRIDE { if (!IS_SERVER(user)) throw ProtocolException("Invalid source"); diff --git a/src/modules/m_spanningtree/sinfo.cpp b/src/modules/m_spanningtree/sinfo.cpp index 7f175bafb..a5dae783c 100644 --- a/src/modules/m_spanningtree/sinfo.cpp +++ b/src/modules/m_spanningtree/sinfo.cpp @@ -21,7 +21,7 @@ #include "treeserver.h" #include "commands.h" -CmdResult CommandSInfo::HandleServer(TreeServer* server, std::vector<std::string>& params) +CmdResult CommandSInfo::HandleServer(TreeServer* server, CommandBase::Params& params) { const std::string& key = params.front(); const std::string& value = params.back(); diff --git a/src/modules/m_spanningtree/svsjoin.cpp b/src/modules/m_spanningtree/svsjoin.cpp index c85e4f412..92187ddf7 100644 --- a/src/modules/m_spanningtree/svsjoin.cpp +++ b/src/modules/m_spanningtree/svsjoin.cpp @@ -22,7 +22,7 @@ #include "commands.h" -CmdResult CommandSVSJoin::Handle(User* user, std::vector<std::string>& parameters) +CmdResult CommandSVSJoin::Handle(User* user, Params& parameters) { // Check for valid channel name if (!ServerInstance->IsChannel(parameters[1])) @@ -52,7 +52,7 @@ CmdResult CommandSVSJoin::Handle(User* user, std::vector<std::string>& parameter return CMD_SUCCESS; } -RouteDescriptor CommandSVSJoin::GetRouting(User* user, const std::vector<std::string>& parameters) +RouteDescriptor CommandSVSJoin::GetRouting(User* user, const Params& parameters) { return ROUTE_OPT_UCAST(parameters[0]); } diff --git a/src/modules/m_spanningtree/svsnick.cpp b/src/modules/m_spanningtree/svsnick.cpp index 84cf8558c..2514dfd6f 100644 --- a/src/modules/m_spanningtree/svsnick.cpp +++ b/src/modules/m_spanningtree/svsnick.cpp @@ -23,7 +23,7 @@ #include "main.h" #include "commands.h" -CmdResult CommandSVSNick::Handle(User* user, std::vector<std::string>& parameters) +CmdResult CommandSVSNick::Handle(User* user, Params& parameters) { User* u = ServerInstance->FindNick(parameters[0]); @@ -70,7 +70,7 @@ CmdResult CommandSVSNick::Handle(User* user, std::vector<std::string>& parameter return CMD_SUCCESS; } -RouteDescriptor CommandSVSNick::GetRouting(User* user, const std::vector<std::string>& parameters) +RouteDescriptor CommandSVSNick::GetRouting(User* user, const Params& parameters) { return ROUTE_OPT_UCAST(parameters[0]); } diff --git a/src/modules/m_spanningtree/svspart.cpp b/src/modules/m_spanningtree/svspart.cpp index c4163ef3d..505a033e3 100644 --- a/src/modules/m_spanningtree/svspart.cpp +++ b/src/modules/m_spanningtree/svspart.cpp @@ -22,7 +22,7 @@ #include "commands.h" -CmdResult CommandSVSPart::Handle(User* user, std::vector<std::string>& parameters) +CmdResult CommandSVSPart::Handle(User* user, Params& parameters) { User* u = ServerInstance->FindUUID(parameters[0]); if (!u) @@ -40,7 +40,7 @@ CmdResult CommandSVSPart::Handle(User* user, std::vector<std::string>& parameter return CMD_SUCCESS; } -RouteDescriptor CommandSVSPart::GetRouting(User* user, const std::vector<std::string>& parameters) +RouteDescriptor CommandSVSPart::GetRouting(User* user, const Params& parameters) { return ROUTE_OPT_UCAST(parameters[0]); } diff --git a/src/modules/m_spanningtree/treesocket.h b/src/modules/m_spanningtree/treesocket.h index 3571f2816..d99dc9104 100644 --- a/src/modules/m_spanningtree/treesocket.h +++ b/src/modules/m_spanningtree/treesocket.h @@ -149,7 +149,7 @@ class TreeSocket : public BufferedSocket * @param params Parameters they sent in the SERVER command * @return Link block for the remote server, or NULL if an error occurred */ - Link* AuthRemote(const parameterlist& params); + Link* AuthRemote(const CommandBase::Params& params); /** Write a line on this socket with a new line character appended, skipping all translation for old protocols * @param line Line to write without a new line character at the end @@ -246,7 +246,7 @@ class TreeSocket : public BufferedSocket void ListDifference(const std::string &one, const std::string &two, char sep, std::string& mleft, std::string& mright); - bool Capab(const parameterlist ¶ms); + bool Capab(const CommandBase::Params& params); /** Send one or more FJOINs for a channel of users. * If the length of a single line is more than 480-NICKMAX @@ -277,25 +277,25 @@ class TreeSocket : public BufferedSocket void WriteLine(const std::string& line); /** Handle ERROR command */ - void Error(parameterlist ¶ms); + void Error(CommandBase::Params& params); /** (local) -> SERVER */ - bool Outbound_Reply_Server(parameterlist ¶ms); + bool Outbound_Reply_Server(CommandBase::Params& params); /** (local) <- SERVER */ - bool Inbound_Server(parameterlist ¶ms); + bool Inbound_Server(CommandBase::Params& params); /** Handle IRC line split */ - void Split(const std::string &line, std::string& prefix, std::string& command, parameterlist ¶ms); + void Split(const std::string &line, std::string& prefix, std::string& command, CommandBase::Params& params); /** Process complete line from buffer */ void ProcessLine(std::string &line); - void ProcessConnectedLine(std::string& prefix, std::string& command, parameterlist& params); + void ProcessConnectedLine(std::string& prefix, std::string& command, CommandBase::Params& params); /** Handle socket timeout from connect() */ @@ -306,5 +306,5 @@ class TreeSocket : public BufferedSocket /** Fixes messages coming from old servers so the new command handlers understand them */ - bool PreProcessOldProtocolMessage(User*& who, std::string& cmd, std::vector<std::string>& params); + bool PreProcessOldProtocolMessage(User*& who, std::string& cmd, CommandBase::Params& params); }; diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp index a91fbd8eb..062d04222 100644 --- a/src/modules/m_spanningtree/treesocket1.cpp +++ b/src/modules/m_spanningtree/treesocket1.cpp @@ -145,7 +145,7 @@ void TreeSocket::SendError(const std::string &errormessage) SetError(errormessage); } -CmdResult CommandSQuit::HandleServer(TreeServer* server, std::vector<std::string>& params) +CmdResult CommandSQuit::HandleServer(TreeServer* server, CommandBase::Params& params) { TreeServer* quitting = Utils->FindServer(params[0]); if (!quitting) diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index 04b850755..d9083016c 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -32,13 +32,13 @@ #include "commands.h" /* Handle ERROR command */ -void TreeSocket::Error(parameterlist ¶ms) +void TreeSocket::Error(CommandBase::Params& params) { std::string msg = params.size() ? params[0] : ""; SetError("received ERROR " + msg); } -void TreeSocket::Split(const std::string& line, std::string& prefix, std::string& command, parameterlist& params) +void TreeSocket::Split(const std::string& line, std::string& prefix, std::string& command, CommandBase::Params& params) { irc::tokenstream tokens(line); @@ -79,7 +79,7 @@ void TreeSocket::ProcessLine(std::string &line) { std::string prefix; std::string command; - parameterlist params; + CommandBase::Params params; ServerInstance->Logs->Log(MODNAME, LOG_RAWIO, "S[%d] I %s", this->GetFd(), line.c_str()); @@ -263,7 +263,7 @@ User* TreeSocket::FindSource(const std::string& prefix, const std::string& comma return NULL; } -void TreeSocket::ProcessConnectedLine(std::string& prefix, std::string& command, parameterlist& params) +void TreeSocket::ProcessConnectedLine(std::string& prefix, std::string& command, CommandBase::Params& params) { User* who = FindSource(prefix, command); if (!who) @@ -343,7 +343,7 @@ void TreeSocket::ProcessConnectedLine(std::string& prefix, std::string& command, res = scmd->Handle(who, params); else { - res = cmd->Handle(params, who); + res = cmd->Handle(who, params); if (res == CMD_INVALID) throw ProtocolException("Error in command handler"); } diff --git a/src/modules/m_spanningtree/uid.cpp b/src/modules/m_spanningtree/uid.cpp index 905061cc7..f9cff6c0d 100644 --- a/src/modules/m_spanningtree/uid.cpp +++ b/src/modules/m_spanningtree/uid.cpp @@ -26,7 +26,7 @@ #include "treeserver.h" #include "remoteuser.h" -CmdResult CommandUID::HandleServer(TreeServer* remoteserver, std::vector<std::string>& params) +CmdResult CommandUID::HandleServer(TreeServer* remoteserver, CommandBase::Params& params) { /** * 0 1 2 3 4 5 6 7 8 9 (n-1) @@ -133,19 +133,19 @@ CmdResult CommandUID::HandleServer(TreeServer* remoteserver, std::vector<std::st return CMD_SUCCESS; } -CmdResult CommandFHost::HandleRemote(RemoteUser* src, std::vector<std::string>& params) -{ +CmdResult CommandFHost::HandleRemote(RemoteUser* src, Params& params) +{ src->ChangeDisplayedHost(params[0]); return CMD_SUCCESS; } -CmdResult CommandFIdent::HandleRemote(RemoteUser* src, std::vector<std::string>& params) +CmdResult CommandFIdent::HandleRemote(RemoteUser* src, Params& params) { src->ChangeIdent(params[0]); return CMD_SUCCESS; } -CmdResult CommandFName::HandleRemote(RemoteUser* src, std::vector<std::string>& params) +CmdResult CommandFName::HandleRemote(RemoteUser* src, Params& params) { src->ChangeName(params[0]); return CMD_SUCCESS; diff --git a/src/modules/m_spanningtree/utils.h b/src/modules/m_spanningtree/utils.h index 3d34b93a6..495b09414 100644 --- a/src/modules/m_spanningtree/utils.h +++ b/src/modules/m_spanningtree/utils.h @@ -114,7 +114,7 @@ class SpanningTreeUtilities : public classbase */ ~SpanningTreeUtilities(); - void RouteCommand(TreeServer* origin, CommandBase* cmd, const parameterlist& parameters, User* user); + void RouteCommand(TreeServer* origin, CommandBase* cmd, const CommandBase::Params& parameters, User* user); /** Send a message from this server to one other local or remote */ diff --git a/src/modules/m_sqloper.cpp b/src/modules/m_sqloper.cpp index 472817019..e126e584e 100644 --- a/src/modules/m_sqloper.cpp +++ b/src/modules/m_sqloper.cpp @@ -130,7 +130,7 @@ class OperQuery : public SQL::Query if (oper_command) { - std::vector<std::string> params; + CommandBase::Params params; params.push_back(username); params.push_back(password); @@ -143,7 +143,7 @@ class OperQuery : public SQL::Query return; // Now handle /OPER. - oper_command->Handle(params, user); + oper_command->Handle(user, params); } else { @@ -195,7 +195,7 @@ public: } } - ModResult OnPreCommand(std::string &command, std::vector<std::string> ¶meters, LocalUser* user, bool validated, const std::string& original_line) CXX11_OVERRIDE + ModResult OnPreCommand(std::string& command, CommandBase::Params& parameters, LocalUser* user, bool validated, const std::string& original_line) CXX11_OVERRIDE { // If we are not in the middle of an existing /OPER and someone is trying to oper-up if (validated && command == "OPER" && parameters.size() >= 2 && !active) diff --git a/src/modules/m_sslinfo.cpp b/src/modules/m_sslinfo.cpp index 85e7b77dd..7b73740db 100644 --- a/src/modules/m_sslinfo.cpp +++ b/src/modules/m_sslinfo.cpp @@ -99,7 +99,7 @@ class CommandSSLInfo : public Command this->syntax = "<nick>"; } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { User* target = ServerInstance->FindNickOnly(parameters[0]); @@ -179,7 +179,7 @@ class ModuleSSLInfo : public Module, public Whois::EventListener } } - ModResult OnPreCommand(std::string &command, std::vector<std::string> ¶meters, LocalUser *user, bool validated, const std::string &original_line) CXX11_OVERRIDE + ModResult OnPreCommand(std::string& command, CommandBase::Params& parameters, LocalUser* user, bool validated, const std::string& original_line) CXX11_OVERRIDE { if ((command == "OPER") && (validated)) { diff --git a/src/modules/m_starttls.cpp b/src/modules/m_starttls.cpp index d05a10c43..ea6536ed1 100644 --- a/src/modules/m_starttls.cpp +++ b/src/modules/m_starttls.cpp @@ -40,7 +40,7 @@ class CommandStartTLS : public SplitCommand works_before_reg = true; } - CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user) CXX11_OVERRIDE + CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE { if (!ssl) { diff --git a/src/modules/m_svshold.cpp b/src/modules/m_svshold.cpp index 481a1aaba..e74f3324b 100644 --- a/src/modules/m_svshold.cpp +++ b/src/modules/m_svshold.cpp @@ -99,7 +99,7 @@ class CommandSvshold : public Command flags_needed = 'o'; this->syntax = "<nickname> [<duration> :<reason>]"; } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { /* syntax: svshold nickname time :reason goes here */ /* 'time' is a human-readable timestring, like 2d3h2s. */ @@ -156,7 +156,7 @@ class CommandSvshold : public Command return CMD_SUCCESS; } - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE { return ROUTE_BROADCAST; } diff --git a/src/modules/m_swhois.cpp b/src/modules/m_swhois.cpp index d42649909..6c420ca3a 100644 --- a/src/modules/m_swhois.cpp +++ b/src/modules/m_swhois.cpp @@ -48,7 +48,7 @@ class CommandSwhois : public Command TRANSLATE2(TR_NICK, TR_TEXT); } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { User* dest = ServerInstance->FindNick(parameters[0]); diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp index 2decc2d3a..fd2d3d0f0 100644 --- a/src/modules/m_timedbans.cpp +++ b/src/modules/m_timedbans.cpp @@ -68,7 +68,7 @@ class CommandTban : public Command syntax = "<channel> <duration> <banmask>"; } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { Channel* channel = ServerInstance->FindChan(parameters[0]); if (!channel) @@ -129,7 +129,7 @@ class CommandTban : public Command return CMD_SUCCESS; } - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE { return ROUTE_BROADCAST; } diff --git a/src/modules/m_tline.cpp b/src/modules/m_tline.cpp index a351db227..692472e11 100644 --- a/src/modules/m_tline.cpp +++ b/src/modules/m_tline.cpp @@ -30,7 +30,7 @@ class CommandTline : public Command flags_needed = 'o'; this->syntax = "<mask>"; } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { unsigned int n_matched = 0; unsigned int n_match_host = 0; diff --git a/src/modules/m_topiclock.cpp b/src/modules/m_topiclock.cpp index 9bdcdc182..cbe524408 100644 --- a/src/modules/m_topiclock.cpp +++ b/src/modules/m_topiclock.cpp @@ -33,7 +33,7 @@ class CommandSVSTOPIC : public Command flags_needed = FLAG_SERVERONLY; } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { if (!user->server->IsULine()) { @@ -67,7 +67,7 @@ class CommandSVSTOPIC : public Command return CMD_SUCCESS; } - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE { return ROUTE_BROADCAST; } diff --git a/src/modules/m_uhnames.cpp b/src/modules/m_uhnames.cpp index ce9c517f4..4165519fc 100644 --- a/src/modules/m_uhnames.cpp +++ b/src/modules/m_uhnames.cpp @@ -41,7 +41,7 @@ class ModuleUHNames : public Module tokens["UHNAMES"]; } - ModResult OnPreCommand(std::string &command, std::vector<std::string> ¶meters, LocalUser *user, bool validated, const std::string &original_line) CXX11_OVERRIDE + ModResult OnPreCommand(std::string& command, CommandBase::Params& parameters, LocalUser* user, bool validated, const std::string& original_line) CXX11_OVERRIDE { /* We don't actually create a proper command handler class for PROTOCTL, * because other modules might want to have PROTOCTL hooks too. diff --git a/src/modules/m_uninvite.cpp b/src/modules/m_uninvite.cpp index b8390c006..edaabf9fe 100644 --- a/src/modules/m_uninvite.cpp +++ b/src/modules/m_uninvite.cpp @@ -43,7 +43,7 @@ class CommandUninvite : public Command TRANSLATE2(TR_NICK, TR_TEXT); } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { User* u; if (IS_LOCAL(user)) @@ -109,7 +109,7 @@ class CommandUninvite : public Command return CMD_SUCCESS; } - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE { return ROUTE_OPT_UCAST(parameters[0]); } diff --git a/src/modules/m_userip.cpp b/src/modules/m_userip.cpp index 610177cb7..c64f53684 100644 --- a/src/modules/m_userip.cpp +++ b/src/modules/m_userip.cpp @@ -31,7 +31,7 @@ class CommandUserip : public Command syntax = "<nick> [<nick> ...]"; } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { std::string retbuf; int nicks = 0; diff --git a/src/modules/m_vhost.cpp b/src/modules/m_vhost.cpp index bc10fb819..01df33cae 100644 --- a/src/modules/m_vhost.cpp +++ b/src/modules/m_vhost.cpp @@ -32,7 +32,7 @@ class CommandVhost : public Command syntax = "<username> <password>"; } - CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { ConfigTagList tags = ServerInstance->Config->ConfTags("vhost"); for(ConfigIter i = tags.first; i != tags.second; ++i) diff --git a/src/modules/m_watch.cpp b/src/modules/m_watch.cpp index 6406f0573..82cdcb6f8 100644 --- a/src/modules/m_watch.cpp +++ b/src/modules/m_watch.cpp @@ -135,7 +135,7 @@ class CommandWatch : public SplitCommand syntax = "[<C|L|S|l|+<nick1>|-<nick>>]"; } - CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user) CXX11_OVERRIDE + CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE { if (parameters.empty()) { |