返回服务器列表信息:
CBalanceSession 返回登陆成功:
bool CBalanceSession::Msg_Handle_OneClientLoginCheck( const char* pMsg, int n32MsgLength, INetSession* vthis, int n32MsgID )
{
ELOG(LOG_DBBUG, " CBalanceSession::Msg_Handle_OneClientLoginCheck");
std::auto_ptr<GCToBS::OneClinetLogin> sOneClientLogin(new GCToBS::OneClinetLogin);
bool bRet = sOneClientLogin->ParseFromArray(pMsg,n32MsgLength);
if (!bRet){
ELOG(LOG_ERROR, "Fail with Msg Error.");
return true;
}
LoginUserMap& lAllLoginUserInfo = SdkConnector::GetInstance().GetLoginUserMap();
string sessionid = "";
if (sOneClientLogin->plat() == ePlatform_PC){
stringstream ss;
ss<<sOneClientLogin->plat();
ss<<sOneClientLogin->uin();
ss>>sessionid;
ELOG(LOG_DBBUG , "meimei sessionid:%s",sessionid);
}
else{
sessionid = sOneClientLogin->sessionid();
}
auto it = lAllLoginUserInfo.find(sessionid);
if (it != lAllLoginUserInfo.end()){
sOneClientLogin->set_login_success(true);
sOneClientLogin->set_uin(it->second.uin);
lAllLoginUserInfo.erase(it);
ELOG(LOG_DBBUG, "Erase uid:%s", sOneClientLogin->uin().c_str());
}
else{
ELOG(LOG_WARNNING, "Fail With User with uin(%s) Not Find.", sOneClientLogin->uin().c_str());
sOneClientLogin->set_login_success(false);
}
INetSessionMgr::GetInstance()->SendMsgToSession(ST_SERVER_LS_OnlyBS,vthis->GetID(),*sOneClientLogin, LSToBS::eMsgToBSFromLS_OneClinetLoginCheckRet);
return true;
}
FR:海涛高软(hunk Xu) QQ技术交流群:386476712