diff options
-rw-r--r-- | src/modules/m_svshold.cpp | 26 | ||||
-rw-r--r-- | src/modules/m_swhois.cpp | 8 | ||||
-rw-r--r-- | src/modules/m_taxonomy.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_testcommand.cpp | 2 |
4 files changed, 19 insertions, 19 deletions
diff --git a/src/modules/m_svshold.cpp b/src/modules/m_svshold.cpp index 4a650fb1f..ed4fa86cf 100644 --- a/src/modules/m_svshold.cpp +++ b/src/modules/m_svshold.cpp @@ -57,7 +57,7 @@ class CommandSvshold : public Command TRANSLATE4(TR_NICK, TR_TEXT, TR_TEXT, TR_END); } - CmdResult Handle(const char* const* parameters, int pcnt, User *user) + CmdResult Handle(const std::vector<std::string> ¶meters, User *user) { /* syntax: svshold nickname time :reason goes here */ /* 'time' is a human-readable timestring, like 2d3h2s. */ @@ -68,9 +68,9 @@ class CommandSvshold : public Command return CMD_FAILURE; } - if (pcnt == 1) + if (parameters.size() == 1) { - SVSHoldMap::iterator n = HoldMap.find(parameters[0]); + SVSHoldMap::iterator n = HoldMap.find(parameters[0].c_str()); if (n != HoldMap.end()) { /* form: svshold nickname removes a hold. */ @@ -97,40 +97,40 @@ class CommandSvshold : public Command delete n->second; } } - else if (pcnt >= 2) + else if (parameters.size() >= 2) { /* full form to add a SVSHold */ - if (ServerInstance->IsNick(parameters[0])) + if (ServerInstance->IsNick(parameters[0].c_str())) { // parameters[0] = w00t // parameters[1] = 1h3m2s // parameters[2] = Registered nickname /* Already exists? */ - if (HoldMap.find(parameters[0]) != HoldMap.end()) + if (HoldMap.find(parameters[0].c_str()) != HoldMap.end()) { - user->WriteServ( "385 %s %s :SVSHOLD already exists", user->nick, parameters[0]); + user->WriteServ( "385 %s %s :SVSHOLD already exists", user->nick, parameters[0].c_str()); return CMD_FAILURE; } unsigned long length = ServerInstance->Duration(parameters[1]); - std::string reason = (pcnt > 2) ? parameters[2] : "No reason supplied"; + std::string reason = (parameters.size() > 2) ? parameters[2] : "No reason supplied"; SVSHold* S = new SVSHold(parameters[0], user->nick, ServerInstance->Time(), length, reason); SVSHolds.push_back(S); - HoldMap[parameters[0]] = S; + HoldMap[parameters[0].c_str()] = S; std::sort(SVSHolds.begin(), SVSHolds.end(), SVSHoldComp); if(length > 0) { - user->WriteServ( "385 %s %s :Added %lu second SVSHOLD (%s)", user->nick, parameters[0], length, reason.c_str()); - ServerInstance->SNO->WriteToSnoMask('A', "%s added %lu second SVSHOLD on %s (%s)", user->nick, length, parameters[0], reason.c_str()); + user->WriteServ( "385 %s %s :Added %lu second SVSHOLD (%s)", user->nick, parameters[0].c_str(), length, reason.c_str()); + ServerInstance->SNO->WriteToSnoMask('A', "%s added %lu second SVSHOLD on %s (%s)", user->nick, length, parameters[0].c_str(), reason.c_str()); } else { - user->WriteServ( "385 %s %s :Added permanent SVSHOLD on %s (%s)", user->nick, parameters[0], parameters[0], reason.c_str()); - ServerInstance->SNO->WriteToSnoMask('A', "%s added permanent SVSHOLD on %s (%s)", user->nick, parameters[0], reason.c_str()); + user->WriteServ( "385 %s %s :Added permanent SVSHOLD on %s (%s)", user->nick, parameters[0].c_str(), parameters[0].c_str(), reason.c_str()); + ServerInstance->SNO->WriteToSnoMask('A', "%s added permanent SVSHOLD on %s (%s)", user->nick, parameters[0].c_str(), reason.c_str()); } } else diff --git a/src/modules/m_swhois.cpp b/src/modules/m_swhois.cpp index c6f26384a..630729e70 100644 --- a/src/modules/m_swhois.cpp +++ b/src/modules/m_swhois.cpp @@ -28,18 +28,18 @@ class CommandSwhois : public Command TRANSLATE3(TR_NICK, TR_TEXT, TR_END); } - CmdResult Handle(const char* const* parameters, int pcnt, User* user) + CmdResult Handle(const std::vector<std::string> ¶meters, User* user) { User* dest = ServerInstance->FindNick(parameters[0]); if (!dest) { - user->WriteNumeric(401, "%s %s :No such nick/channel", user->nick, parameters[0]); + user->WriteNumeric(401, "%s %s :No such nick/channel", user->nick, parameters[0].c_str()); return CMD_FAILURE; } std::string line; - for (int i = 1; i < pcnt; i++) + for (int i = 1; i < (int)parameters.size(); i++) { if (i != 1) line.append(" "); @@ -212,7 +212,7 @@ class ModuleSWhois : public Module } } - virtual void OnPostCommand(const std::string &command, const char* const* params, int pcnt, User *user, CmdResult result, const std::string &original_line) + virtual void OnPostCommand(const std::string &command, const std::vector<std::string> ¶ms, User *user, CmdResult result, const std::string &original_line) { if ((command != "OPER") || (result != CMD_SUCCESS)) return; diff --git a/src/modules/m_taxonomy.cpp b/src/modules/m_taxonomy.cpp index d6cae2a4c..4102737ac 100644 --- a/src/modules/m_taxonomy.cpp +++ b/src/modules/m_taxonomy.cpp @@ -29,7 +29,7 @@ class CommandTaxonomy : public Command syntax = "<nickname>"; } - CmdResult Handle (const char* const* parameters, int pcnt, User *user) + CmdResult Handle (const std::vector<std::string> ¶meters, User *user) { User* dest = ServerInstance->FindNick(parameters[0]); if (dest) diff --git a/src/modules/m_testcommand.cpp b/src/modules/m_testcommand.cpp index bce148adc..b38171593 100644 --- a/src/modules/m_testcommand.cpp +++ b/src/modules/m_testcommand.cpp @@ -26,7 +26,7 @@ class CommandDalinfo : public Command this->source = "m_testcommand.so"; } - CmdResult Handle (const char* const* parameters, int pcnt, User *user) + CmdResult Handle (const std::vector<std::string> ¶meters, User *user) { user->WriteServ("NOTICE %s :*** DALNet had nothing to do with it.", user->nick); return CMD_FAILURE; |