1
This commit is contained in:
parent
dca17a2d72
commit
fd72ea5605
@ -10,6 +10,18 @@
|
|||||||
|
|
||||||
namespace f8
|
namespace f8
|
||||||
{
|
{
|
||||||
|
|
||||||
|
MsgHdr* MsgHdr::Clone()
|
||||||
|
{
|
||||||
|
MsgHdr* hdr = (MsgHdr*)malloc(sizeof(MsgHdr));
|
||||||
|
*hdr = *this;
|
||||||
|
if (hdr->buflen > 0) {
|
||||||
|
hdr->buf = (char*)malloc(hdr->buflen);
|
||||||
|
memmove((void*)hdr->buf, (void*)buf, buflen);
|
||||||
|
}
|
||||||
|
return hdr;
|
||||||
|
}
|
||||||
|
|
||||||
int Net_GetMessageId(::google::protobuf::Message& msg)
|
int Net_GetMessageId(::google::protobuf::Message& msg)
|
||||||
{
|
{
|
||||||
std::string msgname;
|
std::string msgname;
|
||||||
|
@ -83,6 +83,8 @@ namespace f8
|
|||||||
int offset;
|
int offset;
|
||||||
Player *hum = nullptr;
|
Player *hum = nullptr;
|
||||||
const void* user_data = nullptr;
|
const void* user_data = nullptr;
|
||||||
|
|
||||||
|
MsgHdr* Clone();
|
||||||
};
|
};
|
||||||
|
|
||||||
const unsigned short MAGIC_CODE = (((unsigned short)'S') << 8) | ((unsigned short)'K');
|
const unsigned short MAGIC_CODE = (((unsigned short)'S') << 8) | ((unsigned short)'K');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user