From ffbd1eebf0b82bf40482879f410f58874030a695 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 4 May 2008 21:37:36 +0000 Subject: Conversion of command handler params from "const char* const* parameters, int pcnt" to "const std::vector& 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 --- src/commands/cmd_rehash.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/commands/cmd_rehash.cpp') 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& 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); -- cgit v1.2.3