diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-12-30 14:34:49 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-12-30 14:34:49 +0000 |
commit | fce2d243c023660a9afbf01143cde6eda2ec7a88 (patch) | |
tree | fcf7276b29c2b546780e4626d4cdccdd1b08ea8a /src/helperfuncs.cpp | |
parent | 81c26039d5b27f039cbaae53f56fe6eca4123467 (diff) |
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
Diffstat (limited to 'src/helperfuncs.cpp')
-rw-r--r-- | src/helperfuncs.cpp | 25 |
1 files changed, 4 insertions, 21 deletions
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<userrec*>::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<userrec*>::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; |