1
This commit is contained in:
parent
a037b22de9
commit
da3c6ee96e
@ -1,13 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
/*
|
||||
类似http的错误码设计
|
||||
0:成功
|
||||
<400: 客户端的错
|
||||
>500: 服务器的错
|
||||
*/
|
||||
enum ErrorCode_e
|
||||
{
|
||||
ERRNO_OK = 0,
|
||||
|
||||
};
|
@ -26,18 +26,8 @@ void GSMgr::UnInit()
|
||||
|
||||
void GSMgr::_SS_WSP_RequestTargetServer(f8::MsgHdr& hdr, const ss::SS_WSP_RequestTargetServer& msg)
|
||||
{
|
||||
int channel = f8::ExtractChannelIdFromAccountId(msg.account_id());
|
||||
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
|
||||
int channel = GetTargetChannel(msg);
|
||||
|
||||
ss::SS_MS_ResponseTargetServer respmsg;
|
||||
respmsg.set_context_id(msg.context_id());
|
||||
if (msg.is_reconnect()) {
|
||||
@ -314,3 +304,20 @@ void GSMgr::OnChannelChange(GSNode* node)
|
||||
RemoveNodeFromSortedNodes(node);
|
||||
AddNodeToSortedNodes(node);
|
||||
}
|
||||
|
||||
int GSMgr::GetTargetChannel(const ss::SS_WSP_RequestTargetServer& msg)
|
||||
{
|
||||
int channel = f8::ExtractChannelIdFromAccountId(msg.account_id());
|
||||
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;
|
||||
}
|
||||
|
@ -48,6 +48,7 @@ class GSMgr : public a8::Singleton<GSMgr>
|
||||
void RemoveNodeFromSortedNodes(GSNode* node);
|
||||
std::vector<GSNode*>* GetSortedNodesByChannel(int channel);
|
||||
void OnChannelChange(GSNode* node);
|
||||
int GetTargetChannel(const ss::SS_WSP_RequestTargetServer& msg);
|
||||
|
||||
private:
|
||||
|
||||
|
@ -5,7 +5,6 @@
|
||||
|
||||
#include "constant.h"
|
||||
#include "types.h"
|
||||
#include "error_code.h"
|
||||
#include "global.h"
|
||||
|
||||
namespace google
|
||||
|
@ -22,6 +22,8 @@ message SS_WSP_RequestTargetServer
|
||||
optional string server_info = 4;
|
||||
optional int32 is_reconnect = 5;
|
||||
optional int32 proto_version = 6; //协议版本号Constant_e.ProtoVersion
|
||||
optional string url = 7;
|
||||
optional string query_str = 8;
|
||||
}
|
||||
|
||||
message SS_MS_ResponseTargetServer
|
||||
|
Loading…
x
Reference in New Issue
Block a user