修复team_id问题
This commit is contained in:
parent
6fbbabfd03
commit
fcb2888017
@ -72,10 +72,18 @@ void MasterSvrMgr::RequestTargetServer(f8::MsgHdr& hdr, const std::string& team_
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
unsigned int code = 0;
|
unsigned int code = 0;
|
||||||
|
std::string team_uuid = team_id;
|
||||||
if (!team_id.empty()) {
|
if (!team_id.empty()) {
|
||||||
code = a8::openssl::Crc32((unsigned char*)team_id.data(), team_id.size());
|
code = a8::openssl::Crc32((unsigned char*)team_id.data(), team_id.size());
|
||||||
} else {
|
} 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());
|
code = a8::openssl::Crc32((unsigned char*)data.data(), data.size());
|
||||||
}
|
}
|
||||||
MasterSvr* svr = GetConnById(code % mastersvr_hash_.size() + 1);
|
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;
|
ss::SS_WSP_RequestTargetServer msg;
|
||||||
msg.set_context_id(curr_context_id_);
|
msg.set_context_id(curr_context_id_);
|
||||||
msg.set_team_id(team_id);
|
msg.set_team_id(team_uuid);
|
||||||
svr->SendMsg(msg);
|
svr->SendMsg(msg);
|
||||||
|
|
||||||
pending_socket_hash_[hdr.socket_handle] = curr_context_id_;
|
pending_socket_hash_[hdr.socket_handle] = curr_context_id_;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user