diff options
author | Peter Powell <petpow@saberuk.com> | 2018-07-26 19:43:54 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2018-07-26 20:12:14 +0100 |
commit | 384ef31bc01e4a1a2e59d082c9066002410ba54a (patch) | |
tree | 06bd81f9e0e48183c1ada07cf7a8757a5028cad1 /src/coremods | |
parent | 09c5439c02f31e9875083e51966dad535af005a9 (diff) |
Use CommandBase::Params instead of std::vector<std::string>.
This is presently a typedef but will soon be replaced with a class
that encapsulates both tags and parameters.
Diffstat (limited to 'src/coremods')
48 files changed, 112 insertions, 112 deletions
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; }; |