Logo Search packages:      
Sourcecode: verlihub version File versions

bool nDirectConnect::cServerDC::ShowUserToAll ( cUserBase user  ) 

patch eventually for ops

Definition at line 823 of file cserverdc.cpp.

References nDirectConnect::nTables::cDCConf::delayed_login, nDirectConnect::nTables::cDCConf::delayed_myinfo, nDirectConnect::cUserCollection::FlushCache(), nDirectConnect::nProtocol::cDCProto::GetMyInfo(), nDirectConnect::cUserBase::mClass, nDirectConnect::cUserBase::mInList, nDirectConnect::cUserBase::mNick, nDirectConnect::cUserCollection::SendToAll(), and nDirectConnect::nTables::cDCConf::show_tags.

Referenced by DoUserLogin().

{
      string omsg;

      // only Hello users get hello message
      omsg = "$Hello ";
      omsg+= user->mNick;
      mHelloUsers.SendToAll(omsg, mC.delayed_myinfo);

      // all users get myinfo, event hose in progress 
      // (hello users in progres are ignored, they are obsolete btw)
      omsg = mP.GetMyInfo(user, eUC_NORMUSER);
      mUserList.SendToAll(omsg, mC.delayed_myinfo); // use cache -> so this can be after user is added
      mInProgresUsers.SendToAll(omsg, mC.delayed_myinfo);

      // distribute oplist
      if(user->mClass >= eUC_OPERATOR) {
            mUserList.SendToAll(OpList, UseChache);
            mInProgresUsers.SendToAll(OpList, UseChache);
      }

      // send it to all but to him
      // but why ? maybe he would be doubled in some shi** clients ?
      // anyway delayed_login will show why is it..
      // the order of flush of this before the full myinfo for ops
      if(!mC.delayed_login)   {
            user->mInList = false;
            mUserList.FlushCache();
            mInProgresUsers.FlushCache();
            user->mInList = true;
      }

      /// patch eventually for ops
      if(mC.show_tags == 1)   {
            omsg = mP.GetMyInfo(user, eUC_OPERATOR);
            mOpchatList.SendToAll(omsg, mC.delayed_myinfo); // must send after mUserList! Cached mUserList will be flushed after and will override this one!
            mInProgresUsers.SendToAll(omsg, mC.delayed_myinfo); // send later, better more people see tags, then some ops not, 
            // ops are dangerous creatures, they may have idea to kick people for not seeing their tags
      }
      return true;
}


Generated by  Doxygen 1.6.0   Back to index