+
+ ModResult OnStats(char symbol, User* user, string_list &out)
+ {
+ if (symbol != 'G')
+ return MOD_RES_PASSTHRU;
+
+ unsigned int unknown = 0;
+ std::map<std::string, unsigned int> results;
+ for (LocalUserList::const_iterator i = ServerInstance->Users->local_users.begin(); i != ServerInstance->Users->local_users.end(); ++i)
+ {
+ std::string* cc = ext.get(*i);
+ if (cc)
+ results[*cc]++;
+ else
+ unknown++;
+ }
+
+ std::string p = ServerInstance->Config->ServerName + " 801 " + user->nick + " :GeoIPSTATS ";
+ for (std::map<std::string, unsigned int>::const_iterator i = results.begin(); i != results.end(); ++i)
+ {
+ out.push_back(p + i->first + " " + ConvToStr(i->second));
+ }
+
+ if (unknown)
+ out.push_back(p + "Unknown " + ConvToStr(unknown));
+
+ return MOD_RES_DENY;
+ }