mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-10-12 18:38:10 +00:00
Change LUBitstream to make more sense and only read what it needs from the bitstream at each level
This commit is contained in:
@@ -165,15 +165,12 @@ int main(int argc, char** argv) {
|
||||
}
|
||||
|
||||
void HandlePacket(Packet* packet) {
|
||||
if (packet->length < 4) return;
|
||||
|
||||
CINSTREAM;
|
||||
LUBitStream luBitStream;
|
||||
if (!luBitStream.ReadHeader(inStream)) return;
|
||||
|
||||
if (luBitStream.connectionType == ServiceType::COMMON) {
|
||||
if (!luBitStream.ReadHeader(inStream) && luBitStream.rakNetID != ID_USER_PACKET_ENUM) return;
|
||||
else if (luBitStream.serviceType == ServiceType::COMMON) {
|
||||
CommonPackets::Handle(inStream, packet->systemAddress);
|
||||
} else if (luBitStream.connectionType == ServiceType::AUTH) {
|
||||
} else if (luBitStream.serviceType == ServiceType::AUTH) {
|
||||
AuthPackets::Handle(inStream, packet->systemAddress);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user