mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 01:49:40 +00:00
Fix Packet Logging
This commit is contained in:
1 parent
f573259fd1
commit
dcf3a0d8b0
4 files changed
+12
-31
No files matched your search
@@ -21,8 +21,6 @@ public abstract class LargeAbstractPacket extends AbstractPacket {
|
||||
int totalSize = data.length;
|
||||
UUID packetId = UUID.randomUUID();
|
||||
|
||||
System.out.println("Sending data with packetId: " + packetId + ", totalSize: " + totalSize);
|
||||
|
||||
// Break the data into chunks of CHUNK_SIZE bytes each
|
||||
for (int offset = 0; offset < totalSize; offset += CHUNK_SIZE) {
|
||||
int chunkSize = Math.min(CHUNK_SIZE, totalSize - offset);
|
||||
@@ -36,8 +34,6 @@ public abstract class LargeAbstractPacket extends AbstractPacket {
|
||||
|
||||
// Write the chunk bytes
|
||||
out.writeBytes(data, offset, chunkSize);
|
||||
|
||||
System.out.println("Sent chunk with offset: " + offset + ", size: " + chunkSize);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,11 +57,6 @@ public abstract class LargeAbstractPacket extends AbstractPacket {
|
||||
// Read the exact chunk data
|
||||
ByteBuf chunk = in.readBytes(chunkSize);
|
||||
|
||||
System.out.println("Receiving data: packetId=" + packetId
|
||||
+ ", totalSize=" + totalSize
|
||||
+ ", offset=" + offset
|
||||
+ ", chunkSize=" + chunkSize);
|
||||
|
||||
// Store the received chunk in a PacketStorage
|
||||
PacketStorage storage = packetChunks.computeIfAbsent(packetId,
|
||||
k -> new PacketStorage(Unpooled.buffer(totalSize), 0, totalSize));
|
||||
@@ -83,8 +74,6 @@ public abstract class LargeAbstractPacket extends AbstractPacket {
|
||||
// Copy (or slice) the exact bytes, then handle them
|
||||
ByteBuf completeData = storage.data.copy(0, totalSize);
|
||||
|
||||
System.out.println("Received complete data for packetId: " + packetId);
|
||||
|
||||
// Clean up and handle
|
||||
storage.data.release();
|
||||
handleCompleteData(completeData, player);
|
||||
|
||||
Reference in new issue
Block a user