diff --git a/cpp/protoutils.cc b/cpp/protoutils.cc index f1d4f30..59d8a9e 100644 --- a/cpp/protoutils.cc +++ b/cpp/protoutils.cc @@ -191,7 +191,8 @@ namespace f8 return sizeof(f8::BigPackHead) + packlen; } - int Net_SendProxyCMsg(a8::TcpClient* tcp_client, unsigned short msgid, ::google::protobuf::Message& msg) + int Net_SendProxyCMsg(a8::TcpClient* tcp_client, unsigned short socket_handle, + unsigned short msgid, ::google::protobuf::Message& msg) { int packlen = msg.ByteSize(); assert(packlen < 1024 * 60); @@ -200,20 +201,12 @@ namespace f8 WSProxyPackHead_C* head = (WSProxyPackHead_C*)buff; head->packlen = packlen; head->msgid = msgid; -#if 1 head->seqid = 0; -#else - head->seqid = seqid; -#endif head->magic_code = MAGIC_CODE; -#if 0 - head->rpc_error_code = error_code; -#endif -#if 1 - head->socket_handle = 0; -#else - head->socket_handle = child_socket_handle; -#endif + #if 0 + head->rpc_error_code = 0; + #endif + head->socket_handle = socket_handle; msg.SerializeToArray(buff + sizeof(WSProxyPackHead_C), packlen); tcp_client->SendBuff(buff, sizeof(WSProxyPackHead_C) + packlen); @@ -221,7 +214,8 @@ namespace f8 return sizeof(WSProxyPackHead_C) + packlen; } - int Net_SendProxyMsg(a8::TcpListener* tcp_listener, int socket_handle, unsigned int seqid, unsigned short error_code, + int Net_SendProxyMsg(a8::TcpListener* tcp_listener, int socket_handle, + unsigned int seqid, unsigned short error_code, unsigned short msgid, ::google::protobuf::Message& msg) { unsigned short parent_socket_handle = (socket_handle >> 16) & 0xFFFF; diff --git a/cpp/protoutils.h b/cpp/protoutils.h index 3b02e0a..6795432 100644 --- a/cpp/protoutils.h +++ b/cpp/protoutils.h @@ -107,8 +107,10 @@ namespace f8 int Net_BroadcastBigMsg(a8::TcpListener* tcp_tlistener, unsigned int seqid, unsigned short msgid, ::google::protobuf::Message& msg); - int Net_SendProxyCMsg(a8::TcpClient* tcp_client, unsigned short msgid, ::google::protobuf::Message& msg); + int Net_SendProxyCMsg(a8::TcpClient* tcp_client, unsigned short socket_handle, + unsigned short msgid, ::google::protobuf::Message& msg); - int Net_SendProxyMsg(a8::TcpListener* tcp_tlistener, int socket_handle, unsigned int seqid, unsigned short error_code, + int Net_SendProxyMsg(a8::TcpListener* tcp_tlistener, int socket_handle, + unsigned int seqid, unsigned short error_code, unsigned short msgid, ::google::protobuf::Message& msg); }