From a02cf48addf0daf0f3d68b7aeb7df2d478079e45 Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 5 Apr 2005 22:22:07 +0000 Subject: Fix to bug #33 (weird /map) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@987 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/inspircd.cpp') diff --git a/src/inspircd.cpp b/src/inspircd.cpp index bd2828ec9..e5bab171d 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -2252,12 +2252,22 @@ void AddClient(int socket, char* host, int port, bool iscached, char* ip) } } - +// this function counts all users connected, wether they are registered or NOT. int usercnt(void) { return clientlist.size(); } +// this counts only registered users, so that the percentages in /MAP don't mess up when users are sitting in an unregistered state +int registered_usercount(void) +{ + int c = 0; + for (user_hash::const_iterator i = clientlist.begin(); i != clientlist.end(); i++) + { + if ((i->second->fd) && (isnick(i->second->nick))) c++; + } + return c; +} int usercount_invisible(void) { -- cgit v1.3.1-10-gc9f91