diff options
Diffstat (limited to 'src/commands')
-rw-r--r-- | src/commands/cmd_admin.cpp | 7 | ||||
-rw-r--r-- | src/commands/cmd_commands.cpp | 6 | ||||
-rw-r--r-- | src/commands/cmd_info.cpp | 7 | ||||
-rw-r--r-- | src/commands/cmd_modules.cpp | 9 | ||||
-rw-r--r-- | src/commands/cmd_whois.cpp | 16 |
5 files changed, 27 insertions, 18 deletions
diff --git a/src/commands/cmd_admin.cpp b/src/commands/cmd_admin.cpp index 3a3eed346..0d6c235f0 100644 --- a/src/commands/cmd_admin.cpp +++ b/src/commands/cmd_admin.cpp @@ -30,7 +30,12 @@ class CommandAdmin : public Command public: /** Constructor for admin. */ - CommandAdmin(Module* parent) : Command(parent,"ADMIN",0,0) { syntax = "[<servername>]"; } + CommandAdmin(Module* parent) : Command(parent,"ADMIN",0,0) + { + Penalty = 2; + syntax = "[<servername>]"; + } + /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/src/commands/cmd_commands.cpp b/src/commands/cmd_commands.cpp index 190c883bd..c45616061 100644 --- a/src/commands/cmd_commands.cpp +++ b/src/commands/cmd_commands.cpp @@ -30,7 +30,11 @@ class CommandCommands : public Command public: /** Constructor for commands. */ - CommandCommands ( Module* parent) : Command(parent,"COMMANDS",0,0) { } + CommandCommands(Module* parent) : Command(parent,"COMMANDS",0,0) + { + Penalty = 3; + } + /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/src/commands/cmd_info.cpp b/src/commands/cmd_info.cpp index b3f146c30..7ee1c4d3b 100644 --- a/src/commands/cmd_info.cpp +++ b/src/commands/cmd_info.cpp @@ -32,7 +32,12 @@ class CommandInfo : public Command public: /** Constructor for info. */ - CommandInfo ( Module* parent) : Command(parent,"INFO") { syntax = "[<servermask>]"; } + CommandInfo(Module* parent) : Command(parent,"INFO") + { + Penalty = 4; + syntax = "[<servername>]"; + } + /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/src/commands/cmd_modules.cpp b/src/commands/cmd_modules.cpp index fe199e7a4..d9fa7d5d5 100644 --- a/src/commands/cmd_modules.cpp +++ b/src/commands/cmd_modules.cpp @@ -31,7 +31,12 @@ class CommandModules : public Command public: /** Constructor for modules. */ - CommandModules ( Module* parent) : Command(parent,"MODULES",0,0) { syntax = "[server]"; } + CommandModules(Module* parent) : Command(parent,"MODULES",0,0) + { + Penalty = 4; + syntax = "[<servername>]"; + } + /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command @@ -74,7 +79,7 @@ CmdResult CommandModules::Handle (const std::vector<std::string>& parameters, Us Module* m = i->second; Version V = m->GetVersion(); - if (user->HasPrivPermission("servers/auspex")) + if (IS_LOCAL(user) && user->HasPrivPermission("servers/auspex")) { std::string flags("SvcC"); int pos = 0; diff --git a/src/commands/cmd_whois.cpp b/src/commands/cmd_whois.cpp index 7e67676ed..e8a751fa0 100644 --- a/src/commands/cmd_whois.cpp +++ b/src/commands/cmd_whois.cpp @@ -80,7 +80,7 @@ void CommandWhois::SplitChanList(User* source, User* dest, const std::string& cl { std::string line; std::ostringstream prefix; - std::string::size_type start, pos, length; + std::string::size_type start, pos; prefix << dest->nick << " :"; line = prefix.str(); @@ -88,23 +88,13 @@ void CommandWhois::SplitChanList(User* source, User* dest, const std::string& cl for (start = 0; (pos = cl.find(' ', start)) != std::string::npos; start = pos+1) { - length = (pos == std::string::npos) ? cl.length() : pos; - - if (line.length() + namelen + length - start > 510) + if (line.length() + namelen + pos - start > 510) { ServerInstance->SendWhoisLine(source, dest, 319, line); line = prefix.str(); } - if(pos == std::string::npos) - { - line.append(cl.substr(start, length - start)); - break; - } - else - { - line.append(cl.substr(start, length - start + 1)); - } + line.append(cl.substr(start, pos - start + 1)); } if (line.length() != prefix.str().length()) |