This commit is contained in:
aozhiwei 2019-05-24 10:58:00 +08:00
parent 5900c86a9e
commit 1e69ce8110
6 changed files with 10 additions and 12 deletions

View File

@ -3,6 +3,8 @@ package ss;
//id定义 //id定义
enum SSMessageId_e enum SSMessageId_e
{ {
_SS_Ping = 8;
_SS_Pong = 9;
_SS_WSP_SocketDisconnect = 10; _SS_WSP_SocketDisconnect = 10;
_SS_CMPing = 101; _SS_CMPing = 101;
@ -10,6 +12,4 @@ enum SSMessageId_e
_SS_CMLogin = 103; _SS_CMLogin = 103;
_SS_CMReConnect = 104; _SS_CMReConnect = 104;
_SS_Ping = 150;
_SS_Pong = 151;
} }

View File

@ -22,7 +22,7 @@ void GameClientMgr::OnClientDisconnect(a8::XParams& param)
if (client) { if (client) {
if (client->conn) { if (client->conn) {
ss::SS_WSP_SocketDisconnect msg; ss::SS_WSP_SocketDisconnect msg;
client->conn->SendMsg(msg); client->conn->SendMsg(param.sender, msg);
} }
socket_hash_.erase(param.sender); socket_hash_.erase(param.sender);
delete client; delete client;

View File

@ -166,7 +166,9 @@ void TargetConn::CheckAlive()
Open(); Open();
} else { } else {
ss::SS_Ping msg; ss::SS_Ping msg;
SendMsg(msg); #if 0
SendMsg(0, msg);
#endif
} }
} }
} }

View File

@ -26,14 +26,10 @@ class TargetConn
bool Connected(); bool Connected();
template <typename T> template <typename T>
void SendMsg(T& msg) void SendMsg(int socket_handle, T& msg)
{ {
static int msgid = f8::Net_GetMessageId(msg); static int msgid = f8::Net_GetMessageId(msg);
#if 1 f8::Net_SendProxyCMsg(tcp_client_, socket_handle, msgid, msg);
f8::Net_SendProxyCMsg(tcp_client_, msgid, msg);
#else
f8::Net_SendMsg(tcp_client_, 0, msgid, msg);
#endif
} }
void ForwardClientMsg(f8::MsgHdr& hdr); void ForwardClientMsg(f8::MsgHdr& hdr);

@ -1 +1 @@
Subproject commit bc1e1e002cdfbbac07abdf14151afb0bbd8025a8 Subproject commit ff8c00652d5367595c4adee8f95306ae1a46236b

@ -1 +1 @@
Subproject commit 18133846b6672634219c080064b7a24720d17588 Subproject commit 780734e98003e146da7a9b5c4d28d098c54edc5a