fix predictpacket serialization

This commit is contained in:
2025-07-31 15:07:34 +02:00
parent 02d872c49b
commit c8159bae6e
6 changed files with 10 additions and 36 deletions

View File

@@ -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>;

View File

@@ -44,7 +44,7 @@ struct PlayerLeave {
};
struct PredictCommand {
std::unique_ptr<CommandBase> m_Command;
CommandPtr m_Command;
std::uint16_t m_FrameNumber;
};

View File

@@ -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);