1
This commit is contained in:
parent
a68691dc1f
commit
d209bb23c7
@ -116,6 +116,22 @@ namespace f8
|
|||||||
return sizeof(PackHead) + packlen;
|
return sizeof(PackHead) + packlen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Net_SendMsgOld(a8::TcpClient* tcp_client, unsigned int seqid,
|
||||||
|
unsigned short msgid, ::google::protobuf::Message& msg)
|
||||||
|
{
|
||||||
|
int packlen = msg.ByteSize();
|
||||||
|
|
||||||
|
char* buff = (char*)malloc(sizeof(f8::PackHeadOld) + packlen);
|
||||||
|
f8::PackHeadOld* head = (f8::PackHeadOld*)buff;
|
||||||
|
head->packlen = packlen;
|
||||||
|
head->msgid = msgid;
|
||||||
|
head->magiccode = MAGIC_CODE;
|
||||||
|
msg.SerializeToArray(buff + sizeof(f8::PackHeadOld), packlen);
|
||||||
|
tcp_client->SendBuff(buff, sizeof(f8::PackHeadOld) + packlen);
|
||||||
|
free(buff);
|
||||||
|
return sizeof(f8::PackHeadOld) + packlen;
|
||||||
|
}
|
||||||
|
|
||||||
int Net_SendMsg(a8::TcpClient2* tcp_client, unsigned seqid, unsigned short msgid,
|
int Net_SendMsg(a8::TcpClient2* tcp_client, unsigned seqid, unsigned short msgid,
|
||||||
::google::protobuf::Message& msg)
|
::google::protobuf::Message& msg)
|
||||||
{
|
{
|
||||||
|
@ -108,6 +108,8 @@ namespace f8
|
|||||||
void Net_PackMsgOld(unsigned short msgid, ::google::protobuf::Message& msg, std::string& out);
|
void Net_PackMsgOld(unsigned short msgid, ::google::protobuf::Message& msg, std::string& out);
|
||||||
int Net_SendMsg(a8::TcpClient* tcp_client, unsigned int seqid,
|
int Net_SendMsg(a8::TcpClient* tcp_client, unsigned int seqid,
|
||||||
unsigned short msgid, ::google::protobuf::Message& msg);
|
unsigned short msgid, ::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::TcpClient2* tcp_client, unsigned int seqid,
|
int Net_SendMsg(a8::TcpClient2* tcp_client, unsigned int seqid,
|
||||||
unsigned short msgid, ::google::protobuf::Message& msg);
|
unsigned short msgid, ::google::protobuf::Message& msg);
|
||||||
int Net_SendBigMsg(a8::TcpClient* tcp_client, unsigned int seqid,
|
int Net_SendBigMsg(a8::TcpClient* tcp_client, unsigned int seqid,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user