Logo Search packages:      
Sourcecode: verlihub version File versions

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

Things done when the protocol login is done

Definition at line 662 of file cserverdc.cpp.

References DCPrivateHS(), DCPublicHS(), DCPublicHSToAll(), nDirectConnect::cUser::DisplayInfo(), nDirectConnect::nTables::cDCConf::hub_desc, cObj::Log(), cObj::LogStream(), nDirectConnect::cConnDC::mCC, nDirectConnect::cUserBase::mClass, nDirectConnect::cUserBase::mNick, nDirectConnect::cConnDC::mpUser, nDirectConnect::nTables::cRegUserInfo::mPwdChange, nDirectConnect::cConnDC::mRegInfo, nDirectConnect::nTables::cDCConf::msg_change_pwd, nDirectConnect::nTables::cDCConf::msg_welcome, nDirectConnect::cDCConsole::mTriggers, nDirectConnect::cConnDC::Send(), nDirectConnect::nTables::cDCConf::send_user_info, nDirectConnect::cConnDC::SetTimeOut(), nDirectConnect::nTables::cDCConf::timeout_length, and nDirectConnect::nTables::cTriggers::TriggerAll().

Referenced by DoUserLogin().

{
      string omsg;

      if(conn->Log(3)) conn->LogStream() << "Entered the hub." << endl;
      mCo->mTriggers->TriggerAll(cTrigger::eTF_MOTD, conn);

      // user has to change password
      if(conn->mRegInfo && conn->mRegInfo->mPwdChange)
      {
            omsg = mC.msg_change_pwd;
            DCPrivateHS(omsg, conn);
            DCPublicHS(omsg, conn);
            conn->SetTimeOut(eTO_SETPASS, mC.timeout_length[eTO_SETPASS], this->mTime);
      }

      // send the hub topic
      string topic("$HubTopic ");
      topic += mC.hub_desc + "|";
      conn->Send(topic, false);

      if (mC.send_user_info)
      {
            ostringstream os;
            os << "Your info: \r\n";
            conn->mpUser->DisplayInfo(os, eUC_OPERATOR);
            omsg = os.str();
            DCPublicHS(omsg,conn);
      }

      if( mUserList.size() > mUsersPeak ) mUsersPeak = mUserList.size();
      #ifndef WITHOUT_PLUGINS
      mCallBacks.mOnUserLogin.CallAll(conn->mpUser);
      #endif

      if ((conn->mpUser->mClass >= eUC_NORMUSER) && (conn->mpUser->mClass <= eUC_MASTER)) {
            if (mC.msg_welcome[conn->mpUser->mClass].size()) {
                  string ToSend;
                  ReplaceVarInString(mC.msg_welcome[conn->mpUser->mClass], "nick", ToSend, conn->mpUser->mNick);
                  ReplaceVarInString(ToSend, "CC", ToSend, conn->mCC);
                  DCPublicHSToAll(ToSend);
            }
      }
}


Generated by  Doxygen 1.6.0   Back to index