This commit is contained in:
azw 2023-04-24 06:13:24 +00:00
parent 7ef9a15cc4
commit 62b4b5829b
4 changed files with 8 additions and 4 deletions

View File

@ -10,8 +10,7 @@ enum SSMessageId_e
_SS_MS_ResponseTargetServer = 12; _SS_MS_ResponseTargetServer = 12;
_SS_ForceCloseSocket = 13; _SS_ForceCloseSocket = 13;
_SS_CMKcpHandshake = 98; _SS_CMKcpHandshake = 99;
_SS_SMKcpHandshake = 99;
_SS_CMPing = 101; _SS_CMPing = 101;
_SS_SMRpcError = 102; _SS_SMRpcError = 102;
_SS_CMLogin = 103; _SS_CMLogin = 103;

View File

@ -23,6 +23,12 @@ class GCListener : public a8::Singleton<GCListener>
void SendMsg(unsigned short socket_handle, T& msg) void SendMsg(unsigned short socket_handle, T& msg)
{ {
static int msgid = f8::Net_GetMessageId(msg); static int msgid = f8::Net_GetMessageId(msg);
SendMsgEx(socket_handle, msgid, msg);
}
template <typename T>
void SendMsgEx(unsigned short socket_handle, int msgid, T& msg)
{
f8::Net_SendMsg(tcp_listener_, socket_handle, 0, msgid, msg); f8::Net_SendMsg(tcp_listener_, socket_handle, 0, msgid, msg);
} }

View File

@ -70,7 +70,7 @@ void LongSessionMgr::_SS_CMKcpHandshake(f8::MsgHdr& hdr, const ss::SS_CMKcpHands
} }
respmsg.set_remote_host(JsonDataMgr::Instance()->GetUdpHost()); respmsg.set_remote_host(JsonDataMgr::Instance()->GetUdpHost());
respmsg.set_remote_port(JsonDataMgr::Instance()->GetUdpPort()); respmsg.set_remote_port(JsonDataMgr::Instance()->GetUdpPort());
GCListener::Instance()->SendMsg(hdr.socket_handle, respmsg); GCListener::Instance()->SendMsgEx(hdr.socket_handle, ss::_SS_CMKcpHandshake, respmsg);
} }
std::shared_ptr<LongSession> LongSessionMgr::GetSession(int socket_handle) std::shared_ptr<LongSession> LongSessionMgr::GetSession(int socket_handle)

View File

@ -136,7 +136,6 @@ void MasterMgr::RequestTargetServer(f8::MsgHdr& hdr,
msg.set_is_reconnect(is_reconnect); msg.set_is_reconnect(is_reconnect);
msg.set_proto_version(proto_version); msg.set_proto_version(proto_version);
#ifdef DEBUG #ifdef DEBUG
#else
std::string url; std::string url;
std::string query_str; std::string query_str;
{ {