diff --git a/server/wsproxy/mastersvrmgr.cc b/server/wsproxy/mastersvrmgr.cc index 2a3fec5..c953bec 100644 --- a/server/wsproxy/mastersvrmgr.cc +++ b/server/wsproxy/mastersvrmgr.cc @@ -72,10 +72,18 @@ void MasterSvrMgr::RequestTargetServer(f8::MsgHdr& hdr, const std::string& team_ return; } unsigned int code = 0; + std::string team_uuid = team_id; if (!team_id.empty()) { code = a8::openssl::Crc32((unsigned char*)team_id.data(), team_id.size()); } else { - std::string data = a8::Format("!%s_%s_%d", {account_id, App::Instance()->uuid.Generate(), getpid()}); + std::string data = a8::Format("!%s_%s_%d_%d", + { + account_id, + App::Instance()->uuid.Generate(), + getpid(), + rand() + }); + team_uuid = data; code = a8::openssl::Crc32((unsigned char*)data.data(), data.size()); } MasterSvr* svr = GetConnById(code % mastersvr_hash_.size() + 1); @@ -87,7 +95,7 @@ void MasterSvrMgr::RequestTargetServer(f8::MsgHdr& hdr, const std::string& team_ ss::SS_WSP_RequestTargetServer msg; msg.set_context_id(curr_context_id_); - msg.set_team_id(team_id); + msg.set_team_id(team_uuid); svr->SendMsg(msg); pending_socket_hash_[hdr.socket_handle] = curr_context_id_;