Logo Search packages:      
Sourcecode: verlihub version File versions

void nDirectConnect::cServerDC::DoUserLogin ( cConnDC conn  )  [protected]

is called when user is about to get into the userslist

Definition at line 708 of file cserverdc.cpp.

References nDirectConnect::nTables::cBanList::AddIPTempBan(), nDirectConnect::nTables::cBanList::AddNickTempBan(), AddToList(), AfterUserLogin(), nDirectConnect::cUser::ApplyRights(), nDirectConnect::cUserCollection::ufDoNickList::Clear(), nDirectConnect::cConnDC::ClearTimeOut(), nDirectConnect::cConnDC::CloseNow(), nDirectConnect::cUserCollection::ContainsNick(), cObj::ErrLog(), nDirectConnect::cUserCollection::FlushForUser(), nDirectConnect::cConnDC::GetLSFlag(), nServer::cAsyncConn::GetSockAddress(), nDirectConnect::cConnDC::GetTheoricalClass(), nDirectConnect::nTables::cDCConf::int_login, nDirectConnect::nTables::cPenaltyList::LoadTo(), cObj::LogStream(), nDirectConnect::nTables::cDCConf::max_class_int_login, mBanList, nDirectConnect::cUserBase::mClass, nDirectConnect::cUserBase::mNick, nDirectConnect::cConnDC::mpUser, nDirectConnect::cUser::mT, nServer::cAsyncSocketServer::mTime, nDirectConnect::cUserCollection::Remove(), nUtils::cTime::Sec(), nDirectConnect::cConnDC::Send(), nDirectConnect::nTables::cDCConf::send_user_ip, nDirectConnect::cUserCollection::SendToAll(), ShowUserToAll(), and VerifyUniqueNick().

Referenced by BeginUserLogin(), and nDirectConnect::cConnDC::OnFlushDone().

{
      // verify we didn't get here by chance
      if(eLS_LOGIN_DONE != conn->GetLSFlag(eLS_LOGIN_DONE))
      {
            if(conn->ErrLog(2)) conn->LogStream() << "User Login when not all done"<<endl;
            conn->CloseNow();
            return;
      }

      // check if same nick already exists
      if (! VerifyUniqueNick(conn)) return;

      // he is not anymore in progress
      if (mInProgresUsers.ContainsNick(conn->mpUser->mNick))
      {
            mInProgresUsers.FlushForUser(conn->mpUser);
            mInProgresUsers.Remove(conn->mpUser);
      }
      
      // anti login flood temp bans
      if (conn->GetTheoricalClass() <= mC.max_class_int_login){
            mBanList->AddNickTempBan(conn->mpUser->mNick, mTime.Sec() + mC.int_login, "login later");
            mBanList->AddIPTempBan(conn->GetSockAddress(), mTime.Sec() + mC.int_login, "login later");
      }

      // users special rights and restrictions
      cPenaltyList::sPenalty pen;
      if (mPenList->LoadTo(pen, conn->mpUser->mNick) && 
                  (conn->mpUser->mClass != eUC_PINGER))
            conn->mpUser->ApplyRights(pen);

      // insert user to userlist
      if(!AddToList(conn->mpUser))
      {
            conn->CloseNow();
            return;
      }

      // display user to others
      ShowUserToAll(conn->mpUser);
      
      if( mC.send_user_ip )
      {
            if( conn->mpUser->mClass >= eUC_OPERATOR )
            {
                  conn->Send(mUserList.GetIPList(),true);
            }
            else
            {
                  string UserIP;
                  cCompositeUserCollection::ufDoIpList DoUserIP(UserIP);
                  DoUserIP.Clear();
                  DoUserIP(conn->mpUser);
                  mOpchatList.SendToAll(UserIP, true, true);
                  conn->Send(UserIP);
            }
      }

      AfterUserLogin(conn);
      
      conn->ClearTimeOut(eTO_LOGIN);
      conn->mpUser->mT.login.Get();
}


Generated by  Doxygen 1.6.0   Back to index