diff --git a/server/masterserver/gsmgr.cc b/server/masterserver/gsmgr.cc index 2ca0a44..28e6c42 100644 --- a/server/masterserver/gsmgr.cc +++ b/server/masterserver/gsmgr.cc @@ -26,7 +26,7 @@ void GSMgr::UnInit() void GSMgr::_SS_WSP_RequestTargetServer(f8::MsgHdr& hdr, const ss::SS_WSP_RequestTargetServer& msg) { - int channel = GetTargetChannel(msg); + int target_channel = GetTargetChannel(msg); ss::SS_MS_ResponseTargetServer respmsg; respmsg.set_context_id(msg.context_id()); @@ -41,11 +41,11 @@ void GSMgr::_SS_WSP_RequestTargetServer(f8::MsgHdr& hdr, const ss::SS_WSP_Reques } } else { GSNode* node = GetNodeByTeamId(msg.team_id()); - if (node && node->channel == channel) { + if (node && node->channel == target_channel) { respmsg.set_host(node->ip); respmsg.set_port(node->port); } else { - node = AllocNode(channel); + node = AllocNode(target_channel); if (node) { respmsg.set_host(node->ip); respmsg.set_port(node->port); @@ -308,16 +308,15 @@ void GSMgr::OnChannelChange(GSNode* node) int GSMgr::GetTargetChannel(const ss::SS_WSP_RequestTargetServer& msg) { int channel = f8::ExtractChannelIdFromAccountId(msg.account_id()); + if (channel == 6000 && !msg.url().empty()) { + std::vector strings; + a8::Split(msg.url(), strings, '/'); + if (!strings.empty()) { + channel = a8::XValue(strings[0]); + } + } if (!App::Instance()->IsSeparateChannel(channel)) { channel = 0; } - #if 1 - int src_channel = f8::ExtractChannelIdFromAccountId(msg.account_id()); - if (channel == 0 && - src_channel == kTouTiaoChannelId && - msg.proto_version() == 2019071502) { - channel = src_channel; - } - #endif return channel; } diff --git a/server/tools/protobuild/ss_proto.proto b/server/tools/protobuild/ss_proto.proto index 62359ba..8b93a2a 100755 --- a/server/tools/protobuild/ss_proto.proto +++ b/server/tools/protobuild/ss_proto.proto @@ -24,6 +24,7 @@ message SS_WSP_RequestTargetServer optional int32 proto_version = 6; //协议版本号Constant_e.ProtoVersion optional string url = 7; optional string query_str = 8; + optional string session_id = 9; } message SS_MS_ResponseTargetServer