Add warning when null chunk buffers are encountered - most likely due to the orebfuscator plugin.

This commit is contained in:
md_5 2014-02-01 18:07:22 +11:00
parent 161e853450
commit 61a227c8c3

View File

@ -1,4 +1,4 @@
From cf130aa4f7b9f3dae460f43d761870222b408fcd Mon Sep 17 00:00:00 2001
From 0db589c05b3eb0d213df3e7640818b77935c2e02 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Tue, 28 Jan 2014 20:32:07 +1100
Subject: [PATCH] Implement Threaded Bulk Chunk Compression and Caching
@ -106,10 +106,10 @@ index fb95be4..a382235 100644
ServerConnection.a(this.a).add(networkmanager);
diff --git a/src/main/java/org/spigotmc/ChunkCompressor.java b/src/main/java/org/spigotmc/ChunkCompressor.java
new file mode 100644
index 0000000..78560c6
index 0000000..481211b
--- /dev/null
+++ b/src/main/java/org/spigotmc/ChunkCompressor.java
@@ -0,0 +1,87 @@
@@ -0,0 +1,94 @@
+package org.spigotmc;
+
+import java.util.Arrays;
@ -141,6 +141,13 @@ index 0000000..78560c6
+ if ( msg instanceof PacketPlayOutMapChunkBulk )
+ {
+ PacketPlayOutMapChunkBulk chunk = (PacketPlayOutMapChunkBulk) msg;
+ // Well shit, orebfuscator is at it again
+ if ( chunk.inflatedBuffers == null )
+ {
+ Bukkit.getServer().getLogger().warning( "chunk.inflatedBuffers is null. Are you running Oreobfuscator? If so, please note that it is unsupported and will disable async compression" );
+ super.write( ctx, msg, promise );
+ }
+
+ // Here we assign a hash to the chunk based on its contents. CRC32 is fast and sufficient for use here.
+ CRC32 crc = new CRC32();
+ for ( byte[] c : chunk.inflatedBuffers )