diff --git a/f8/protoutils.cc b/f8/protoutils.cc index 125b496..ad1b3b4 100644 --- a/f8/protoutils.cc +++ b/f8/protoutils.cc @@ -5,7 +5,6 @@ #include "f8/protoutils.h" #include -#include #include #include @@ -127,25 +126,6 @@ namespace f8 return sizeof(f8::PackHeadOld) + packlen; } - int Net_SendMsg(a8::AsyncTcpClient* tcp_client, unsigned seqid, unsigned short msgid, - const ::google::protobuf::Message& msg) - { - int packlen = msg.ByteSize(); - assert(packlen < 1024 * 60); - - char* buff = (char*)malloc(sizeof(PackHead) + packlen); - PackHead* head = (PackHead*)buff; - head->packlen = packlen; - head->msgid = msgid; - head->seqid = seqid; - head->magic_code = MAGIC_CODE; - head->ext_len = 0; - msg.SerializeToArray(buff + sizeof(PackHead), packlen); - tcp_client->SendBuff(buff, sizeof(PackHead) + packlen); - free(buff); - return sizeof(PackHead) + packlen; - } - int Net_SendBigMsg(a8::TcpClient* tcp_client, unsigned seqid, unsigned short msgid, ::google::protobuf::Message& msg) { @@ -276,30 +256,6 @@ namespace f8 return sizeof(WSProxyPackHead_C) + packlen; } - int Net_SendProxyCMsg(a8::AsyncTcpClient* tcp_client, unsigned short socket_handle, - unsigned short msgid, ::google::protobuf::Message& msg) - { - int packlen = msg.ByteSize(); - assert(packlen < 1024 * 60); - - char* buff = (char*)malloc(sizeof(WSProxyPackHead_C) + packlen); - memset(buff, 0, sizeof(WSProxyPackHead_C)); - WSProxyPackHead_C* head = (WSProxyPackHead_C*)buff; - head->packlen = packlen; - head->msgid = msgid; - head->seqid = 0; - head->magic_code = MAGIC_CODE; - head->ip_saddr = 0; - head->socket_handle = socket_handle; - - if (packlen > 0) { - msg.SerializeToArray(buff + sizeof(WSProxyPackHead_C), packlen); - } - tcp_client->SendBuff(buff, sizeof(WSProxyPackHead_C) + packlen); - free(buff); - return sizeof(WSProxyPackHead_C) + packlen; - } - int Net_SendProxyMsg(a8::TcpListener* tcp_listener, int socket_handle, unsigned int seqid, unsigned short error_code, unsigned short msgid, ::google::protobuf::Message& msg) diff --git a/f8/protoutils.h b/f8/protoutils.h index 720cc25..9f1d157 100644 --- a/f8/protoutils.h +++ b/f8/protoutils.h @@ -12,7 +12,6 @@ namespace google namespace a8 { class TcpClient; - class AsyncTcpClient; class TcpListener; } @@ -95,8 +94,6 @@ namespace f8 unsigned short msgid, const ::google::protobuf::Message& msg); int Net_SendMsgOld(a8::TcpClient* tcp_client, unsigned int seqid, unsigned short msgid, ::google::protobuf::Message& msg); - int Net_SendMsg(a8::AsyncTcpClient* tcp_client, unsigned int seqid, - unsigned short msgid, const ::google::protobuf::Message& msg); int Net_SendBigMsg(a8::TcpClient* tcp_client, unsigned int seqid, unsigned short msgid, ::google::protobuf::Message& msg); int Net_SendMsg(a8::TcpClient* tcp_client, unsigned int seqid, unsigned short msgid, @@ -114,8 +111,6 @@ namespace f8 int Net_SendProxyCMsg(a8::TcpClient* tcp_client, unsigned short socket_handle, unsigned short msgid, ::google::protobuf::Message& msg); - int Net_SendProxyCMsg(a8::AsyncTcpClient* 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,