fix predictpacket serialization
This commit is contained in:
@@ -6,10 +6,10 @@
|
||||
*/
|
||||
|
||||
#include <memory>
|
||||
#include <sp/common/GenericHandler.h>
|
||||
#include <sp/protocol/ConcreteMessage.h>
|
||||
#include <sp/protocol/MessageDispatcher.h>
|
||||
#include <sp/protocol/MessageFactory.h>
|
||||
#include <sp/common/GenericHandler.h>
|
||||
#include <td/Types.h>
|
||||
#include <td/common/NonCopyable.h>
|
||||
#include <td/protocol/command/CommandData.h>
|
||||
@@ -32,6 +32,8 @@ class CommandHandler;
|
||||
|
||||
using CommandBase = sp::MessageBase<CommandID, CommandHandler>;
|
||||
|
||||
using CommandPtr = std::unique_ptr<CommandBase>;
|
||||
|
||||
template <typename TData, CommandID ID>
|
||||
using CommandMessage = sp::ConcreteMessage<TData, CommandBase, ID>;
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ struct PlayerLeave {
|
||||
};
|
||||
|
||||
struct PredictCommand {
|
||||
std::unique_ptr<CommandBase> m_Command;
|
||||
CommandPtr m_Command;
|
||||
std::uint16_t m_FrameNumber;
|
||||
};
|
||||
|
||||
|
||||
@@ -2,20 +2,6 @@
|
||||
|
||||
#include <td/protocol/packet/PacketData.h>
|
||||
|
||||
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 <typename T>
|
||||
@@ -49,7 +35,6 @@ sp::DataBuffer& operator>>(sp::DataBuffer& a_Buffer, Vec4<T>& 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);
|
||||
|
||||
12
src/main.cpp
12
src/main.cpp
@@ -1,22 +1,20 @@
|
||||
#include <iostream>
|
||||
|
||||
#include <sp/common/DataBuffer.h>
|
||||
#include <sp/extensions/Compress.h>
|
||||
#include <td/input/Display.h>
|
||||
|
||||
#include <fstream>
|
||||
#include <td/game/World.h>
|
||||
#include <td/input/Display.h>
|
||||
#include <td/protocol/packet/PacketSerialize.h>
|
||||
#include <td/protocol/packet/Packets.h>
|
||||
|
||||
#include <td/render/renderer/EntityRenderer.h>
|
||||
#include <td/render/renderer/TowerRenderer.h>
|
||||
#include <td/render/renderer/WorldRenderer.h>
|
||||
|
||||
#include <td/simulation/RealTimeSimulation.h>
|
||||
|
||||
#include <sp/common/DataBuffer.h>
|
||||
#include <sp/extensions/Compress.h>
|
||||
#include <sp/io/MessageStream.h>
|
||||
#include <sp/io/MessageSerialize.h>
|
||||
#include <sp/io/StdIo.h>
|
||||
#include <fstream>
|
||||
|
||||
class WorldApply : public td::protocol::PacketHandler {
|
||||
private:
|
||||
|
||||
@@ -1,17 +1,6 @@
|
||||
#include <td/protocol/packet/PacketData.h>
|
||||
#include <td/protocol/packet/PacketSerialize.h>
|
||||
|
||||
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 {
|
||||
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user