diff options
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_tline.cpp | 10 | ||||
-rw-r--r-- | src/modules/m_uninvite.cpp | 6 | ||||
-rw-r--r-- | src/modules/m_userip.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_vhost.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_watch.cpp | 14 |
5 files changed, 19 insertions, 19 deletions
diff --git a/src/modules/m_tline.cpp b/src/modules/m_tline.cpp index 02c467640..7dc960c5a 100644 --- a/src/modules/m_tline.cpp +++ b/src/modules/m_tline.cpp @@ -27,7 +27,7 @@ class CommandTline : public Command this->syntax = "<mask>"; } - CmdResult Handle (const char* const* parameters, int pcnt, User *user) + CmdResult Handle (const std::vector<std::string> ¶meters, User *user) { float n_counted = 0; float n_matched = 0; @@ -37,7 +37,7 @@ class CommandTline : public Command for (user_hash::const_iterator u = ServerInstance->Users->clientlist->begin(); u != ServerInstance->Users->clientlist->end(); u++) { n_counted++; - if (match(u->second->GetFullRealHost(),parameters[0])) + if (match(u->second->GetFullRealHost(),parameters[0].c_str())) { n_matched++; n_match_host++; @@ -46,7 +46,7 @@ class CommandTline : public Command { char host[MAXBUF]; snprintf(host, MAXBUF, "%s@%s", u->second->ident, u->second->GetIPString()); - if (match(host, parameters[0], true)) + if (match(host, parameters[0].c_str(), true)) { n_matched++; n_match_ip++; @@ -54,9 +54,9 @@ class CommandTline : public Command } } if (n_matched) - user->WriteServ( "NOTICE %s :*** TLINE: Counted %0.0f user(s). Matched '%s' against %0.0f user(s) (%0.2f%% of the userbase). %0.0f by hostname and %0.0f by IP address.",user->nick, n_counted, parameters[0], n_matched, (n_matched/n_counted)*100, n_match_host, n_match_ip); + user->WriteServ( "NOTICE %s :*** TLINE: Counted %0.0f user(s). Matched '%s' against %0.0f user(s) (%0.2f%% of the userbase). %0.0f by hostname and %0.0f by IP address.",user->nick, n_counted, parameters[0].c_str(), n_matched, (n_matched/n_counted)*100, n_match_host, n_match_ip); else - user->WriteServ( "NOTICE %s :*** TLINE: Counted %0.0f user(s). Matched '%s' against no user(s).", user->nick, n_counted, parameters[0]); + user->WriteServ( "NOTICE %s :*** TLINE: Counted %0.0f user(s). Matched '%s' against no user(s).", user->nick, n_counted, parameters[0].c_str()); return CMD_LOCALONLY; } diff --git a/src/modules/m_uninvite.cpp b/src/modules/m_uninvite.cpp index 9940d46d8..680b774a4 100644 --- a/src/modules/m_uninvite.cpp +++ b/src/modules/m_uninvite.cpp @@ -27,7 +27,7 @@ class CommandUninvite : 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* u = ServerInstance->FindNick(parameters[0]); Channel* c = ServerInstance->FindChan(parameters[1]); @@ -36,11 +36,11 @@ class CommandUninvite : public Command { if (!c) { - user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick, parameters[1]); + user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick, parameters[1].c_str()); } else { - 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; diff --git a/src/modules/m_userip.cpp b/src/modules/m_userip.cpp index c672b1483..d7c5792e8 100644 --- a/src/modules/m_userip.cpp +++ b/src/modules/m_userip.cpp @@ -26,11 +26,11 @@ class CommandUserip : public Command syntax = "<nick>{,<nick>}"; } - CmdResult Handle (const char* const* parameters, int pcnt, User *user) + CmdResult Handle (const std::vector<std::string> ¶meters, User *user) { std::string retbuf = std::string("340 ") + user->nick + " :"; - for (int i = 0; i < pcnt; i++) + for (int i = 0; i < (int)parameters.size(); i++) { User *u = ServerInstance->FindNick(parameters[i]); if ((u) && (u->registered == REG_ALL)) diff --git a/src/modules/m_vhost.cpp b/src/modules/m_vhost.cpp index d4ccba276..ecc67b19e 100644 --- a/src/modules/m_vhost.cpp +++ b/src/modules/m_vhost.cpp @@ -26,7 +26,7 @@ class CommandVhost : public Command syntax = "<username> <password>"; } - CmdResult Handle (const char* const* parameters, int pcnt, User *user) + CmdResult Handle (const std::vector<std::string> ¶meters, User *user) { ConfigReader *Conf = new ConfigReader(ServerInstance); @@ -37,7 +37,7 @@ class CommandVhost : public Command std::string pass = Conf->ReadValue("vhost","pass",index); std::string hash = Conf->ReadValue("vhost","hash",index); - if ((!strcmp(parameters[0],username.c_str())) && !ServerInstance->PassCompare(user, pass.c_str(), parameters[1], hash.c_str())) + if ((!strcmp(parameters[0].c_str(),username.c_str())) && !ServerInstance->PassCompare(user, pass.c_str(), parameters[1].c_str(), hash.c_str())) { if (!mask.empty()) { diff --git a/src/modules/m_watch.cpp b/src/modules/m_watch.cpp index 19521dba6..ddb6f2667 100644 --- a/src/modules/m_watch.cpp +++ b/src/modules/m_watch.cpp @@ -110,7 +110,7 @@ class CommandSVSWatch : public Command TRANSLATE3(TR_NICK, TR_TEXT, TR_END); /* we watch for a nick. not a UID. */ } - CmdResult Handle (const char* const* parameters, int pcnt, User *user) + CmdResult Handle (const std::vector<std::string> ¶meters, User *user) { if (!ServerInstance->ULine(user->server)) return CMD_FAILURE; @@ -121,7 +121,7 @@ class CommandSVSWatch : public Command if (IS_LOCAL(u)) { - ServerInstance->Parser->CallHandler("WATCH", ¶meters[1], 1, u); + ServerInstance->Parser->CallHandler("WATCH", parameters, u); } return CMD_SUCCESS; @@ -261,9 +261,9 @@ class CommandWatch : public Command TRANSLATE2(TR_TEXT, TR_END); /* we watch for a nick. not a UID. */ } - CmdResult Handle (const char* const* parameters, int pcnt, User *user) + CmdResult Handle (const std::vector<std::string> ¶meters, User *user) { - if (!pcnt) + if (!parameters.size()) { watchlist* wl; if (user->GetExt("watchlist", wl)) @@ -276,11 +276,11 @@ class CommandWatch : public Command } user->WriteNumeric(607, "%s :End of WATCH list",user->nick); } - else if (pcnt > 0) + else if (parameters.size() > 0) { - for (int x = 0; x < pcnt; x++) + for (int x = 0; x < (int)parameters.size(); x++) { - const char *nick = parameters[x]; + const char *nick = parameters[x].c_str(); if (!strcasecmp(nick,"C")) { // watch clear |