mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-12-22 13:33:35 +00:00
Reinforce PacketUtils writing (#1073)
Ensure the correct size is written to the bitstream. It is always supposed to write 64 bits.
This commit is contained in:
parent
33c12f3bc5
commit
7e61638595
@ -10,10 +10,10 @@ enum class eConnectionType : uint16_t;
|
||||
namespace PacketUtils {
|
||||
template<typename T>
|
||||
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<uint8_t>(MessageID(ID_USER_PACKET_ENUM));
|
||||
bitStream.Write<eConnectionType>(connectionType);
|
||||
bitStream.Write<uint32_t>(static_cast<uint32_t>(internalPacketID));
|
||||
bitStream.Write<uint8_t>(0);
|
||||
}
|
||||
|
||||
uint16_t ReadPacketU16(uint32_t startLoc, Packet* packet);
|
||||
|
Loading…
Reference in New Issue
Block a user