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

@@ -47,16 +47,16 @@ struct LUWString {
};
struct LUBitStream {
ServiceType connectionType = ServiceType::UNKNOWN;
uint32_t internalPacketID = 0xFFFFFFFF;
// Common header data that is serialized
MessageID rakNetID = ID_USER_PACKET_ENUM;
ServiceType serviceType = ServiceType::UNKNOWN;
SystemAddress sysAddr = UNASSIGNED_SYSTEM_ADDRESS;
LUBitStream() = default;
template <typename T>
LUBitStream(ServiceType connectionType, T internalPacketID) {
this->connectionType = connectionType;
this->internalPacketID = static_cast<uint32_t>(internalPacketID);
LUBitStream(ServiceType serviceType) {
this->serviceType = serviceType;
}
void WriteHeader(RakNet::BitStream& bitStream) const;