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/users.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/users.cpp') diff --git a/src/users.cpp b/src/users.cpp index 44947fa6c..e4f63e3ba 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -766,7 +766,11 @@ void userrec::QuitUser(InspIRCd* Instance, userrec *user, const std::string &qui if (reason.length() > MAXQUIT - 1) reason.resize(MAXQUIT - 1); - + + if (user->registered != REG_ALL) + if (Instance->unregistered_count) + Instance->unregistered_count--; + if (IS_LOCAL(user)) { user->Write("ERROR :Closing link (%s@%s) [%s]",user->ident,user->host,reason.c_str()); @@ -983,6 +987,8 @@ void userrec::AddClient(InspIRCd* Instance, int socket, int port, bool iscached, userrec* New; int j = 0; + Instance->unregistered_count++; + /* * fix by brain. * as these nicknames are 'RFC impossible', we can be sure nobody is going to be @@ -1177,6 +1183,10 @@ void userrec::FullConnect(CullList* Goners) this->ShowMOTD(); + /* Now registered */ + if (ServerInstance->unregistered_count) + ServerInstance->unregistered_count--; + /* * fix 3 by brain, move registered = 7 below these so that spurious modes and host * changes dont go out onto the network and produce 'fake direction'. -- cgit v1.3.1-10-gc9f91