Change LUBitstream to make more sense and only read what it needs from the bitstream at each level

This commit is contained in:
Aaron Kimbrell
2025-09-12 22:25:55 -05:00
parent b36b440eba
commit 500a72dc11
16 changed files with 217 additions and 101 deletions

View File

@@ -12,6 +12,20 @@
#include "ServiceType.h"
#include "MessageType/Chat.h"
namespace ChatPackets {
// Struct Functions
void ChatLUBitStream::Serialize(RakNet::BitStream& bitStream) const {
bitStream.Write(this->messageType);
bitStream.Write<uint8_t>(0); // padding
}
bool ChatLUBitStream::Deserialize(RakNet::BitStream& bitStream) {
VALIDATE_READ(bitStream.Read(this->messageType));
uint8_t padding = 0;
VALIDATE_READ(bitStream.Read(padding));
return true;
}
}
void ShowAllRequest::Serialize(RakNet::BitStream& bitStream) {
BitStreamUtils::WriteHeader(bitStream, ServiceType::CHAT, MessageType::Chat::SHOW_ALL);
bitStream.Write(this->requestor);