- // dump the whole lot to the user. This is the easy bit, honest.
- for (int t = 0; t < line; t++)
+ float avg_users = totusers * 1.0 / totservers;
+
+ // dump the whole lot to the user.
+ if (IS_LOCAL(user))
+ {
+ ServerInstance->Logs->Log("map",DEBUG,"local");
+ for (int t = 0; t < line; t++)
+ {
+ // terminate the string at maxnamew characters
+ names[100 * t + maxnamew] = '\0';
+ user->WriteNumeric(RPL_MAP, "%s :%s %s",user->nick.c_str(),names + 100 * t, stats + 50 * t);
+ }
+ user->WriteNumeric(RPL_MAPUSERS, "%s :%d server%s and %d user%s, average %.2f users per server",user->nick.c_str(),totservers,(totservers > 1 ? "s" : ""),totusers,(totusers > 1 ? "s" : ""),avg_users);
+ user->WriteNumeric(RPL_ENDMAP, "%s :End of /MAP",user->nick.c_str());
+ }
+ else