From 7e616385957ec683b48067e9c5960f17a270c7aa Mon Sep 17 00:00:00 2001 From: David Markowitz <39972741+EmosewaMC@users.noreply.github.com> Date: Sat, 6 May 2023 23:45:07 -0700 Subject: [PATCH] Reinforce PacketUtils writing (#1073) Ensure the correct size is written to the bitstream. It is always supposed to write 64 bits. --- dNet/PacketUtils.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dNet/PacketUtils.h b/dNet/PacketUtils.h index 7c917f2e..d07759a0 100644 --- a/dNet/PacketUtils.h +++ b/dNet/PacketUtils.h @@ -10,10 +10,10 @@ enum class eConnectionType : uint16_t; namespace PacketUtils { template void WriteHeader(RakNet::BitStream& bitStream, eConnectionType connectionType, T internalPacketID) { - bitStream.Write(MessageID(ID_USER_PACKET_ENUM)); - bitStream.Write(connectionType); - bitStream.Write(internalPacketID); - bitStream.Write(uint8_t(0)); + bitStream.Write(MessageID(ID_USER_PACKET_ENUM)); + bitStream.Write(connectionType); + bitStream.Write(static_cast(internalPacketID)); + bitStream.Write(0); } uint16_t ReadPacketU16(uint32_t startLoc, Packet* packet);