]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/coremods/core_stats.cpp
Undocument <power> and set the default to the server name.
[user/henk/code/inspircd.git] / src / coremods / core_stats.cpp
index 69f1f3cf89e384d16568cf608e1231781cf30911..a282089e37de65ce106024be53775124687e7e73 100644 (file)
@@ -35,7 +35,7 @@ class CommandStats : public Command
  public:
        /** Constructor for stats.
         */
-       CommandStats ( Module* parent) : Command(parent,"STATS",1,2) { syntax = "<stats-symbol> [<servername>]"; }
+       CommandStats ( Module* parent) : Command(parent,"STATS",1,2) { allow_empty_last_param = false; syntax = "<stats-symbol> [<servername>]"; }
        /** Handle command.
         * @param parameters The parameters to the command
         * @param user The user issuing the command
@@ -44,7 +44,7 @@ class CommandStats : public Command
        CmdResult Handle(const std::vector<std::string>& parameters, User *user);
        RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
        {
-               if (parameters.size() > 1)
+               if ((parameters.size() > 1) && (parameters[1].find('.') != std::string::npos))
                        return ROUTE_UNICAST(parameters[1]);
                return ROUTE_LOCALONLY;
        }
@@ -307,7 +307,7 @@ void CommandStats::DoStats(Stats::Context& stats)
                                n_eaten = (double)(( (uint64_t)(KernelTime.dwHighDateTime) << 32 ) + (uint64_t)(KernelTime.dwLowDateTime))/100000;
                                per = (n_eaten / n_elapsed);
                                snprintf(percent, 30, "%03.5f%%", per);
-                               stats.AddRow(249, std::string("CPU Use (total):  ")+percent));
+                               stats.AddRow(249, std::string("CPU Use (total):  ")+percent);
                        }
 #endif
                }