mirror of
https://github.com/DarkflameUniverse/DarkflameServer
synced 2024-08-30 18:43:58 +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 {
|
namespace PacketUtils {
|
||||||
template<typename T>
|
template<typename T>
|
||||||
void WriteHeader(RakNet::BitStream& bitStream, eConnectionType connectionType, T internalPacketID) {
|
void WriteHeader(RakNet::BitStream& bitStream, eConnectionType connectionType, T internalPacketID) {
|
||||||
bitStream.Write(MessageID(ID_USER_PACKET_ENUM));
|
bitStream.Write<uint8_t>(MessageID(ID_USER_PACKET_ENUM));
|
||||||
bitStream.Write(connectionType);
|
bitStream.Write<eConnectionType>(connectionType);
|
||||||
bitStream.Write(internalPacketID);
|
bitStream.Write<uint32_t>(static_cast<uint32_t>(internalPacketID));
|
||||||
bitStream.Write(uint8_t(0));
|
bitStream.Write<uint8_t>(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t ReadPacketU16(uint32_t startLoc, Packet* packet);
|
uint16_t ReadPacketU16(uint32_t startLoc, Packet* packet);
|
||||||
|
Loading…
Reference in New Issue
Block a user