This commit is contained in:
aozhiwei 2019-05-17 16:04:44 +08:00
parent cacc618c2c
commit d16e00654d
5 changed files with 3 additions and 14 deletions

View File

@ -304,10 +304,7 @@ void App::DispatchMsg()
break;
case SF_TargetServer:
{
#if MASTER_MODE
#else
ProcessTargetServerMsg(hdr);
#endif
}
break;
case SF_MasterServer:
@ -383,12 +380,11 @@ void App::ProcessClientMsg(f8::MsgHdr& hdr)
#endif
}
#if MASTER_MODE
void App::ProcessMasterServerMsg(f8::MsgHdr& hdr)
{
}
#else
void App::ProcessTargetServerMsg(f8::MsgHdr& hdr)
{
if (hdr.msgid < 100) {
@ -400,7 +396,6 @@ void App::ProcessTargetServerMsg(f8::MsgHdr& hdr)
}
GCListener::Instance()->ForwardTargetConnMsg(hdr);
}
#endif
void App::ProcessIMMsg()
{

View File

@ -44,9 +44,8 @@ private:
void ProcessClientMsg(f8::MsgHdr& hdr);
#if MASTER_MODE
void ProcessMasterServerMsg(f8::MsgHdr& hdr);
#else
void ProcessTargetServerMsg(f8::MsgHdr& hdr);
#endif
void ProcessTargetServerMsg(f8::MsgHdr& hdr);
void InitLog();
void UnInitLog();

View File

@ -55,8 +55,6 @@ GameClient* GameClientMgr::GetGameClientBySocket(int sockhandle)
return itr != socket_hash_.end() ? itr->second : nullptr;
}
#if MASTER_MODE
#else
void GameClientMgr::BindTargetConn(int socket_handle, int conn_instance_id)
{
TargetConn* conn = TargetConnMgr::Instance()->GetConnById(conn_instance_id);
@ -72,4 +70,3 @@ void GameClientMgr::BindTargetConn(int socket_handle, int conn_instance_id)
}
}
}
#endif

View File

@ -16,10 +16,7 @@ class GameClientMgr : public a8::Singleton<GameClientMgr>
void OnTargetServerDisconnect(a8::XParams& param);
void OnTargetServerConnect(a8::XParams& param);
GameClient* GetGameClientBySocket(int sockhande);
#if MASTER_MODE
#else
void BindTargetConn(int socket_handle, int conn_instance_id);
#endif
private:
std::map<int, GameClient*> socket_hash_;

View File

@ -35,6 +35,7 @@ class MasterSvrMgr : public a8::Singleton<MasterSvrMgr>
MasterSvr* GetConnById(int instance_id);
private:
int target_conn_id_ = 100;
long long curr_context_id_ = 0;
std::map<int, MasterSvr*> mastersvr_hash_;
std::map<int, long long> pending_socket_hash_;