]> git.localhorst.tv Git - blank.git/blobdiff - src/net/Packet.hpp
move client update throttling to state
[blank.git] / src / net / Packet.hpp
index bb6140d5952cef743c69fe4d2ff3365123491d7b..4742a4525d679a44333c2d27b7eb88a306793cdc 100644 (file)
@@ -53,6 +53,10 @@ struct Packet {
                std::size_t length;
                std::uint8_t *data;
 
+               std::uint16_t Seq() const noexcept {
+                       return reinterpret_cast<const Packet *>(data - sizeof(Header))->header.ctrl.seq;
+               }
+
                template<class T>
                void Write(const T &, size_t off) noexcept;
                template<class T>
@@ -101,10 +105,11 @@ struct Packet {
 
        struct SpawnEntity : public Payload {
                static constexpr std::uint8_t TYPE = 5;
-               static constexpr std::size_t MAX_LEN = 128;
+               static constexpr std::size_t MAX_LEN = 132;
 
                void WriteEntity(const Entity &) noexcept;
                void ReadEntityID(std::uint32_t &) const noexcept;
+               void ReadSkeletonID(std::uint32_t &) const noexcept;
                void ReadEntity(Entity &) const noexcept;
        };