This commit is contained in:
aozhiwei 2020-08-22 21:35:43 +08:00
parent da3c6ee96e
commit 03a8c08040
2 changed files with 11 additions and 11 deletions

View File

@ -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<std::string> 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;
}

View File

@ -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