Logo Search packages:      
Sourcecode: verlihub version File versions

bool nDirectConnect::cServerDC::BeginUserLogin ( cConnDC conn  )  [protected]

start the user becomiing in the userlist

Definition at line 773 of file cserverdc.cpp.

References nDirectConnect::cUserCollection::Add(), nDirectConnect::cConnDC::CloseNow(), nDirectConnect::nTables::cDCConf::delayed_login, DoUserLogin(), nDirectConnect::cConnDC::GetLSFlag(), cObj::Log(), cObj::LogStream(), nDirectConnect::cUserBase::mInList, nDirectConnect::cConnDC::mpUser, nDirectConnect::cConnDC::mSendNickList, nDirectConnect::nProtocol::cDCProto::NickList(), and VerifyUniqueNick().

Referenced by nDirectConnect::nProtocol::cDCProto::DC_MyINFO().

{
      // If user asks for nicklist, then the login will happen after the sending of nicklist ends
      // otherwise it will happen now
      int WantedMask;
      if (mC.delayed_login)
            WantedMask = eLS_LOGIN_DONE - eLS_NICKLST;
      else
            WantedMask = eLS_LOGIN_DONE;
      
      if(WantedMask == conn->GetLSFlag(WantedMask))
      {
            if(conn->Log(2)) conn->LogStream() << "Begin login" << endl;
            if(VerifyUniqueNick(conn))
            {
                  if (!mC.delayed_login) 
                  {
                        DoUserLogin(conn);
                  }
                  else
                  {
                        mInProgresUsers.Add(conn->mpUser);
                  }
                  
                  if (conn->mSendNickList)
                  {
                        // this may won't send all data at once...
                        mP.NickList(conn);      // this will set mNickListInProgress
                        conn->mSendNickList = false;
                        return true;      // return here since we don't know that the list was sent or not
                                    // OnFlushDone() will do the login after the NickList is flushed
                  }
                  if(!conn->mpUser->mInList)
                  {
                        DoUserLogin(conn);
                  }
            }
            else
            {
                  return false;
            }
      } else {
            cout << conn->GetLSFlag(eLS_LOGIN_DONE) << " " << eLS_LOGIN_DONE << endl;
            conn->CloseNow();
            return false;
      }
}


Generated by  Doxygen 1.6.0   Back to index