diff --git a/f8/netmsghandler.cc b/f8/netmsghandler.cc index 58b1dd4..971bd62 100644 --- a/f8/netmsghandler.cc +++ b/f8/netmsghandler.cc @@ -4,9 +4,10 @@ #include #include -#include "f8/utils.h" -#include "f8/protoutils.h" -#include "f8/netmsghandler.h" +#include +#include +#include +#include namespace f8 { diff --git a/f8/netmsghandler.h b/f8/netmsghandler.h index 09acf67..7b7a740 100644 --- a/f8/netmsghandler.h +++ b/f8/netmsghandler.h @@ -1,5 +1,9 @@ #pragma once +#include + +#include + #include #include #include diff --git a/f8/protoutils.cc b/f8/protoutils.cc index 09cb7cd..88a619d 100644 --- a/f8/protoutils.cc +++ b/f8/protoutils.cc @@ -12,25 +12,6 @@ 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; - } - - void MsgHdr::Destroy(MsgHdr* hdr) - { - if (hdr->buf) { - free((void*)hdr->buf); - } - free((void*)hdr); - } - int Net_GetMessageId(const ::google::protobuf::Message& msg) { std::string msgname; diff --git a/f8/protoutils.h b/f8/protoutils.h index bd025cc..720cc25 100644 --- a/f8/protoutils.h +++ b/f8/protoutils.h @@ -81,22 +81,6 @@ namespace f8 unsigned short ext_len; }; - struct MsgHdr - { - unsigned int seqid; - unsigned short msgid; - int socket_handle; - unsigned long ip_saddr; - const char* buf; - int buflen; - int offset; - Player *hum = nullptr; - const void* user_data = nullptr; - - MsgHdr* Clone(); - static void Destroy(MsgHdr* hdr); - }; - #ifdef MATCHVS const unsigned int MAGIC_CODE = 0xAABBCCAA; #else diff --git a/f8/tglog.h b/f8/tglog.h index 8e687fc..5359cc8 100644 --- a/f8/tglog.h +++ b/f8/tglog.h @@ -1,5 +1,7 @@ #pragma once +#include + namespace f8 { struct TGLogImpl; diff --git a/f8/types.cc b/f8/types.cc index 818b848..5475f13 100644 --- a/f8/types.cc +++ b/f8/types.cc @@ -1,6 +1,8 @@ -#include "precompile.h" +#include -#include "f8/types.h" +#include + +#include #include namespace f8 @@ -25,4 +27,23 @@ namespace f8 return a8::HttpResponse(response); } + 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; + } + + void MsgHdr::Destroy(MsgHdr* hdr) + { + if (hdr->buf) { + free((void*)hdr->buf); + } + free((void*)hdr); + } + } diff --git a/f8/types.h b/f8/types.h index 346304f..88261e4 100644 --- a/f8/types.h +++ b/f8/types.h @@ -5,6 +5,7 @@ namespace a8 class MutableXObject; } +class Player; namespace f8 { struct JsonHttpRequest @@ -34,4 +35,20 @@ namespace f8 IM_SysEnd = 99, }; + struct MsgHdr + { + unsigned int seqid; + unsigned short msgid; + int socket_handle; + unsigned long ip_saddr; + const char* buf; + int buflen; + int offset; + Player *hum = nullptr; + const void* user_data = nullptr; + + MsgHdr* Clone(); + static void Destroy(MsgHdr* hdr); + }; + }