From bcbff04979d29d3a5a59cf0fa6daa35324bcf46c Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Sat, 25 Apr 2020 11:25:59 +0200 Subject: [PATCH] Fixed the invalid packet splitting algorithm --- src/protocol/Packet.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/protocol/Packet.h b/src/protocol/Packet.h index dce57ff..9a796d9 100644 --- a/src/protocol/Packet.h +++ b/src/protocol/Packet.h @@ -449,12 +449,12 @@ namespace ts { this->packet_id_bytes[1] = id & 0xFFU; } - [[nodiscard]] inline auto packet_id() const { + [[nodiscard]] inline uint16_t packet_id() const { return (uint16_t) (this->packet_id_bytes[0] << 8U) | this->packet_id_bytes[1]; } [[nodiscard]] inline auto packet_type() const { - return (PacketType) (this->type_and_flags & 0xF); + return (PacketType) (this->type_and_flags & 0xFU); } private: void object_freed();