diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-05-04 21:37:36 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-05-04 21:37:36 +0000 |
commit | ffbd1eebf0b82bf40482879f410f58874030a695 (patch) | |
tree | ef64846a1dcc27e8768723e30b5c4891f64e2942 /src/commands/cmd_rehash.cpp | |
parent | 1c0efd2f569ebcb725d361d3b9a8e31532f7a071 (diff) |
Conversion of command handler params from "const char* const* parameters, int pcnt" to "const std::vector<std::string>& parameters". All of core is converted, but cant test it till the modules are converted.
IMPORTANT: The mode parser public calls have had to be tweaked a bit to also use the string vector. Note that this makes a LOT of our core a bit messy and paves the way to convert a lot of stuff from the mess
of .c_str() calls to using std::string params directly.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9608 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/commands/cmd_rehash.cpp')
-rw-r--r-- | src/commands/cmd_rehash.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/commands/cmd_rehash.cpp b/src/commands/cmd_rehash.cpp index 0f60f4a6d..ce34239a5 100644 --- a/src/commands/cmd_rehash.cpp +++ b/src/commands/cmd_rehash.cpp @@ -22,23 +22,20 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) return new CommandRehash(Instance); } -CmdResult CommandRehash::Handle (const char* const* parameters, int pcnt, User *user) +CmdResult CommandRehash::Handle (const std::vector<std::string>& parameters, User *user) { std::string old_disabled = ServerInstance->Config->DisabledCommands; - ServerInstance->Logs->Log("fuckingrehash", DEBUG, "parc %d p0 %s", pcnt, parameters[0]); - if (pcnt && parameters[0][0] != '-') + if (parameters.size() && parameters[0][0] != '-') { if (!ServerInstance->MatchText(ServerInstance->Config->ServerName, parameters[0])) { - ServerInstance->Logs->Log("fuckingrehash", DEBUG, "rehash for a server, and not for us"); FOREACH_MOD(I_OnRehash,OnRehash(user, parameters[0])); return CMD_SUCCESS; // rehash for a server, and not for us } } - else if (pcnt) + else if (parameters.size()) { - ServerInstance->Logs->Log("fuckingrehash", DEBUG, "rehash for a subsystem, ignoring"); FOREACH_MOD(I_OnRehash,OnRehash(user, parameters[0])); return CMD_SUCCESS; } @@ -65,7 +62,7 @@ CmdResult CommandRehash::Handle (const char* const* parameters, int pcnt, User * if (!ServerInstance->ConfigThread) { ServerInstance->Config->RehashUser = user; - ServerInstance->Config->RehashParameter = pcnt ? parameters[0] : ""; + ServerInstance->Config->RehashParameter = parameters.size() ? parameters[0] : ""; ServerInstance->ConfigThread = new ConfigReaderThread(ServerInstance, false, user); ServerInstance->Threads->Create(ServerInstance->ConfigThread); |