void ForSClientMsgHandler::ServerToClient(BaseSession* pSessioin,const NetMsgHead* pHead,int32 nSize) { ClientSession* pClientSession = ClientSessionMgr::Instance()->GetSession(pHead->nClientSessionID); if(pClientSession == NULL) { return; } pClientSession->SendMsg(const_cast<NetMsgHead*>(pHead),nSize); }
void ForSClientMsgHandler::NofityClientSessionInfo(BaseSession* pSession, const NetMsgHead* pMsg,int32 nSize) { //---------------------------------服务组代码begin------------------------------- ServerCommonHandler::ForServerUpdataClientUpConnectInfo(pSession,pMsg,ESERVER_TYPE_FEP); //---------------------------------服务组代码end------------------------------- int32 nClientSessionID = pMsg->nClientSessionID; ClientSession* pClientSession = ClientSessionMgr::Instance()->GetSession(nClientSessionID); if (pClientSession == NULL) { printf("Not Found ClientSession\n"); return; } int32 nClientStatus = pClientSession->Status(); if(nClientStatus == E_CLIENT_STATUS_NOTIFY_INITED) { F2CLoginReadyFinish sMsg; pClientSession->SendMsg(&sMsg,sMsg.GetPackLength()); } }
virtual void QueryResult(IDbRecordSet* pSet, int32 nCount) { const DbRecordSet* pRecordSet = static_cast<const DbRecordSet*>(pSet); if (pRecordSet->Rows() > 0) { if (int64 nAccountId = *static_cast<int64*>(pRecordSet->GetRecordData(0))) { // 返回登录结果成功 D2LAccountLogin sMsg; sMsg.nAccountId = nAccountId; sMsg.nResult = D2LAccountLogin::E_RESULT_SUCCESS; pClientSession->SendMsgToLs(&sMsg, sMsg.GetPackLength()); // 继续查询角色 QueryCharacterList(pClientSession, nAccountId, 0); return; } } // 将查询到的记录反回到login D2LAccountLogin sMsg; sMsg.nAccountId = 0; sMsg.nResult = D2LAccountLogin::E_RESULT_FAIL; pClientSession->SendMsg(&sMsg, sMsg.GetPackLength()); }