This commit is contained in:
aozhiwei 2019-05-17 16:14:41 +08:00
parent d16e00654d
commit b82a5e2d02
2 changed files with 5 additions and 8 deletions

View File

@ -336,23 +336,20 @@ void App::ProcessClientMsg(f8::MsgHdr& hdr)
return;
}
#if MASTER_MODE
TargetConn* conn = nullptr;
if (hdr.msgid == ss::_SS_CMLogin || hdr.msgid == ss::_SS_CMReConnect) {
ss::SS_CMLogin_CMReConnect_CommonHead2 msg;
bool ok = msg.ParseFromArray(hdr.buf + hdr.offset, hdr.buflen - hdr.offset);
if (ok) {
MasterSvrMgr::Instance()->RequestTargetServer(hdr, msg.team_uuid());
}
return;
} else {
GameClient* client = GameClientMgr::Instance()->GetGameClientBySocket(hdr.socket_handle);
if (client) {
conn = client->conn;
if (client && client->conn) {
if (client->conn) {
client->conn->ForwardClientMsg(hdr);
}
}
}
if (conn) {
conn->ForwardClientMsg(hdr);
}
#else
TargetConn* conn = nullptr;
if (hdr.msgid == ss::_SS_CMLogin || hdr.msgid == ss::_SS_CMReConnect) {

View File

@ -42,7 +42,7 @@ void MasterSvrMgr::_SS_MS_ResponseTargetServer(f8::MsgHdr& hdr, const ss::SS_MS_
std::string key = msg.host() + ":" + a8::XValue(msg.port()).GetString();
TargetConn* conn = TargetConnMgr::Instance()->GetConnByKey(key);
if (conn) {
conn->ForwardClientMsg(hdr);
}
}