diff --git a/include/td/protocol/command/Commands.h b/include/td/protocol/command/Commands.h index a0dcdbb..93cc112 100644 --- a/include/td/protocol/command/Commands.h +++ b/include/td/protocol/command/Commands.h @@ -6,10 +6,10 @@ */ #include +#include #include #include #include -#include #include #include #include @@ -32,6 +32,8 @@ class CommandHandler; using CommandBase = sp::MessageBase; +using CommandPtr = std::unique_ptr; + template using CommandMessage = sp::ConcreteMessage; diff --git a/include/td/protocol/packet/PacketData.h b/include/td/protocol/packet/PacketData.h index 139947f..da5648d 100644 --- a/include/td/protocol/packet/PacketData.h +++ b/include/td/protocol/packet/PacketData.h @@ -44,7 +44,7 @@ struct PlayerLeave { }; struct PredictCommand { - std::unique_ptr m_Command; + CommandPtr m_Command; std::uint16_t m_FrameNumber; }; diff --git a/include/td/protocol/packet/PacketSerialize.h b/include/td/protocol/packet/PacketSerialize.h index b732517..83a32cb 100644 --- a/include/td/protocol/packet/PacketSerialize.h +++ b/include/td/protocol/packet/PacketSerialize.h @@ -2,20 +2,6 @@ #include -namespace sp { - -class DataBuffer; - -// temp -template <> -void ReadMessage(DataBuffer& a_Buffer, td::protocol::pdata::PredictCommand& a_Header); - -template <> -DataBuffer WriteMessage(const td::protocol::pdata::PredictCommand& a_Header); - -} // namespace sp - - namespace td { template @@ -49,7 +35,6 @@ sp::DataBuffer& operator>>(sp::DataBuffer& a_Buffer, Vec4& a_Vec) { return a_Buffer >> a_Vec.x >> a_Vec.y >> a_Vec.z >> a_Vec.w; } - namespace game { sp::DataBuffer& operator<<(sp::DataBuffer& a_Buffer, const TeamCastle& a_Castle); diff --git a/src/main.cpp b/src/main.cpp index 66a7d2a..4e05e79 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,22 +1,20 @@ #include -#include -#include -#include - +#include #include +#include #include #include - #include #include #include - #include +#include +#include #include +#include #include -#include class WorldApply : public td::protocol::PacketHandler { private: diff --git a/src/td/protocol/packet/PacketSerialize.cpp b/src/td/protocol/packet/PacketSerialize.cpp index 7fe85f6..426b65b 100644 --- a/src/td/protocol/packet/PacketSerialize.cpp +++ b/src/td/protocol/packet/PacketSerialize.cpp @@ -1,17 +1,6 @@ #include #include -namespace sp { - -// temp -template<> -void ReadMessage(DataBuffer& a_Buffer, td::protocol::pdata::PredictCommand& a_Header){} - -template<> -DataBuffer WriteMessage(const td::protocol::pdata::PredictCommand& a_Header){} - -} // namespace sp - namespace td { namespace game { diff --git a/xmake.lua b/xmake.lua index f87cf17..813cf64 100644 --- a/xmake.lua +++ b/xmake.lua @@ -3,7 +3,7 @@ add_rules("mode.debug", "mode.release") add_repositories("persson-repo https://git.ale-pri.com/Persson-dev/xmake-repo.git") add_requires("imgui 1.92.0", {configs = {sdl3 = true, opengl3 = true}}) -add_requires("splib 2.0.1", "zlib") +add_requires("splib 2.0.2", "zlib") add_requires("libsdl3 3.2.16", "glew", "fpm", "enet6") set_languages("c++17")