summaryrefslogtreecommitdiff
path: root/src/inspircd.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-05 22:22:07 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-05 22:22:07 +0000
commita02cf48addf0daf0f3d68b7aeb7df2d478079e45 (patch)
tree5b75be4ad26470d354cd88f1fab7f762afad34e9 /src/inspircd.cpp
parent83210d2ab473e0faa4bd60b3ef05cfc7f557ec0c (diff)
Fix to bug #33 (weird /map)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@987 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r--src/inspircd.cpp12
1 files changed, 11 insertions, 1 deletions
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)
{