diff --git a/server/wsproxy/app.cc b/server/wsproxy/app.cc index 1e7ef82..266aa55 100644 --- a/server/wsproxy/app.cc +++ b/server/wsproxy/app.cc @@ -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) { diff --git a/server/wsproxy/mastersvrmgr.cc b/server/wsproxy/mastersvrmgr.cc index 2b6f605..4092e12 100644 --- a/server/wsproxy/mastersvrmgr.cc +++ b/server/wsproxy/mastersvrmgr.cc @@ -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); } }