From 1aa048c61eaa676dd9555f36ff25c9f8e61aaedf Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 24 Jun 2013 07:42:20 +1000 Subject: [PATCH] Use our throttle method, diff needs a little bit of work. May be buggy, use with care. --- CraftBukkit-Patches/0025-Netty.patch | 29 +++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/CraftBukkit-Patches/0025-Netty.patch b/CraftBukkit-Patches/0025-Netty.patch index 4937d7561..f6d64ef2b 100644 --- a/CraftBukkit-Patches/0025-Netty.patch +++ b/CraftBukkit-Patches/0025-Netty.patch @@ -1,4 +1,4 @@ -From 621ccf948dca29b783bec47193d22a899efb586d Mon Sep 17 00:00:00 2001 +From f2ce2a2090688544df1fe5fd7d33ee5df2e98ada Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 23 Jun 2013 16:32:51 +1000 Subject: [PATCH] Netty @@ -45,10 +45,33 @@ index 59444cb..9e6e318 100644 this.getLogger().warning("**** FAILED TO BIND TO PORT!"); this.getLogger().warning("The exception was: {0}", new Object[] { ioexception.toString()}); diff --git a/src/main/java/net/minecraft/server/DedicatedServerConnectionThread.java b/src/main/java/net/minecraft/server/DedicatedServerConnectionThread.java -index ef7e10d..5f2e42e 100644 +index ef7e10d..e25819d 100644 --- a/src/main/java/net/minecraft/server/DedicatedServerConnectionThread.java +++ b/src/main/java/net/minecraft/server/DedicatedServerConnectionThread.java -@@ -82,7 +82,7 @@ public class DedicatedServerConnectionThread extends Thread { +@@ -66,23 +66,19 @@ public class DedicatedServerConnectionThread extends Thread { + socket.close(); + continue; + } ++ // CraftBukkit end + +- connectionThrottle = ((MinecraftServer) this.e.d()).server.getConnectionThrottle(); +- +- synchronized (this.b) { +- if (this.b.containsKey(address) && !"127.0.0.1".equals(address.getHostAddress()) && currentTime - ((Long) this.b.get(address)).longValue() < connectionThrottle) { +- this.b.put(address, Long.valueOf(currentTime)); +- socket.close(); +- continue; +- } +- +- this.b.put(address, Long.valueOf(currentTime)); ++ // Spigot Start ++ if ( ( (org.spigotmc.MultiplexingServerConnection) MinecraftServer.getServer().ae() ).throttle( address ) ) ++ { ++ socket.close(); ++ continue; + } +- // CraftBukkit end ++ // Spigot end PendingConnection pendingconnection = new PendingConnection(this.e.d(), socket, "Connection #" + this.c++);