]> git.localhorst.tv Git - blank.git/blobdiff - src/net/Packet.hpp
fixed old packet acks
[blank.git] / src / net / Packet.hpp
index 232d0be9900d880995c90e77339491ea1194319e..87dececf9957f7c12ef960d59d6b0b7086ba802a 100644 (file)
@@ -26,7 +26,7 @@ struct Packet {
                // true if this contains an ack for given (remote) seq
                bool Acks(std::uint16_t) const noexcept;
                std::uint16_t AckBegin() const noexcept { return ack; }
-               std::uint16_t AckEnd() const noexcept { return ack + std::uint16_t(33); }
+               std::uint16_t AckEnd() const noexcept { return ack - std::uint16_t(33); }
        };
 
        struct Header {
@@ -139,6 +139,16 @@ struct Packet {
                void ReadEntityState(EntityState &, std::uint32_t) const noexcept;
        };
 
+       struct PlayerCorrection : public Payload {
+               static constexpr std::uint8_t TYPE = 8;
+               static constexpr std::size_t MAX_LEN = 66;
+
+               void WritePacketSeq(std::uint16_t) noexcept;
+               void ReadPacketSeq(std::uint16_t &) const noexcept;
+               void WritePlayer(const Entity &) noexcept;
+               void ReadPlayerState(EntityState &) const noexcept;
+       };
+
 
        template<class PayloadType>
        PayloadType As() {