]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/users.cpp
Changed m_messageflood to use PreMessage and PreNotice, because it may kick the user
[user/henk/code/inspircd.git] / src / users.cpp
index efaffd2dd40440931862e30cc9dc4c04ed703670..cbf9de0cdcc8a038c0331b7ab08a9317f952e747 100644 (file)
@@ -923,16 +923,12 @@ void userrec::AddClient(InspIRCd* Instance, int socket, int port, bool iscached,
                return;
        }
 
+       /*
+        * Check connect class settings and initialise settings into userrec.
+        * This will be done again after DNS resolution. -- w00t
+        */
        New->CheckClass();
 
-       New->pingmax = i->GetPingTime();
-       New->nping = Instance->Time() + i->GetPingTime() + Instance->Config->dns_timeout;
-       New->timeout = Instance->Time() + i->GetRegTimeout();
-       New->flood = i->GetFlood();
-       New->threshold = i->GetThreshold();
-       New->sendqmax = i->GetSendqMax();
-       New->recvqmax = i->GetRecvqMax();
-
        Instance->local_users.push_back(New);
 
        if ((Instance->local_users.size() > Instance->Config->SoftLimit) || (Instance->local_users.size() >= MAXCLIENTS))
@@ -1032,6 +1028,14 @@ void userrec::CheckClass()
                ServerInstance->WriteOpers("*** WARNING: maximum GLOBAL connections (%ld) exceeded for IP %s", a->GetMaxGlobal(), this->GetIPString());
                return;
        }
+
+       this->pingmax = a->GetPingTime();
+       this->nping = ServerInstance->Time() + a->GetPingTime() + ServerInstance->Config->dns_timeout;
+       this->timeout = ServerInstance->Time() + a->GetRegTimeout();
+       this->flood = a->GetFlood();
+       this->threshold = a->GetThreshold();
+       this->sendqmax = a->GetSendqMax();
+       this->recvqmax = a->GetRecvqMax();
 }
 
 void userrec::FullConnect()
@@ -1354,7 +1358,7 @@ const char* userrec::GetIPString(char* buf)
  */
 void userrec::Write(std::string text)
 {
-       if (ServerInstance->SE->BoundsCheckFd(this))
+       if (!ServerInstance->SE->BoundsCheckFd(this))
                return;
 
        try