]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/users.cpp
Minor improvements to the codepage module.
[user/henk/code/inspircd.git] / src / users.cpp
index 01bad8b619bce48edbfc179b25eaf208fcafa199..82f2545f4df730b043c92d722eeeaccaa0314566 100644 (file)
@@ -78,6 +78,9 @@ User::User(const std::string& uid, Server* srv, UserType type)
 
        ServerInstance->Logs->Log("USERS", LOG_DEBUG, "New UUID for user: %s", uuid.c_str());
 
+       if (srv->IsULine())
+               ServerInstance->Users->uline_count++;
+
        // Do not insert FakeUsers into the uuidlist so FindUUID() won't return them which is the desired behavior
        if (type != USERTYPE_SERVER)
        {
@@ -112,8 +115,8 @@ LocalUser::LocalUser(int myfd, irc::sockets::sockaddrs* client, irc::sockets::so
        ChangeRealHost(GetIPString(), true);
 }
 
-LocalUser::LocalUser(int myfd, const std::string& uuid, Serializable::Data& data)
-       : User(uuid, ServerInstance->FakeClient->server, USERTYPE_LOCAL)
+LocalUser::LocalUser(int myfd, const std::string& uid, Serializable::Data& data)
+       : User(uid, ServerInstance->FakeClient->server, USERTYPE_LOCAL)
        , eh(this)
        , already_sent(0)
 {
@@ -339,6 +342,9 @@ CullResult User::cull()
        if (client_sa.family() != AF_UNSPEC)
                ServerInstance->Users->RemoveCloneCounts(this);
 
+       if (server->IsULine() && ServerInstance->Users->uline_count)
+               ServerInstance->Users->uline_count--;
+
        return Extensible::cull();
 }
 
@@ -758,17 +764,16 @@ void LocalUser::SetClientIP(const irc::sockets::sockaddrs& sa)
                return;
 
        ServerInstance->Users->RemoveCloneCounts(this);
-
        User::SetClientIP(sa);
-
-       FOREACH_MOD(OnSetUserIP, (this));
-
        ServerInstance->Users->AddClone(this);
 
        // Recheck the connect class.
        this->MyClass = NULL;
        this->SetClass();
        this->CheckClass();
+
+       if (!quitting)
+               FOREACH_MOD(OnSetUserIP, (this));
 }
 
 void LocalUser::Write(const ClientProtocol::SerializedMessage& text)
@@ -854,7 +859,7 @@ void User::WriteNumeric(const Numeric::Numeric& numeric)
 
 void User::WriteRemoteNotice(const std::string& text)
 {
-       ServerInstance->PI->SendUserNotice(this, text);
+       ServerInstance->PI->SendMessage(this, text, MSG_NOTICE);
 }
 
 void LocalUser::WriteRemoteNotice(const std::string& text)
@@ -1198,10 +1203,24 @@ const std::string& FakeUser::GetFullRealHost()
 }
 
 ConnectClass::ConnectClass(ConfigTag* tag, char t, const std::string& mask)
-       : config(tag), type(t), fakelag(true), name("unnamed"), registration_timeout(0), host(mask),
-       pingtime(0), softsendqmax(0), hardsendqmax(0), recvqmax(0),
-       penaltythreshold(0), commandrate(0), maxlocal(0), maxglobal(0), maxconnwarn(true), maxchans(ServerInstance->Config->MaxChans),
-       limit(0), resolvehostnames(true)
+       : config(tag)
+       , type(t)
+       , fakelag(true)
+       , name("unnamed")
+       , registration_timeout(0)
+       , host(mask)
+       , pingtime(0)
+       , softsendqmax(0)
+       , hardsendqmax(0)
+       , recvqmax(0)
+       , penaltythreshold(0)
+       , commandrate(0)
+       , maxlocal(0)
+       , maxglobal(0)
+       , maxconnwarn(true)
+       , maxchans(0)
+       , limit(0)
+       , resolvehostnames(true)
 {
 }