From fce2d243c023660a9afbf01143cde6eda2ec7a88 Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 30 Dec 2006 14:34:49 +0000 Subject: Add unregistered user counter, this may also fix the (minor) m_conn_lusers shows current connection as unregged git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6170 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/helperfuncs.cpp | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) (limited to 'src/helperfuncs.cpp') diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index ff6d6035a..5662c6914 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -330,16 +330,7 @@ int InspIRCd::OperCount() int InspIRCd::UnregisteredUserCount() { - int c = 0; - - for (std::vector::const_iterator i = local_users.begin(); i != local_users.end(); i++) - { - userrec* t = (userrec*)(*i); - if (t->registered != REG_ALL) - c++; - } - - return c; + return this->unregistered_count; } long InspIRCd::ChannelCount() @@ -349,18 +340,10 @@ long InspIRCd::ChannelCount() long InspIRCd::LocalUserCount() { - int c = 0; - - for (std::vector::const_iterator i = local_users.begin(); i != local_users.end(); i++) - { - userrec* t = (userrec*)(*i); - if (t->registered == REG_ALL) - c++; - } - - return c; + /* Doesnt count unregistered clients */ + return (local_users.size() - this->UnregisteredUserCount()); } - + bool InspIRCd::IsChannel(const char *chname) { char *c; -- cgit v1.3.1-10-gc9f91