X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcoremods%2Fcore_stats.cpp;h=a282089e37de65ce106024be53775124687e7e73;hb=23f30d75fa4375e8818016367df6d0851c7651ac;hp=69f1f3cf89e384d16568cf608e1231781cf30911;hpb=761e6d75ba37b984998952940ed681e79e456142;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/coremods/core_stats.cpp b/src/coremods/core_stats.cpp index 69f1f3cf8..a282089e3 100644 --- a/src/coremods/core_stats.cpp +++ b/src/coremods/core_stats.cpp @@ -35,7 +35,7 @@ class CommandStats : public Command public: /** Constructor for stats. */ - CommandStats ( Module* parent) : Command(parent,"STATS",1,2) { syntax = " []"; } + CommandStats ( Module* parent) : Command(parent,"STATS",1,2) { allow_empty_last_param = false; syntax = " []"; } /** 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& parameters, User *user); RouteDescriptor GetRouting(User* user, const std::vector& 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 }