void CPlayer::OnAnotherClientLoginThisPeer(unsigned int nSessionID ) { // tell prelogin client to disconnect ; stMsgPlayerOtherLogin msg ; SendMsgToClient((char*)&msg,sizeof(msg)) ; LOGFMTE("pls remember inform other server this envent OnAnotherClientLoginThisPeer ") ; for ( int i = ePlayerComponent_None; i < ePlayerComponent_Max ; ++i ) { IPlayerComponent* p = m_vAllComponents[i] ; if ( p ) { p->OnOtherWillLogined(); } } // bind new client ; m_nSessionID = nSessionID ; m_eSate = ePlayerState_Online; for ( int i = ePlayerComponent_None; i < ePlayerComponent_Max ; ++i ) { IPlayerComponent* p = m_vAllComponents[i] ; if ( p ) { p->OnOtherDoLogined(); } } }
void CPlayer::OnAnotherClientLoginThisPeer(unsigned int nSessionID ) { // tell prelogin client to disconnect ; stMsgPlayerOtherLogin msg ; SendMsgToClient((char*)&msg,sizeof(msg)) ; if ( m_nTaxasRoomID != 0 ) // order to leave { stMsgOrderTaxasPlayerLeave msgLeave ; msgLeave.nRoomID = m_nTaxasRoomID ; CGameServerApp::SharedGameServerApp()->SendMsg(GetSessionID(),(char*)&msgLeave,sizeof(msgLeave) ) ; } CLogMgr::SharedLogMgr()->ErrorLog("pls remember inform other server this envent OnAnotherClientLoginThisPeer ") ; for ( int i = ePlayerComponent_None; i < ePlayerComponent_Max ; ++i ) { IPlayerComponent* p = m_vAllComponents[i] ; if ( p ) { p->OnOtherWillLogined(); } } // bind new client ; m_nSessionID = nSessionID ; for ( int i = ePlayerComponent_None; i < ePlayerComponent_Max ; ++i ) { IPlayerComponent* p = m_vAllComponents[i] ; if ( p ) { p->OnOtherDoLogined(); } } }