summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2018-07-26 19:43:54 +0100
committerPeter Powell <petpow@saberuk.com>2018-07-26 20:12:14 +0100
commit384ef31bc01e4a1a2e59d082c9066002410ba54a (patch)
tree06bd81f9e0e48183c1ada07cf7a8757a5028cad1
parent09c5439c02f31e9875083e51966dad535af005a9 (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.
-rw-r--r--include/command_parse.h6
-rw-r--r--include/commands/cmd_whowas.h2
-rw-r--r--include/ctables.h14
-rw-r--r--include/inspircd.h2
-rw-r--r--include/modules.h4
-rw-r--r--include/modules/sasl.h2
-rw-r--r--include/numeric.h6
-rw-r--r--include/protocol.h6
-rw-r--r--src/command_parse.cpp22
-rw-r--r--src/commands.cpp29
-rw-r--r--src/coremods/core_channel/cmd_invite.cpp4
-rw-r--r--src/coremods/core_channel/cmd_join.cpp2
-rw-r--r--src/coremods/core_channel/cmd_kick.cpp4
-rw-r--r--src/coremods/core_channel/cmd_names.cpp2
-rw-r--r--src/coremods/core_channel/cmd_topic.cpp2
-rw-r--r--src/coremods/core_channel/core_channel.h14
-rw-r--r--src/coremods/core_info/cmd_admin.cpp2
-rw-r--r--src/coremods/core_info/cmd_commands.cpp2
-rw-r--r--src/coremods/core_info/cmd_info.cpp2
-rw-r--r--src/coremods/core_info/cmd_modules.cpp2
-rw-r--r--src/coremods/core_info/cmd_motd.cpp2
-rw-r--r--src/coremods/core_info/cmd_time.cpp2
-rw-r--r--src/coremods/core_info/cmd_version.cpp2
-rw-r--r--src/coremods/core_info/core_info.cpp2
-rw-r--r--src/coremods/core_info/core_info.h16
-rw-r--r--src/coremods/core_ison.cpp4
-rw-r--r--src/coremods/core_list.cpp4
-rw-r--r--src/coremods/core_loadmodule.cpp8
-rw-r--r--src/coremods/core_lusers.cpp4
-rw-r--r--src/coremods/core_oper/cmd_die.cpp2
-rw-r--r--src/coremods/core_oper/cmd_kill.cpp4
-rw-r--r--src/coremods/core_oper/cmd_oper.cpp2
-rw-r--r--src/coremods/core_oper/cmd_rehash.cpp2
-rw-r--r--src/coremods/core_oper/cmd_restart.cpp2
-rw-r--r--src/coremods/core_oper/core_oper.h12
-rw-r--r--src/coremods/core_privmsg.cpp10
-rw-r--r--src/coremods/core_reloadmodule.cpp4
-rw-r--r--src/coremods/core_stats.cpp6
-rw-r--r--src/coremods/core_stub.cpp8
-rw-r--r--src/coremods/core_user/cmd_away.cpp4
-rw-r--r--src/coremods/core_user/cmd_mode.cpp4
-rw-r--r--src/coremods/core_user/cmd_nick.cpp2
-rw-r--r--src/coremods/core_user/cmd_part.cpp4
-rw-r--r--src/coremods/core_user/cmd_quit.cpp4
-rw-r--r--src/coremods/core_user/cmd_user.cpp2
-rw-r--r--src/coremods/core_user/core_user.cpp6
-rw-r--r--src/coremods/core_user/core_user.h20
-rw-r--r--src/coremods/core_userhost.cpp4
-rw-r--r--src/coremods/core_wallops.cpp6
-rw-r--r--src/coremods/core_who.cpp6
-rw-r--r--src/coremods/core_whois.cpp8
-rw-r--r--src/coremods/core_whowas.cpp2
-rw-r--r--src/coremods/core_xline/cmd_eline.cpp2
-rw-r--r--src/coremods/core_xline/cmd_gline.cpp2
-rw-r--r--src/coremods/core_xline/cmd_kline.cpp2
-rw-r--r--src/coremods/core_xline/cmd_qline.cpp2
-rw-r--r--src/coremods/core_xline/cmd_zline.cpp2
-rw-r--r--src/coremods/core_xline/core_xline.h10
-rw-r--r--src/modules.cpp4
-rw-r--r--src/modules/m_abbreviation.cpp2
-rw-r--r--src/modules/m_alias.cpp4
-rw-r--r--src/modules/m_alltime.cpp4
-rw-r--r--src/modules/m_blockamsg.cpp2
-rw-r--r--src/modules/m_callerid.cpp4
-rw-r--r--src/modules/m_cap.cpp2
-rw-r--r--src/modules/m_cban.cpp4
-rw-r--r--src/modules/m_cgiirc.cpp2
-rw-r--r--src/modules/m_check.cpp4
-rw-r--r--src/modules/m_chghost.cpp4
-rw-r--r--src/modules/m_chgident.cpp4
-rw-r--r--src/modules/m_chgname.cpp4
-rw-r--r--src/modules/m_clearchan.cpp4
-rw-r--r--src/modules/m_cloaking.cpp4
-rw-r--r--src/modules/m_clones.cpp2
-rw-r--r--src/modules/m_close.cpp2
-rw-r--r--src/modules/m_conn_umodes.cpp2
-rw-r--r--src/modules/m_conn_waitpong.cpp2
-rw-r--r--src/modules/m_customtitle.cpp2
-rw-r--r--src/modules/m_cycle.cpp2
-rw-r--r--src/modules/m_dccallow.cpp4
-rw-r--r--src/modules/m_filter.cpp10
-rw-r--r--src/modules/m_globalload.cpp12
-rw-r--r--src/modules/m_globops.cpp2
-rw-r--r--src/modules/m_helpop.cpp2
-rw-r--r--src/modules/m_jumpserver.cpp2
-rw-r--r--src/modules/m_knock.cpp4
-rw-r--r--src/modules/m_ldapoper.cpp6
-rw-r--r--src/modules/m_lockserv.cpp4
-rw-r--r--src/modules/m_maphide.cpp2
-rw-r--r--src/modules/m_modenotice.cpp4
-rw-r--r--src/modules/m_monitor.cpp2
-rw-r--r--src/modules/m_namedmodes.cpp2
-rw-r--r--src/modules/m_namesx.cpp2
-rw-r--r--src/modules/m_nicklock.cpp8
-rw-r--r--src/modules/m_ojoin.cpp2
-rw-r--r--src/modules/m_operlog.cpp2
-rw-r--r--src/modules/m_opermodes.cpp2
-rw-r--r--src/modules/m_opermotd.cpp4
-rw-r--r--src/modules/m_password_hash.cpp2
-rw-r--r--src/modules/m_remove.cpp14
-rw-r--r--src/modules/m_rline.cpp4
-rw-r--r--src/modules/m_rmode.cpp2
-rw-r--r--src/modules/m_sajoin.cpp4
-rw-r--r--src/modules/m_sakick.cpp4
-rw-r--r--src/modules/m_samode.cpp2
-rw-r--r--src/modules/m_sanick.cpp4
-rw-r--r--src/modules/m_sapart.cpp4
-rw-r--r--src/modules/m_saquit.cpp4
-rw-r--r--src/modules/m_sasl.cpp16
-rw-r--r--src/modules/m_satopic.cpp2
-rw-r--r--src/modules/m_securelist.cpp2
-rw-r--r--src/modules/m_sethost.cpp2
-rw-r--r--src/modules/m_setident.cpp2
-rw-r--r--src/modules/m_setidle.cpp2
-rw-r--r--src/modules/m_setname.cpp2
-rw-r--r--src/modules/m_showfile.cpp2
-rw-r--r--src/modules/m_showwhois.cpp4
-rw-r--r--src/modules/m_shun.cpp6
-rw-r--r--src/modules/m_silence.cpp9
-rw-r--r--src/modules/m_spanningtree/addline.cpp2
-rw-r--r--src/modules/m_spanningtree/away.cpp2
-rw-r--r--src/modules/m_spanningtree/capab.cpp2
-rw-r--r--src/modules/m_spanningtree/commands.h92
-rw-r--r--src/modules/m_spanningtree/compat.cpp6
-rw-r--r--src/modules/m_spanningtree/delline.cpp2
-rw-r--r--src/modules/m_spanningtree/encap.cpp6
-rw-r--r--src/modules/m_spanningtree/fjoin.cpp2
-rw-r--r--src/modules/m_spanningtree/fmode.cpp2
-rw-r--r--src/modules/m_spanningtree/ftopic.cpp2
-rw-r--r--src/modules/m_spanningtree/idle.cpp2
-rw-r--r--src/modules/m_spanningtree/ijoin.cpp4
-rw-r--r--src/modules/m_spanningtree/main.cpp6
-rw-r--r--src/modules/m_spanningtree/main.h14
-rw-r--r--src/modules/m_spanningtree/metadata.cpp2
-rw-r--r--src/modules/m_spanningtree/misccommands.cpp4
-rw-r--r--src/modules/m_spanningtree/nick.cpp2
-rw-r--r--src/modules/m_spanningtree/num.cpp8
-rw-r--r--src/modules/m_spanningtree/opertype.cpp2
-rw-r--r--src/modules/m_spanningtree/override_map.cpp4
-rw-r--r--src/modules/m_spanningtree/override_squit.cpp2
-rw-r--r--src/modules/m_spanningtree/override_whois.cpp2
-rw-r--r--src/modules/m_spanningtree/ping.cpp2
-rw-r--r--src/modules/m_spanningtree/pong.cpp2
-rw-r--r--src/modules/m_spanningtree/postcommand.cpp4
-rw-r--r--src/modules/m_spanningtree/precommand.cpp2
-rw-r--r--src/modules/m_spanningtree/protocolinterface.cpp4
-rw-r--r--src/modules/m_spanningtree/protocolinterface.h4
-rw-r--r--src/modules/m_spanningtree/rconnect.cpp6
-rw-r--r--src/modules/m_spanningtree/rsquit.cpp4
-rw-r--r--src/modules/m_spanningtree/save.cpp2
-rw-r--r--src/modules/m_spanningtree/server.cpp12
-rw-r--r--src/modules/m_spanningtree/servercommand.cpp2
-rw-r--r--src/modules/m_spanningtree/servercommand.h8
-rw-r--r--src/modules/m_spanningtree/sinfo.cpp2
-rw-r--r--src/modules/m_spanningtree/svsjoin.cpp4
-rw-r--r--src/modules/m_spanningtree/svsnick.cpp4
-rw-r--r--src/modules/m_spanningtree/svspart.cpp4
-rw-r--r--src/modules/m_spanningtree/treesocket.h16
-rw-r--r--src/modules/m_spanningtree/treesocket1.cpp2
-rw-r--r--src/modules/m_spanningtree/treesocket2.cpp10
-rw-r--r--src/modules/m_spanningtree/uid.cpp10
-rw-r--r--src/modules/m_spanningtree/utils.h2
-rw-r--r--src/modules/m_sqloper.cpp6
-rw-r--r--src/modules/m_sslinfo.cpp4
-rw-r--r--src/modules/m_starttls.cpp2
-rw-r--r--src/modules/m_svshold.cpp4
-rw-r--r--src/modules/m_swhois.cpp2
-rw-r--r--src/modules/m_timedbans.cpp4
-rw-r--r--src/modules/m_tline.cpp2
-rw-r--r--src/modules/m_topiclock.cpp4
-rw-r--r--src/modules/m_uhnames.cpp2
-rw-r--r--src/modules/m_uninvite.cpp4
-rw-r--r--src/modules/m_userip.cpp2
-rw-r--r--src/modules/m_vhost.cpp2
-rw-r--r--src/modules/m_watch.cpp2
-rw-r--r--src/users.cpp4
176 files changed, 439 insertions, 431 deletions
diff --git a/include/command_parse.h b/include/command_parse.h
index ec5ebba48..8324e5e25 100644
--- a/include/command_parse.h
+++ b/include/command_parse.h
@@ -65,7 +65,7 @@ class CoreExport CommandParser
* command simply did not exist at all or the wrong number of parameters were given, or the user
* was not privilaged enough to execute the command.
*/
- CmdResult CallHandler(const std::string& commandname, const std::vector<std::string>& parameters, User* user, Command** cmd = NULL);
+ CmdResult CallHandler(const std::string& commandname, const CommandBase::Params& parameters, User* user, Command** cmd = NULL);
/** Get the handler function for a command.
* @param commandname The command required. Always use uppercase for this parameter.
@@ -110,7 +110,7 @@ class CoreExport CommandParser
* command handler for each entry on the list. When this occurs, the caller should return without doing anything,
* otherwise it should continue into its main section of code.
*/
- static bool LoopCall(User* user, Command* handler, const std::vector<std::string>& parameters, unsigned int splithere, int extra = -1, bool usemax = true);
+ static bool LoopCall(User* user, Command* handler, const CommandBase::Params& parameters, unsigned int splithere, int extra = -1, bool usemax = true);
/** Take a raw input buffer from a recvq, and process it on behalf of a user.
* @param buffer The buffer line to process
@@ -144,7 +144,7 @@ class CoreExport CommandParser
* @param custom_translator Used to translate the parameter if the translation type is TR_CUSTOM, if NULL, TR_CUSTOM will act like TR_TEXT
* @return dest The output string
*/
- static std::string TranslateUIDs(const std::vector<TranslateType>& to, const std::vector<std::string>& source, bool prefix_final = false, CommandBase* custom_translator = NULL);
+ static std::string TranslateUIDs(const std::vector<TranslateType>& to, const CommandBase::Params& source, bool prefix_final = false, CommandBase* custom_translator = NULL);
};
/** A lookup table of values for multiplier characters used by
diff --git a/include/commands/cmd_whowas.h b/include/commands/cmd_whowas.h
index 03ffae905..6af0c7c55 100644
--- a/include/commands/cmd_whowas.h
+++ b/include/commands/cmd_whowas.h
@@ -203,5 +203,5 @@ class CommandWhowas : public Command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE;
+ CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
};
diff --git a/include/ctables.h b/include/ctables.h
index 43a311a66..c34e4abeb 100644
--- a/include/ctables.h
+++ b/include/ctables.h
@@ -110,6 +110,8 @@ struct RouteDescriptor
class CoreExport CommandBase : public ServiceProvider
{
public:
+ typedef std::vector<std::string> Params;
+
/** User flags needed to execute the command or 0
*/
unsigned char flags_needed;
@@ -168,7 +170,7 @@ class CoreExport CommandBase : public ServiceProvider
*/
CommandBase(Module* me, const std::string& cmd, unsigned int minpara = 0, unsigned int maxpara = 0);
- virtual RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters);
+ virtual RouteDescriptor GetRouting(User* user, const CommandBase::Params& parameters);
/** Encode a parameter for server->server transmission.
* Used for parameters for which the translation type is TR_CUSTOM.
@@ -219,7 +221,7 @@ class CoreExport Command : public CommandBase
* @param user The user who issued the command.
* @return Return CMD_SUCCESS on success, or CMD_FAILURE on failure.
*/
- virtual CmdResult Handle(const std::vector<std::string>& parameters, User* user) = 0;
+ virtual CmdResult Handle(User* user, const Params& parameters) = 0;
/** Register this object in the CommandParser
*/
@@ -236,10 +238,10 @@ class CoreExport SplitCommand : public Command
public:
SplitCommand(Module* me, const std::string &cmd, unsigned int minpara = 0, unsigned int maxpara = 0)
: Command(me, cmd, minpara, maxpara) {}
- CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE;
- virtual CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user);
- virtual CmdResult HandleRemote(const std::vector<std::string>& parameters, RemoteUser* user);
- virtual CmdResult HandleServer(const std::vector<std::string>& parameters, FakeUser* user);
+ CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
+ virtual CmdResult HandleLocal(LocalUser* user, const Params& parameters);
+ virtual CmdResult HandleRemote(RemoteUser* user, const Params& parameters);
+ virtual CmdResult HandleServer(FakeUser* user, const Params& parameters);
};
/** Shortcut macros for defining translation lists
diff --git a/include/inspircd.h b/include/inspircd.h
index b028280f7..7180fd672 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -72,6 +72,7 @@ struct fakederef
#include "cull_list.h"
#include "extensible.h"
#include "fileutils.h"
+#include "ctables.h"
#include "numerics.h"
#include "numeric.h"
#include "uid.h"
@@ -83,7 +84,6 @@ struct fakederef
#include "logger.h"
#include "usermanager.h"
#include "socket.h"
-#include "ctables.h"
#include "command_parse.h"
#include "mode.h"
#include "socketengine.h"
diff --git a/include/modules.h b/include/modules.h
index 9355712bf..432e70752 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -720,7 +720,7 @@ class CoreExport Module : public classbase, public usecountbase
* @param original_line The entire original line as passed to the parser from the user
* @return 1 to block the command, 0 to allow
*/
- virtual ModResult OnPreCommand(std::string &command, std::vector<std::string>& parameters, LocalUser *user, bool validated, const std::string &original_line);
+ virtual ModResult OnPreCommand(std::string& command, CommandBase::Params& parameters, LocalUser* user, bool validated, const std::string& original_line);
/** Called after any command has been executed.
* This event occurs for all registered commands, wether they are registered in the core,
@@ -733,7 +733,7 @@ class CoreExport Module : public classbase, public usecountbase
* @param result The return code given by the command handler, one of CMD_SUCCESS or CMD_FAILURE
* @param original_line The entire original line as passed to the parser from the user
*/
- virtual void OnPostCommand(Command* command, const std::vector<std::string>& parameters, LocalUser* user, CmdResult result, const std::string& original_line);
+ virtual void OnPostCommand(Command* command, const CommandBase::Params& parameters, LocalUser* user, CmdResult result, const std::string& original_line);
/** Called when a user is first connecting, prior to starting DNS lookups, checking initial
* connect class, or accepting any commands.
diff --git a/include/modules/sasl.h b/include/modules/sasl.h
index 0a7b19a70..8a54cfdb3 100644
--- a/include/modules/sasl.h
+++ b/include/modules/sasl.h
@@ -29,5 +29,5 @@ class SASLEventListener : public Events::ModuleEventListener
{
}
- virtual void OnSASLAuth(const parameterlist& params) = 0;
+ virtual void OnSASLAuth(const CommandBase::Params& params) = 0;
};
diff --git a/include/numeric.h b/include/numeric.h
index 85f2f13f0..cc9f9cc9b 100644
--- a/include/numeric.h
+++ b/include/numeric.h
@@ -34,7 +34,7 @@ class Numeric::Numeric
/** Parameters of the numeric
*/
- std::vector<std::string> params;
+ CommandBase::Params params;
/** Source server of the numeric, if NULL (the default) then it is the local server
*/
@@ -78,10 +78,10 @@ class Numeric::Numeric
/** Get the parameters of the numeric
* @return Parameters of the numeric as a const vector of strings
*/
- const std::vector<std::string>& GetParams() const { return params; }
+ const CommandBase::Params& GetParams() const { return params; }
/** Get the parameters of the numeric
* @return Parameters of the numeric as a vector of strings
*/
- std::vector<std::string>& GetParams() { return params; }
+ CommandBase::Params& GetParams() { return params; }
};
diff --git a/include/protocol.h b/include/protocol.h
index 7a2908a4c..a7c727e8c 100644
--- a/include/protocol.h
+++ b/include/protocol.h
@@ -24,8 +24,6 @@
class User;
-typedef std::vector<std::string> parameterlist;
-
class ProtocolServer
{
public:
@@ -66,7 +64,7 @@ class CoreExport ProtocolInterface
* and the message was sent, false if it was not found.
* ENCAP (should) be used instead of creating new protocol messages for easier third party application support.
*/
- virtual bool SendEncapsulatedData(const std::string& targetmask, const std::string& cmd, const parameterlist& params, User* source = NULL) { return false; }
+ virtual bool SendEncapsulatedData(const std::string& targetmask, const std::string& cmd, const CommandBase::Params& params, User* source = NULL) { return false; }
/** Send an ENCAP message to all servers.
* See the protocol documentation for the purpose of ENCAP.
@@ -76,7 +74,7 @@ class CoreExport ProtocolInterface
* or NULL which is equivalent to the local server
* @param omit If non-NULL the message won't be sent in the direction of this server, useful for forwarding messages
*/
- virtual void BroadcastEncap(const std::string& cmd, const parameterlist& params, User* source = NULL, User* omit = NULL) { }
+ virtual void BroadcastEncap(const std::string& cmd, const CommandBase::Params& params, User* source = NULL, User* omit = NULL) { }
/** Send metadata for a channel to other linked servers.
* @param chan The channel to send metadata for
diff --git a/src/command_parse.cpp b/src/command_parse.cpp
index 61f59ac0b..1ead005c4 100644
--- a/src/command_parse.cpp
+++ b/src/command_parse.cpp
@@ -43,7 +43,7 @@ bool InspIRCd::PassCompare(Extensible* ex, const std::string& data, const std::s
return TimingSafeCompare(data, input);
}
-bool CommandParser::LoopCall(User* user, Command* handler, const std::vector<std::string>& parameters, unsigned int splithere, int extra, bool usemax)
+bool CommandParser::LoopCall(User* user, Command* handler, const CommandBase::Params& parameters, unsigned int splithere, int extra, bool usemax)
{
if (splithere >= parameters.size())
return false;
@@ -82,7 +82,7 @@ bool CommandParser::LoopCall(User* user, Command* handler, const std::vector<std
{
if ((!check_dupes) || (dupes.insert(item).second))
{
- std::vector<std::string> new_parameters(parameters);
+ CommandBase::Params new_parameters(parameters);
new_parameters[splithere] = item;
if (extra >= 0)
@@ -93,7 +93,7 @@ bool CommandParser::LoopCall(User* user, Command* handler, const std::vector<std
new_parameters[extra] = item;
}
- CmdResult result = handler->Handle(new_parameters, user);
+ CmdResult result = handler->Handle(user, new_parameters);
if (localuser)
{
// Run the OnPostCommand hook with the last parameter (original line) being empty
@@ -118,7 +118,7 @@ Command* CommandParser::GetHandler(const std::string &commandname)
// calls a handler function for a command
-CmdResult CommandParser::CallHandler(const std::string& commandname, const std::vector<std::string>& parameters, User* user, Command** cmd)
+CmdResult CommandParser::CallHandler(const std::string& commandname, const CommandBase::Params& parameters, User* user, Command** cmd)
{
CommandMap::iterator n = cmdlist.find(commandname);
@@ -152,7 +152,7 @@ CmdResult CommandParser::CallHandler(const std::string& commandname, const std::
{
if (cmd)
*cmd = n->second;
- return n->second->Handle(parameters,user);
+ return n->second->Handle(user, parameters);
}
}
}
@@ -161,7 +161,7 @@ CmdResult CommandParser::CallHandler(const std::string& commandname, const std::
void CommandParser::ProcessCommand(LocalUser *user, std::string &cmd)
{
- std::vector<std::string> command_p;
+ CommandBase::Params command_p;
irc::tokenstream tokens(cmd);
std::string command, token;
tokens.GetToken(command);
@@ -236,12 +236,12 @@ void CommandParser::ProcessCommand(LocalUser *user, std::string &cmd)
*/
// Iterator to the last parameter that will be kept
- const std::vector<std::string>::iterator lastkeep = command_p.begin() + (handler->max_params - 1);
+ const CommandBase::Params::iterator lastkeep = command_p.begin() + (handler->max_params - 1);
// Iterator to the first excess parameter
- const std::vector<std::string>::iterator firstexcess = lastkeep + 1;
+ const CommandBase::Params::iterator firstexcess = lastkeep + 1;
// Append all excess parameter(s) to the last parameter, seperated by spaces
- for (std::vector<std::string>::const_iterator i = firstexcess; i != command_p.end(); ++i)
+ for (CommandBase::Params::const_iterator i = firstexcess; i != command_p.end(); ++i)
{
lastkeep->push_back(' ');
lastkeep->append(*i);
@@ -329,7 +329,7 @@ void CommandParser::ProcessCommand(LocalUser *user, std::string &cmd)
/*
* WARNING: be careful, the user may be deleted soon
*/
- CmdResult result = handler->Handle(command_p, user);
+ CmdResult result = handler->Handle(user, command_p);
FOREACH_MOD(OnPostCommand, (handler, command_p, user, result, cmd));
}
@@ -363,7 +363,7 @@ void CommandBase::EncodeParameter(std::string& parameter, unsigned int index)
{
}
-RouteDescriptor CommandBase::GetRouting(User* user, const std::vector<std::string>& parameters)
+RouteDescriptor CommandBase::GetRouting(User* user, const Params& parameters)
{
return ROUTE_LOCALONLY;
}
diff --git a/src/commands.cpp b/src/commands.cpp
index c72a5dc73..c5b34c72f 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -23,29 +23,36 @@
#include "inspircd.h"
-CmdResult SplitCommand::Handle(const std::vector<std::string>& parms, User* u)
+CmdResult SplitCommand::Handle(User* user, const Params& parameters)
{
- if (IS_LOCAL(u))
- return HandleLocal(parms, IS_LOCAL(u));
- if (IS_REMOTE(u))
- return HandleRemote(parms, IS_REMOTE(u));
- if (IS_SERVER(u))
- return HandleServer(parms, IS_SERVER(u));
- ServerInstance->Logs->Log("COMMAND", LOG_DEFAULT, "Unknown user type in command (uuid=%s)!", u->uuid.c_str());
+ switch (user->usertype)
+ {
+ case USERTYPE_LOCAL:
+ return HandleLocal(static_cast<LocalUser*>(user), parameters);
+
+ case USERTYPE_REMOTE:
+ return HandleRemote(static_cast<RemoteUser*>(user), parameters);
+
+ case USERTYPE_SERVER:
+ return HandleServer(static_cast<FakeUser*>(user), parameters);
+ }
+
+ ServerInstance->Logs->Log("COMMAND", LOG_DEFAULT, "Unknown user type %d in command (uuid=%s)!",
+ user->usertype, user->uuid.c_str());
return CMD_INVALID;
}
-CmdResult SplitCommand::HandleLocal(const std::vector<std::string>&, LocalUser*)
+CmdResult SplitCommand::HandleLocal(LocalUser* user, const Params& parameters)
{
return CMD_INVALID;
}
-CmdResult SplitCommand::HandleRemote(const std::vector<std::string>&, RemoteUser*)
+CmdResult SplitCommand::HandleRemote(RemoteUser* user, const Params& parameters)
{
return CMD_INVALID;
}
-CmdResult SplitCommand::HandleServer(const std::vector<std::string>&, FakeUser*)
+CmdResult SplitCommand::HandleServer(FakeUser* user, const Params& parameters)
{
return CMD_INVALID;
}
diff --git a/src/coremods/core_channel/cmd_invite.cpp b/src/coremods/core_channel/cmd_invite.cpp
index e9ce03a0c..89a2f6b69 100644
--- a/src/coremods/core_channel/cmd_invite.cpp
+++ b/src/coremods/core_channel/cmd_invite.cpp
@@ -34,7 +34,7 @@ CommandInvite::CommandInvite(Module* parent, Invite::APIImpl& invapiimpl)
/** Handle /INVITE
*/
-CmdResult CommandInvite::Handle (const std::vector<std::string>& parameters, User *user)
+CmdResult CommandInvite::Handle(User* user, const Params& parameters)
{
ModResult MOD_RESULT;
@@ -173,7 +173,7 @@ CmdResult CommandInvite::Handle (const std::vector<std::string>& parameters, Use
return CMD_SUCCESS;
}
-RouteDescriptor CommandInvite::GetRouting(User* user, const std::vector<std::string>& parameters)
+RouteDescriptor CommandInvite::GetRouting(User* user, const Params& parameters)
{
return (IS_LOCAL(user) ? ROUTE_LOCALONLY : ROUTE_BROADCAST);
}
diff --git a/src/coremods/core_channel/cmd_join.cpp b/src/coremods/core_channel/cmd_join.cpp
index a60f1b2c6..2caed9dc6 100644
--- a/src/coremods/core_channel/cmd_join.cpp
+++ b/src/coremods/core_channel/cmd_join.cpp
@@ -30,7 +30,7 @@ CommandJoin::CommandJoin(Module* parent)
/** Handle /JOIN
*/
-CmdResult CommandJoin::HandleLocal(const std::vector<std::string>& parameters, LocalUser *user)
+CmdResult CommandJoin::HandleLocal(LocalUser* user, const Params& parameters)
{
if (parameters.size() > 1)
{
diff --git a/src/coremods/core_channel/cmd_kick.cpp b/src/coremods/core_channel/cmd_kick.cpp
index 05e279751..755c6613b 100644
--- a/src/coremods/core_channel/cmd_kick.cpp
+++ b/src/coremods/core_channel/cmd_kick.cpp
@@ -29,7 +29,7 @@ CommandKick::CommandKick(Module* parent)
/** Handle /KICK
*/
-CmdResult CommandKick::Handle (const std::vector<std::string>& parameters, User *user)
+CmdResult CommandKick::Handle(User* user, const Params& parameters)
{
Channel* c = ServerInstance->FindChan(parameters[0]);
User* u;
@@ -127,7 +127,7 @@ CmdResult CommandKick::Handle (const std::vector<std::string>& parameters, User
return CMD_SUCCESS;
}
-RouteDescriptor CommandKick::GetRouting(User* user, const std::vector<std::string>& parameters)
+RouteDescriptor CommandKick::GetRouting(User* user, const Params& parameters)
{
return (IS_LOCAL(user) ? ROUTE_LOCALONLY : ROUTE_BROADCAST);
}
diff --git a/src/coremods/core_channel/cmd_names.cpp b/src/coremods/core_channel/cmd_names.cpp
index 92f0810de..28273c903 100644
--- a/src/coremods/core_channel/cmd_names.cpp
+++ b/src/coremods/core_channel/cmd_names.cpp
@@ -32,7 +32,7 @@ CommandNames::CommandNames(Module* parent)
/** Handle /NAMES
*/
-CmdResult CommandNames::HandleLocal(const std::vector<std::string>& parameters, LocalUser* user)
+CmdResult CommandNames::HandleLocal(LocalUser* user, const Params& parameters)
{
Channel* c;
diff --git a/src/coremods/core_channel/cmd_topic.cpp b/src/coremods/core_channel/cmd_topic.cpp
index fe913225e..0417f1a0c 100644
--- a/src/coremods/core_channel/cmd_topic.cpp
+++ b/src/coremods/core_channel/cmd_topic.cpp
@@ -33,7 +33,7 @@ CommandTopic::CommandTopic(Module* parent)
Penalty = 2;
}
-CmdResult CommandTopic::HandleLocal(const std::vector<std::string>& parameters, LocalUser* user)
+CmdResult CommandTopic::HandleLocal(LocalUser* user, const Params& parameters)
{
Channel* c = ServerInstance->FindChan(parameters[0]);
if (!c)
diff --git a/src/coremods/core_channel/core_channel.h b/src/coremods/core_channel/core_channel.h
index e59b2cdbd..59a417790 100644
--- a/src/coremods/core_channel/core_channel.h
+++ b/src/coremods/core_channel/core_channel.h
@@ -70,8 +70,8 @@ class CommandInvite : public Command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- 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;
};
/** Handle /JOIN.
@@ -88,7 +88,7 @@ class CommandJoin : public SplitCommand
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user) CXX11_OVERRIDE;
+ CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE;
};
/** Handle /TOPIC.
@@ -109,7 +109,7 @@ class CommandTopic : public SplitCommand
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user) CXX11_OVERRIDE;
+ CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE;
};
/** Handle /NAMES.
@@ -130,7 +130,7 @@ class CommandNames : public SplitCommand
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user) CXX11_OVERRIDE;
+ CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE;
/** Spool the NAMES list for a given channel to the given user
* @param user User to spool the NAMES list to
@@ -154,8 +154,8 @@ class CommandKick : public Command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- 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;
};
/** Channel mode +b
diff --git a/src/coremods/core_info/cmd_admin.cpp b/src/coremods/core_info/cmd_admin.cpp
index f79ebc036..44827555d 100644
--- a/src/coremods/core_info/cmd_admin.cpp
+++ b/src/coremods/core_info/cmd_admin.cpp
@@ -30,7 +30,7 @@ CommandAdmin::CommandAdmin(Module* parent)
/** Handle /ADMIN
*/
-CmdResult CommandAdmin::Handle (const std::vector<std::string>& parameters, User *user)
+CmdResult CommandAdmin::Handle(User* user, const Params& parameters)
{
if (parameters.size() > 0 && parameters[0] != ServerInstance->Config->ServerName)
return CMD_SUCCESS;
diff --git a/src/coremods/core_info/cmd_commands.cpp b/src/coremods/core_info/cmd_commands.cpp
index a7a622f5f..0a3efdf23 100644
--- a/src/coremods/core_info/cmd_commands.cpp
+++ b/src/coremods/core_info/cmd_commands.cpp
@@ -36,7 +36,7 @@ CommandCommands::CommandCommands(Module* parent)
/** Handle /COMMANDS
*/
-CmdResult CommandCommands::Handle (const std::vector<std::string>&, User *user)
+CmdResult CommandCommands::Handle(User* user, const Params& parameters)
{
const CommandParser::CommandMap& commands = ServerInstance->Parser.GetCommands();
std::vector<std::string> list;
diff --git a/src/coremods/core_info/cmd_info.cpp b/src/coremods/core_info/cmd_info.cpp
index e84daeccb..89e92e5a8 100644
--- a/src/coremods/core_info/cmd_info.cpp
+++ b/src/coremods/core_info/cmd_info.cpp
@@ -77,7 +77,7 @@ static const char* const lines[] = {
/** Handle /INFO
*/
-CmdResult CommandInfo::Handle (const std::vector<std::string>& parameters, User *user)
+CmdResult CommandInfo::Handle(User* user, const Params& parameters)
{
if (parameters.size() > 0 && parameters[0] != ServerInstance->Config->ServerName)
return CMD_SUCCESS;
diff --git a/src/coremods/core_info/cmd_modules.cpp b/src/coremods/core_info/cmd_modules.cpp
index fa8c2aebb..952b6bca2 100644
--- a/src/coremods/core_info/cmd_modules.cpp
+++ b/src/coremods/core_info/cmd_modules.cpp
@@ -38,7 +38,7 @@ CommandModules::CommandModules(Module* parent)
/** Handle /MODULES
*/
-CmdResult CommandModules::Handle (const std::vector<std::string>& parameters, User *user)
+CmdResult CommandModules::Handle(User* user, const Params& parameters)
{
// Don't ask remote servers about their modules unless the local user asking is an oper
// 2.0 asks anyway, so let's handle that the same way
diff --git a/src/coremods/core_info/cmd_motd.cpp b/src/coremods/core_info/cmd_motd.cpp
index cfb083eed..cc770b157 100644
--- a/src/coremods/core_info/cmd_motd.cpp
+++ b/src/coremods/core_info/cmd_motd.cpp
@@ -29,7 +29,7 @@ CommandMotd::CommandMotd(Module* parent)
/** Handle /MOTD
*/
-CmdResult CommandMotd::Handle (const std::vector<std::string>& parameters, User *user)
+CmdResult CommandMotd::Handle(User* user, const Params& parameters)
{
if (parameters.size() > 0 && parameters[0] != ServerInstance->Config->ServerName)
{
diff --git a/src/coremods/core_info/cmd_time.cpp b/src/coremods/core_info/cmd_time.cpp
index 6755e5837..73987cf01 100644
--- a/src/coremods/core_info/cmd_time.cpp
+++ b/src/coremods/core_info/cmd_time.cpp
@@ -27,7 +27,7 @@ CommandTime::CommandTime(Module* parent)
syntax = "[<servername>]";
}
-CmdResult CommandTime::Handle (const std::vector<std::string>& parameters, User *user)
+CmdResult CommandTime::Handle(User* user, const Params& parameters)
{
if (parameters.size() > 0 && parameters[0] != ServerInstance->Config->ServerName)
return CMD_SUCCESS;
diff --git a/src/coremods/core_info/cmd_version.cpp b/src/coremods/core_info/cmd_version.cpp
index 9ec0108b1..29d96169e 100644
--- a/src/coremods/core_info/cmd_version.cpp
+++ b/src/coremods/core_info/cmd_version.cpp
@@ -27,7 +27,7 @@ CommandVersion::CommandVersion(Module* parent)
syntax = "[<servername>]";
}
-CmdResult CommandVersion::Handle (const std::vector<std::string>&, User *user)
+CmdResult CommandVersion::Handle(User* user, const Params& parameters)
{
std::string version = ServerInstance->GetVersionString((user->IsOper()));
user->WriteNumeric(RPL_VERSION, version);
diff --git a/src/coremods/core_info/core_info.cpp b/src/coremods/core_info/core_info.cpp
index bd519076d..f1a17d089 100644
--- a/src/coremods/core_info/core_info.cpp
+++ b/src/coremods/core_info/core_info.cpp
@@ -20,7 +20,7 @@
#include "inspircd.h"
#include "core_info.h"
-RouteDescriptor ServerTargetCommand::GetRouting(User* user, const std::vector<std::string>& parameters)
+RouteDescriptor ServerTargetCommand::GetRouting(User* user, const Params& parameters)
{
// Parameter must be a server name, not a nickname or uuid
if ((!parameters.empty()) && (parameters[0].find('.') != std::string::npos))
diff --git a/src/coremods/core_info/core_info.h b/src/coremods/core_info/core_info.h
index 53b949ac5..127041b46 100644
--- a/src/coremods/core_info/core_info.h
+++ b/src/coremods/core_info/core_info.h
@@ -31,7 +31,7 @@ class ServerTargetCommand : public Command
{
}
- RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE;
+ RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE;
};
/** Handle /ADMIN.
@@ -63,7 +63,7 @@ class CommandAdmin : public ServerTargetCommand
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE;
+ CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
};
/** Handle /COMMANDS.
@@ -80,7 +80,7 @@ class CommandCommands : public Command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE;
+ CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
};
/** Handle /INFO.
@@ -97,7 +97,7 @@ class CommandInfo : public ServerTargetCommand
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE;
+ CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
};
/** Handle /MODULES.
@@ -114,7 +114,7 @@ class CommandModules : public ServerTargetCommand
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE;
+ CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
};
/** Handle /MOTD.
@@ -131,7 +131,7 @@ class CommandMotd : public ServerTargetCommand
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE;
+ CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
};
/** Handle /TIME.
@@ -148,7 +148,7 @@ class CommandTime : public ServerTargetCommand
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE;
+ CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
};
/** Handle /VERSION.
@@ -165,5 +165,5 @@ class CommandVersion : public Command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE;
+ CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
};
diff --git a/src/coremods/core_ison.cpp b/src/coremods/core_ison.cpp
index 642e36b43..0c98dfe56 100644
--- a/src/coremods/core_ison.cpp
+++ b/src/coremods/core_ison.cpp
@@ -37,7 +37,7 @@ class CommandIson : public SplitCommand
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user) CXX11_OVERRIDE;
+ CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE;
};
class IsonReplyBuilder : public Numeric::Builder<' ', true>
@@ -58,7 +58,7 @@ class IsonReplyBuilder : public Numeric::Builder<' ', true>
/** Handle /ISON
*/
-CmdResult CommandIson::HandleLocal(const std::vector<std::string>& parameters, LocalUser* user)
+CmdResult CommandIson::HandleLocal(LocalUser* user, const Params& parameters)
{
IsonReplyBuilder reply(user);
diff --git a/src/coremods/core_list.cpp b/src/coremods/core_list.cpp
index 600ec47c2..f03fbbe5e 100644
--- a/src/coremods/core_list.cpp
+++ b/src/coremods/core_list.cpp
@@ -56,13 +56,13 @@ class CommandList : public Command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE;
+ CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
};
/** Handle /LIST
*/
-CmdResult CommandList::Handle (const std::vector<std::string>& parameters, User *user)
+CmdResult CommandList::Handle(User* user, const Params& parameters)
{
// C: Searching based on creation time, via the "C<val" and "C>val" modifiers
// to search for a channel creation time that is lower or higher than val
diff --git a/src/coremods/core_loadmodule.cpp b/src/coremods/core_loadmodule.cpp
index 1064da6c8..69c6bbcef 100644
--- a/src/coremods/core_loadmodule.cpp
+++ b/src/coremods/core_loadmodule.cpp
@@ -33,12 +33,12 @@ class CommandLoadmodule : public Command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE;
+ CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
};
/** Handle /LOADMODULE
*/
-CmdResult CommandLoadmodule::Handle (const std::vector<std::string>& parameters, User *user)
+CmdResult CommandLoadmodule::Handle(User* user, const Params& parameters)
{
if (ServerInstance->Modules->Load(parameters[0]))
{
@@ -72,10 +72,10 @@ class CommandUnloadmodule : public Command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE;
+ CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
};
-CmdResult CommandUnloadmodule::Handle(const std::vector<std::string>& parameters, User* user)
+CmdResult CommandUnloadmodule::Handle(User* user, const Params& parameters)
{
if (!ServerInstance->Config->ConfValue("security")->getBool("allowcoreunload") &&
InspIRCd::Match(parameters[0], "core_*.so", ascii_case_insensitive_map))
diff --git a/src/coremods/core_lusers.cpp b/src/coremods/core_lusers.cpp
index a995e59e7..39a5dac7f 100644
--- a/src/coremods/core_lusers.cpp
+++ b/src/coremods/core_lusers.cpp
@@ -61,12 +61,12 @@ class CommandLusers : public Command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE;
+ CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
};
/** Handle /LUSERS
*/
-CmdResult CommandLusers::Handle (const std::vector<std::string>&, User *user)
+CmdResult CommandLusers::Handle(User* user, const Params& parameters)
{
unsigned int n_users = ServerInstance->Users->RegisteredUserCount();
ProtocolInterface::ServerList serverlist;
diff --git a/src/coremods/core_oper/cmd_die.cpp b/src/coremods/core_oper/cmd_die.cpp
index 5fe643520..d10732952 100644
--- a/src/coremods/core_oper/cmd_die.cpp
+++ b/src/coremods/core_oper/cmd_die.cpp
@@ -58,7 +58,7 @@ void DieRestart::SendError(const std::string& message)
/** Handle /DIE
*/
-CmdResult CommandDie::Handle (const std::vector<std::string>& parameters, User *user)
+CmdResult CommandDie::Handle(User* user, const Params& parameters)
{
if (DieRestart::CheckPass(user, parameters[0], "diepass"))
{
diff --git a/src/coremods/core_oper/cmd_kill.cpp b/src/coremods/core_oper/cmd_kill.cpp
index 446b50c0b..fd6729f53 100644
--- a/src/coremods/core_oper/cmd_kill.cpp
+++ b/src/coremods/core_oper/cmd_kill.cpp
@@ -33,7 +33,7 @@ CommandKill::CommandKill(Module* parent)
/** Handle /KILL
*/
-CmdResult CommandKill::Handle (const std::vector<std::string>& parameters, User *user)
+CmdResult CommandKill::Handle(User* user, const Params& parameters)
{
/* Allow comma seperated lists of users for /KILL (thanks w00t) */
if (CommandParser::LoopCall(user, this, parameters, 0))
@@ -118,7 +118,7 @@ CmdResult CommandKill::Handle (const std::vector<std::string>& parameters, User
return CMD_SUCCESS;
}
-RouteDescriptor CommandKill::GetRouting(User* user, const std::vector<std::string>& parameters)
+RouteDescriptor CommandKill::GetRouting(User* user, const Params& parameters)
{
// FindNick() doesn't work here because we quit the target user in Handle() which
// removes it from the nicklist, so we check lastuuid: if it's empty then this KILL
diff --git a/src/coremods/core_oper/cmd_oper.cpp b/src/coremods/core_oper/cmd_oper.cpp
index e65ed9752..8c3c86adc 100644
--- a/src/coremods/core_oper/cmd_oper.cpp
+++ b/src/coremods/core_oper/cmd_oper.cpp
@@ -28,7 +28,7 @@ CommandOper::CommandOper(Module* parent)
syntax = "<username> <password>";
}
-CmdResult CommandOper::HandleLocal(const std::vector<std::string>& parameters, LocalUser *user)
+CmdResult CommandOper::HandleLocal(LocalUser* user, const Params& parameters)
{
bool match_login = false;
bool match_pass = false;
diff --git a/src/coremods/core_oper/cmd_rehash.cpp b/src/coremods/core_oper/cmd_rehash.cpp
index 5ce38eb2c..e234e54b4 100644
--- a/src/coremods/core_oper/cmd_rehash.cpp
+++ b/src/coremods/core_oper/cmd_rehash.cpp
@@ -30,7 +30,7 @@ CommandRehash::CommandRehash(Module* parent)
syntax = "[<servermask>]";
}
-CmdResult CommandRehash::Handle (const std::vector<std::string>& parameters, User *user)
+CmdResult CommandRehash::Handle(User* user, const Params& parameters)
{
std::string param = parameters.size() ? parameters[0] : "";
diff --git a/src/coremods/core_oper/cmd_restart.cpp b/src/coremods/core_oper/cmd_restart.cpp
index 6c19329c3..936348f95 100644
--- a/src/coremods/core_oper/cmd_restart.cpp
+++ b/src/coremods/core_oper/cmd_restart.cpp
@@ -28,7 +28,7 @@ CommandRestart::CommandRestart(Module* parent)
syntax = "<server>";
}
-CmdResult CommandRestart::Handle (const std::vector<std::string>& parameters, User *user)
+CmdResult CommandRestart::Handle(User* user, const Params& parameters)
{
ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Restart: %s", user->nick.c_str());
if (DieRestart::CheckPass(user, parameters[0], "restartpass"))
diff --git a/src/coremods/core_oper/core_oper.h b/src/coremods/core_oper/core_oper.h
index be615239e..b069c34b2 100644
--- a/src/coremods/core_oper/core_oper.h
+++ b/src/coremods/core_oper/core_oper.h
@@ -51,7 +51,7 @@ class CommandDie : public Command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE;
+ CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
};
/** Handle /KILL.
@@ -71,8 +71,8 @@ class CommandKill : public Command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- 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;
void EncodeParameter(std::string& param, unsigned int index) CXX11_OVERRIDE;
};
@@ -91,7 +91,7 @@ class CommandOper : public SplitCommand
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user) CXX11_OVERRIDE;
+ CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE;
};
/** Handle /REHASH.
@@ -108,7 +108,7 @@ class CommandRehash : public Command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE;
+ CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
};
/** Handle /RESTART
@@ -125,5 +125,5 @@ class CommandRestart : public Command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE;
+ CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
};
diff --git a/src/coremods/core_privmsg.cpp b/src/coremods/core_privmsg.cpp
index 29756a4c2..6078f5297 100644
--- a/src/coremods/core_privmsg.cpp
+++ b/src/coremods/core_privmsg.cpp
@@ -52,9 +52,9 @@ class MessageCommandBase : public Command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult HandleMessage(const std::vector<std::string>& parameters, User* user, MessageType mt);
+ CmdResult HandleMessage(User* user, const CommandBase::Params& parameters, MessageType mt);
- 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))
// This is handled by the OnUserPostMessage hook to split the LoopCall pieces
@@ -75,7 +75,7 @@ void MessageCommandBase::SendAll(User* user, const std::string& msg, MessageType
}
}
-CmdResult MessageCommandBase::HandleMessage(const std::vector<std::string>& parameters, User* user, MessageType mt)
+CmdResult MessageCommandBase::HandleMessage(User* user, const CommandBase::Params& parameters, MessageType mt)
{
User *dest;
Channel *chan;
@@ -271,9 +271,9 @@ class CommandMessage : public MessageCommandBase
{
}
- CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE
+ CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE
{
- return HandleMessage(parameters, user, MT);
+ return HandleMessage(user, parameters, MT);
}
};
diff --git a/src/coremods/core_reloadmodule.cpp b/src/coremods/core_reloadmodule.cpp
index 910144221..23be33af8 100644
--- a/src/coremods/core_reloadmodule.cpp
+++ b/src/coremods/core_reloadmodule.cpp
@@ -45,7 +45,7 @@ class CommandReloadmodule : public Command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE;
+ CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
};
namespace ReloadModule
@@ -608,7 +608,7 @@ class ReloadAction : public ActionBase
}
};
-CmdResult CommandReloadmodule::Handle (const std::vector<std::string>& parameters, User *user)
+CmdResult CommandReloadmodule::Handle(User* user, const Params& parameters)
{
Module* m = ServerInstance->Modules->Find(parameters[0]);
if (m == creator)
diff --git a/src/coremods/core_stats.cpp b/src/coremods/core_stats.cpp
index 5642cd52e..bb20dd761 100644
--- a/src/coremods/core_stats.cpp
+++ b/src/coremods/core_stats.cpp
@@ -51,8 +51,8 @@ class CommandStats : public Command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- 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
{
if ((parameters.size() > 1) && (parameters[1].find('.') != std::string::npos))
return ROUTE_UNICAST(parameters[1]);
@@ -375,7 +375,7 @@ void CommandStats::DoStats(Stats::Context& stats)
return;
}
-CmdResult CommandStats::Handle (const std::vector<std::string>& parameters, User *user)
+CmdResult CommandStats::Handle(User* user, const Params& parameters)
{
if (parameters.size() > 1 && parameters[1] != ServerInstance->Config->ServerName)
{
diff --git a/src/coremods/core_stub.cpp b/src/coremods/core_stub.cpp
index 6adc02f32..7ed3865e3 100644
--- a/src/coremods/core_stub.cpp
+++ b/src/coremods/core_stub.cpp
@@ -41,7 +41,7 @@ class CommandConnect : public Command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE
+ CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE
{
/*
* This is handled by the server linking module, if necessary. Do not remove this stub.
@@ -68,7 +68,7 @@ class CommandLinks : public Command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE
+ CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE
{
user->WriteNumeric(RPL_LINKS, ServerInstance->Config->ServerName, ServerInstance->Config->ServerName, InspIRCd::Format("0 %s", ServerInstance->Config->ServerDesc.c_str()));
user->WriteNumeric(RPL_ENDOFLINKS, '*', "End of /LINKS list.");
@@ -94,7 +94,7 @@ class CommandServer : public Command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE
+ CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE
{
if (user->registered == REG_ALL)
{
@@ -127,7 +127,7 @@ class CommandSquit : public Command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE
+ CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE
{
user->WriteNotice("Look into loading a linking module (like m_spanningtree) if you want this to do anything useful.");
return CMD_FAILURE;
diff --git a/src/coremods/core_user/cmd_away.cpp b/src/coremods/core_user/cmd_away.cpp
index 32d4a9d84..1b7baceba 100644
--- a/src/coremods/core_user/cmd_away.cpp
+++ b/src/coremods/core_user/cmd_away.cpp
@@ -29,7 +29,7 @@ CommandAway::CommandAway(Module* parent)
/** Handle /AWAY
*/
-CmdResult CommandAway::Handle (const std::vector<std::string>& parameters, User *user)
+CmdResult CommandAway::Handle(User* user, const Params& parameters)
{
ModResult MOD_RESULT;
@@ -59,7 +59,7 @@ CmdResult CommandAway::Handle (const std::vector<std::string>& parameters, User
return CMD_SUCCESS;
}
-RouteDescriptor CommandAway::GetRouting(User* user, const std::vector<std::string>& parameters)
+RouteDescriptor CommandAway::GetRouting(User* user, const Params& parameters)
{
return (IS_LOCAL(user) ? ROUTE_LOCALONLY : ROUTE_BROADCAST);
}
diff --git a/src/coremods/core_user/cmd_mode.cpp b/src/coremods/core_user/cmd_mode.cpp
index ec75d6191..a3ebda16d 100644
--- a/src/coremods/core_user/cmd_mode.cpp
+++ b/src/coremods/core_user/cmd_mode.cpp
@@ -30,7 +30,7 @@ CommandMode::CommandMode(Module* parent)
memset(&sent, 0, sizeof(sent));
}
-CmdResult CommandMode::Handle(const std::vector<std::string>& parameters, User* user)
+CmdResult CommandMode::Handle(User* user, const Params& parameters)
{
const std::string& target = parameters[0];
Channel* targetchannel = ServerInstance->FindChan(target);
@@ -103,7 +103,7 @@ CmdResult CommandMode::Handle(const std::vector<std::string>& parameters, User*
return CMD_SUCCESS;
}
-RouteDescriptor CommandMode::GetRouting(User* user, const std::vector<std::string>& parameters)
+RouteDescriptor CommandMode::GetRouting(User* user, const Params& parameters)
{
return (IS_LOCAL(user) ? ROUTE_LOCALONLY : ROUTE_BROADCAST);
}
diff --git a/src/coremods/core_user/cmd_nick.cpp b/src/coremods/core_user/cmd_nick.cpp
index 80bfbe674..670931f7a 100644
--- a/src/coremods/core_user/cmd_nick.cpp
+++ b/src/coremods/core_user/cmd_nick.cpp
@@ -36,7 +36,7 @@ CommandNick::CommandNick(Module* parent)
* for the client introduction code in here, youre in the wrong place.
* You need to look in the spanningtree module for this!
*/
-CmdResult CommandNick::HandleLocal(const std::vector<std::string>& parameters, LocalUser* user)
+CmdResult CommandNick::HandleLocal(LocalUser* user, const Params& parameters)
{
std::string oldnick = user->nick;
std::string newnick = parameters[0];
diff --git a/src/coremods/core_user/cmd_part.cpp b/src/coremods/core_user/cmd_part.cpp
index 261d75a70..2bc431ab3 100644
--- a/src/coremods/core_user/cmd_part.cpp
+++ b/src/coremods/core_user/cmd_part.cpp
@@ -28,7 +28,7 @@ CommandPart::CommandPart(Module* parent)
syntax = "<channel>{,<channel>} [<reason>]";
}
-CmdResult CommandPart::Handle (const std::vector<std::string>& parameters, User *user)
+CmdResult CommandPart::Handle(User* user, const Params& parameters)
{
std::string reason;
if (parameters.size() > 1)
@@ -59,7 +59,7 @@ CmdResult CommandPart::Handle (const std::vector<std::string>& parameters, User
return CMD_SUCCESS;
}
-RouteDescriptor CommandPart::GetRouting(User* user, const std::vector<std::string>& parameters)
+RouteDescriptor CommandPart::GetRouting(User* user, const Params& parameters)
{
return (IS_LOCAL(user) ? ROUTE_LOCALONLY : ROUTE_BROADCAST);
}
diff --git a/src/coremods/core_user/cmd_quit.cpp b/src/coremods/core_user/cmd_quit.cpp
index f9a4e1f70..d919a5761 100644
--- a/src/coremods/core_user/cmd_quit.cpp
+++ b/src/coremods/core_user/cmd_quit.cpp
@@ -29,7 +29,7 @@ CommandQuit::CommandQuit(Module* parent)
syntax = "[<message>]";
}
-CmdResult CommandQuit::Handle (const std::vector<std::string>& parameters, User *user)
+CmdResult CommandQuit::Handle(User* user, const Params& parameters)
{
std::string quitmsg;
if (parameters.empty())
@@ -45,7 +45,7 @@ CmdResult CommandQuit::Handle (const std::vector<std::string>& parameters, User
return CMD_SUCCESS;
}
-RouteDescriptor CommandQuit::GetRouting(User* user, const std::vector<std::string>& parameters)
+RouteDescriptor CommandQuit::GetRouting(User* user, const Params& parameters)
{
return (IS_LOCAL(user) ? ROUTE_LOCALONLY : ROUTE_BROADCAST);
}
diff --git a/src/coremods/core_user/cmd_user.cpp b/src/coremods/core_user/cmd_user.cpp
index 452146adc..f49b1339c 100644
--- a/src/coremods/core_user/cmd_user.cpp
+++ b/src/coremods/core_user/cmd_user.cpp
@@ -35,7 +35,7 @@ CommandUser::CommandUser(Module* parent)
syntax = "<username> <localhost> <remotehost> <realname>";
}
-CmdResult CommandUser::HandleLocal(const std::vector<std::string>& parameters, LocalUser *user)
+CmdResult CommandUser::HandleLocal(LocalUser* user, const Params& parameters)
{
/* A user may only send the USER command once */
if (!(user->registered & REG_USER))
diff --git a/src/coremods/core_user/core_user.cpp b/src/coremods/core_user/core_user.cpp
index 8504de8e0..6e4e547c1 100644
--- a/src/coremods/core_user/core_user.cpp
+++ b/src/coremods/core_user/core_user.cpp
@@ -40,7 +40,7 @@ class CommandPass : public SplitCommand
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user) CXX11_OVERRIDE
+ CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE
{
// Check to make sure they haven't registered -- Fix by FCS
if (user->registered == REG_ALL)
@@ -73,7 +73,7 @@ class CommandPing : public Command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE
+ CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE
{
user->WriteServ("PONG %s :%s", ServerInstance->Config->ServerName.c_str(), parameters[0].c_str());
return CMD_SUCCESS;
@@ -99,7 +99,7 @@ class CommandPong : public Command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE
+ CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE
{
// set the user as alive so they survive to next ping
LocalUser* localuser = IS_LOCAL(user);
diff --git a/src/coremods/core_user/core_user.h b/src/coremods/core_user/core_user.h
index befb07ef5..f29d2e448 100644
--- a/src/coremods/core_user/core_user.h
+++ b/src/coremods/core_user/core_user.h
@@ -62,8 +62,8 @@ class CommandAway : public Command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- 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 CommandMode : public Command
@@ -95,9 +95,9 @@ class CommandMode : public Command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult Handle(const std::vector<std::string>& parameters, User* 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;
};
/** Handle /NICK.
@@ -114,7 +114,7 @@ class CommandNick : public SplitCommand
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user) CXX11_OVERRIDE;
+ CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE;
};
/** Handle /PART.
@@ -133,8 +133,8 @@ class CommandPart : public Command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- 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;
};
/** Handle /QUIT.
@@ -156,9 +156,9 @@ class CommandQuit : public Command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult Handle(const std::vector<std::string>& parameters, User* 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;
};
/** Handle /USER.
@@ -175,7 +175,7 @@ class CommandUser : public SplitCommand
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user) CXX11_OVERRIDE;
+ CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE;
/** Run the OnUserRegister hook if the user has sent both NICK and USER. Called after an unregistered user
* successfully executes the USER or the NICK command.
diff --git a/src/coremods/core_userhost.cpp b/src/coremods/core_userhost.cpp
index 2ed19f4d7..294f714b4 100644
--- a/src/coremods/core_userhost.cpp
+++ b/src/coremods/core_userhost.cpp
@@ -40,10 +40,10 @@ class CommandUserhost : public Command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE;
+ CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
};
-CmdResult CommandUserhost::Handle (const std::vector<std::string>& parameters, User *user)
+CmdResult CommandUserhost::Handle(User* user, const Params& parameters)
{
const bool has_privs = user->HasPrivPermission("users/auspex");
diff --git a/src/coremods/core_wallops.cpp b/src/coremods/core_wallops.cpp
index d45ede846..856fcea74 100644
--- a/src/coremods/core_wallops.cpp
+++ b/src/coremods/core_wallops.cpp
@@ -42,15 +42,15 @@ class CommandWallops : public Command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult Handle(const std::vector<std::string>& parameters, User* 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;
}
};
-CmdResult CommandWallops::Handle (const std::vector<std::string>& parameters, User *user)
+CmdResult CommandWallops::Handle(User* user, const Params& parameters)
{
std::string wallop("WALLOPS :");
wallop.append(parameters[0]);
diff --git a/src/coremods/core_who.cpp b/src/coremods/core_who.cpp
index 305733e03..8bba1f860 100644
--- a/src/coremods/core_who.cpp
+++ b/src/coremods/core_who.cpp
@@ -56,7 +56,7 @@ struct WhoData
// A user specified label for the WHOX response.
std::string whox_querytype;
- WhoData(const std::vector<std::string>& parameters)
+ WhoData(const CommandBase::Params& parameters)
: whox(false)
{
// Find the matchtext and swap the 0 for a * so we can use InspIRCd::Match on it.
@@ -168,7 +168,7 @@ class CommandWho : public SplitCommand
/** Sends a WHO reply to a user. */
void SendWhoLine(LocalUser* user, const std::vector<std::string>& parameters, Membership* memb, User* u, WhoData& data);
- CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user) CXX11_OVERRIDE;
+ CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE;
};
template<> User* CommandWho::GetUser(UserManager::OperList::const_iterator& t) { return *t; }
@@ -539,7 +539,7 @@ void CommandWho::SendWhoLine(LocalUser* source, const std::vector<std::string>&
data.results.push_back(wholine);
}
-CmdResult CommandWho::HandleLocal(const std::vector<std::string>& parameters, LocalUser* user)
+CmdResult CommandWho::HandleLocal(LocalUser* user, const Params& parameters)
{
WhoData data(parameters);
diff --git a/src/coremods/core_whois.cpp b/src/coremods/core_whois.cpp
index 4ec592781..8f09396b2 100644
--- a/src/coremods/core_whois.cpp
+++ b/src/coremods/core_whois.cpp
@@ -109,8 +109,8 @@ class CommandWhois : public SplitCommand
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user) CXX11_OVERRIDE;
- CmdResult HandleRemote(const std::vector<std::string>& parameters, RemoteUser* target) CXX11_OVERRIDE;
+ CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE;
+ CmdResult HandleRemote(RemoteUser* target, const Params& parameters) CXX11_OVERRIDE;
};
class WhoisNumericSink
@@ -267,7 +267,7 @@ void CommandWhois::DoWhois(LocalUser* user, User* dest, time_t signon, unsigned
whois.SendLine(RPL_ENDOFWHOIS, "End of /WHOIS list.");
}
-CmdResult CommandWhois::HandleRemote(const std::vector<std::string>& parameters, RemoteUser* target)
+CmdResult CommandWhois::HandleRemote(RemoteUser* target, const Params& parameters)
{
if (parameters.size() < 2)
return CMD_FAILURE;
@@ -287,7 +287,7 @@ CmdResult CommandWhois::HandleRemote(const std::vector<std::string>& parameters,
return CMD_SUCCESS;
}
-CmdResult CommandWhois::HandleLocal(const std::vector<std::string>& parameters, LocalUser* user)
+CmdResult CommandWhois::HandleLocal(LocalUser* user, const Params& parameters)
{
User *dest;
unsigned int userindex = 0;
diff --git a/src/coremods/core_whowas.cpp b/src/coremods/core_whowas.cpp
index 188b0e4d5..6bcf6448b 100644
--- a/src/coremods/core_whowas.cpp
+++ b/src/coremods/core_whowas.cpp
@@ -41,7 +41,7 @@ CommandWhowas::CommandWhowas( Module* parent)
Penalty = 2;
}
-CmdResult CommandWhowas::Handle (const std::vector<std::string>& parameters, User* user)
+CmdResult CommandWhowas::Handle(User* user, const Params& parameters)
{
/* if whowas disabled in config */
if (!manager.IsEnabled())
diff --git a/src/coremods/core_xline/cmd_eline.cpp b/src/coremods/core_xline/cmd_eline.cpp
index 26b49894b..0cb52298c 100644
--- a/src/coremods/core_xline/cmd_eline.cpp
+++ b/src/coremods/core_xline/cmd_eline.cpp
@@ -31,7 +31,7 @@ CommandEline::CommandEline(Module* parent)
/** Handle /ELINE
*/
-CmdResult CommandEline::Handle (const std::vector<std::string>& parameters, User *user)
+CmdResult CommandEline::Handle(User* user, const Params& parameters)
{
std::string target = parameters[0];
diff --git a/src/coremods/core_xline/cmd_gline.cpp b/src/coremods/core_xline/cmd_gline.cpp
index 49932ba9d..79b3ce21f 100644
--- a/src/coremods/core_xline/cmd_gline.cpp
+++ b/src/coremods/core_xline/cmd_gline.cpp
@@ -31,7 +31,7 @@ CommandGline::CommandGline(Module* parent)
/** Handle /GLINE
*/
-CmdResult CommandGline::Handle (const std::vector<std::string>& parameters, User *user)
+CmdResult CommandGline::Handle(User* user, const Params& parameters)
{
std::string target = parameters[0];
diff --git a/src/coremods/core_xline/cmd_kline.cpp b/src/coremods/core_xline/cmd_kline.cpp
index db8862d37..0f04224d6 100644
--- a/src/coremods/core_xline/cmd_kline.cpp
+++ b/src/coremods/core_xline/cmd_kline.cpp
@@ -31,7 +31,7 @@ CommandKline::CommandKline(Module* parent)
/** Handle /KLINE
*/
-CmdResult CommandKline::Handle (const std::vector<std::string>& parameters, User *user)
+CmdResult CommandKline::Handle(User* user, const Params& parameters)
{
std::string target = parameters[0];
diff --git a/src/coremods/core_xline/cmd_qline.cpp b/src/coremods/core_xline/cmd_qline.cpp
index 6dc0da9ba..b75973861 100644
--- a/src/coremods/core_xline/cmd_qline.cpp
+++ b/src/coremods/core_xline/cmd_qline.cpp
@@ -30,7 +30,7 @@ CommandQline::CommandQline(Module* parent)
syntax = "<nick> [<duration> :<reason>]";
}
-CmdResult CommandQline::Handle (const std::vector<std::string>& parameters, User *user)
+CmdResult CommandQline::Handle(User* user, const Params& parameters)
{
if (parameters.size() >= 3)
{
diff --git a/src/coremods/core_xline/cmd_zline.cpp b/src/coremods/core_xline/cmd_zline.cpp
index af9d54a5b..350f3270c 100644
--- a/src/coremods/core_xline/cmd_zline.cpp
+++ b/src/coremods/core_xline/cmd_zline.cpp
@@ -30,7 +30,7 @@ CommandZline::CommandZline(Module* parent)
syntax = "<ipmask> [<duration> :<reason>]";
}
-CmdResult CommandZline::Handle (const std::vector<std::string>& parameters, User *user)
+CmdResult CommandZline::Handle(User* user, const Params& parameters)
{
std::string target = parameters[0];
diff --git a/src/coremods/core_xline/core_xline.h b/src/coremods/core_xline/core_xline.h
index 11756c06b..1e0bc74cc 100644
--- a/src/coremods/core_xline/core_xline.h
+++ b/src/coremods/core_xline/core_xline.h
@@ -79,7 +79,7 @@ class CommandEline : public Command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE;
+ CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
};
/** Handle /GLINE.
@@ -96,7 +96,7 @@ class CommandGline : public Command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE;
+ CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
};
/** Handle /KLINE.
@@ -113,7 +113,7 @@ class CommandKline : public Command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE;
+ CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
};
/** Handle /QLINE.
@@ -136,7 +136,7 @@ class CommandQline : public Command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE;
+ CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
};
/** Handle /ZLINE.
@@ -159,5 +159,5 @@ class CommandZline : public Command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE;
+ CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
};
diff --git a/src/modules.cpp b/src/modules.cpp
index ab10d6ae1..334111e6d 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -94,8 +94,8 @@ ModResult Module::OnKill(User*, User*, const std::string&) { DetachEvent(I_OnKil
void Module::OnLoadModule(Module*) { DetachEvent(I_OnLoadModule); }
void Module::OnUnloadModule(Module*) { DetachEvent(I_OnUnloadModule); }
void Module::OnBackgroundTimer(time_t) { DetachEvent(I_OnBackgroundTimer); }
-ModResult Module::OnPreCommand(std::string&, std::vector<std::string>&, LocalUser*, bool, const std::string&) { DetachEvent(I_OnPreCommand); return MOD_RES_PASSTHRU; }
-void Module::OnPostCommand(Command*, const std::vector<std::string>&, LocalUser*, CmdResult, const std::string&) { DetachEvent(I_OnPostCommand); }
+ModResult Module::OnPreCommand(std::string&, CommandBase::Params&, LocalUser*, bool, const std::string&) { DetachEvent(I_OnPreCommand); return MOD_RES_PASSTHRU; }
+void Module::OnPostCommand(Command*, const CommandBase::Params&, LocalUser*, CmdResult, const std::string&) { DetachEvent(I_OnPostCommand); }
void Module::OnUserInit(LocalUser*) { DetachEvent(I_OnUserInit); }
ModResult Module::OnCheckReady(LocalUser*) { DetachEvent(I_OnCheckReady); return MOD_RES_PASSTHRU; }
ModResult Module::OnUserRegister(LocalUser*) { DetachEvent(I_OnUserRegister); return MOD_RES_PASSTHRU; }
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> &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
{
/* 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> &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 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> &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
{
// 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> &parameters, 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> &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 (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> &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;
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> &parameters, 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> &parameters, 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> &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 && !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> &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
{
/* 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> &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 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> &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 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 &params)
+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 &params)
+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 &params)
+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 &params);
+ 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 &params);
+ void Error(CommandBase::Params& params);
/** (local) -> SERVER
*/
- bool Outbound_Reply_Server(parameterlist &params);
+ bool Outbound_Reply_Server(CommandBase::Params& params);
/** (local) <- SERVER
*/
- bool Inbound_Server(parameterlist &params);
+ bool Inbound_Server(CommandBase::Params& params);
/** Handle IRC line split
*/
- void Split(const std::string &line, std::string& prefix, std::string& command, parameterlist &params);
+ 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 &params)
+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> &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 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> &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 ((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> &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
{
/* 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())
{
diff --git a/src/users.cpp b/src/users.cpp
index 442770aca..81e6512a1 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -561,7 +561,7 @@ void LocalUser::FullConnect()
/* Trigger MOTD and LUSERS output, give modules a chance too */
ModResult MOD_RESULT;
std::string command("LUSERS");
- std::vector<std::string> parameters;
+ CommandBase::Params parameters;
FIRST_MOD_RESULT(OnPreCommand, MOD_RESULT, (command, parameters, this, true, command));
if (!MOD_RESULT)
ServerInstance->Parser.CallHandler(command, parameters, this);
@@ -825,7 +825,7 @@ void User::WriteCommand(const char* command, const std::string& text)
namespace
{
- std::string BuildNumeric(const std::string& source, User* targetuser, unsigned int num, const std::vector<std::string>& params)
+ std::string BuildNumeric(const std::string& source, User* targetuser, unsigned int num, const Command::Params& params)
{
const char* const target = (targetuser->registered & REG_NICK ? targetuser->nick.c_str() : "*");
std::string raw = InspIRCd::Format(":%s %03u %s", source.c_str(), num, target);