From 6b10fa52627058111ad55531c8a97ae3de2d0b7d Mon Sep 17 00:00:00 2001 From: peavey Date: Sun, 4 May 2008 22:17:02 +0000 Subject: First attempt at converting to new command handler, please review diff Brain. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9613 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_alias.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp index 160de3327..ffe2946a5 100644 --- a/src/modules/m_alias.cpp +++ b/src/modules/m_alias.cpp @@ -126,7 +126,7 @@ class ModuleAlias : public Module } } - virtual int OnPreCommand(const std::string &command, const char* const* parameters, int pcnt, User *user, bool validated, const std::string &original_line) + virtual int OnPreCommand(const std::string &command, const std::vector ¶meters, User *user, bool validated, const std::string &original_line) { User *u = NULL; @@ -247,16 +247,15 @@ class ModuleAlias : public Module SearchAndReplace(newline, "\r", "$"); irc::tokenstream ss(newline); - const char* parv[MAXPARAMETERS]; - int x = 0; - while (ss.GetToken(pars[x]) && x < MAXPARAMETERS) + std::vector parms; + int x = 1; + while (ss.GetToken(pars[x]) && parms.size() <= MAXPARAMETERS) { - parv[x] = pars[x].c_str(); + parms.push_back(pars[x]); x++; } - - ServerInstance->Parser->CallHandler(parv[0], &parv[1], x-1, user); + ServerInstance->Parser->CallHandler(pars[0], parms, user); } virtual void OnRehash(User* user, const std::string ¶meter) -- cgit v1.2.3