From 15edd63f24a707ff9038d120dd915e18324973ab Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 4 Sep 2018 11:15:01 +0800 Subject: [PATCH] 1 --- cpp/protoutils.cc | 4 ++++ cpp/protoutils.h | 1 + 2 files changed, 5 insertions(+) diff --git a/cpp/protoutils.cc b/cpp/protoutils.cc index b07d9e3..129d14c 100644 --- a/cpp/protoutils.cc +++ b/cpp/protoutils.cc @@ -74,6 +74,7 @@ int Net_SendMsg(a8::TcpClient* tcp_client, unsigned seqid, unsigned short msgid, head->msgid = msgid; head->seqid = seqid; head->magic_code = MAGIC_CODE; + head->rpc_error_code = 0; msg.SerializeToArray(buff + sizeof(PackHead), packlen); tcp_client->SendBuff(buff, sizeof(PackHead) + packlen); free(buff); @@ -92,6 +93,7 @@ int Net_SendMsg(a8::TcpListener* tcp_listener, unsigned short socket_handle, uns head->msgid = msgid; head->seqid = seqid; head->magic_code = MAGIC_CODE; + head->rpc_error_code = 0; msg.SerializeToArray(buff + sizeof(PackHead), packlen); tcp_listener->SendClientMsg(socket_handle, buff, sizeof(PackHead) + packlen); free(buff); @@ -110,6 +112,7 @@ int Net_BroadcastMsg(a8::TcpListener* tcp_listener, unsigned int seqid, head->msgid = msgid; head->seqid = seqid; head->magic_code = MAGIC_CODE; + head->rpc_error_code = 0; msg.SerializeToArray(buff + sizeof(PackHead), packlen); tcp_listener->BroadcastMsg(buff, sizeof(PackHead) + packlen); free(buff); @@ -163,6 +166,7 @@ int Net_SendProxyMsg(a8::TcpListener* tcp_listener, int socket_handle, unsigned head->magic_code = MAGIC_CODE; head->rpc_error_code = error_code; head->socket_handle = child_socket_handle; + head->reserved = 0; msg.SerializeToArray(buff + sizeof(WSProxyPackHead_S), packlen); tcp_listener->SendClientMsg(parent_socket_handle, buff, sizeof(WSProxyPackHead_S) + packlen); diff --git a/cpp/protoutils.h b/cpp/protoutils.h index 5afb864..0edd3a4 100644 --- a/cpp/protoutils.h +++ b/cpp/protoutils.h @@ -42,6 +42,7 @@ struct WSProxyPackHead_S unsigned short rpc_error_code; unsigned short socket_handle; + unsigned short reserved; }; class Player;