diff options
author | Travis Watkins <amaranth@ubuntu.com> | 2012-08-03 00:46:21 -0500 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2012-08-03 01:04:10 -0500 |
commit | dcf83bc1b5e17d0a599b00aaba813d2ccff68dbb (patch) | |
tree | 9cb9388d7d1fedc94be467ffb5357a56827e97f3 /src/main/java/net/minecraft/server/DedicatedServerConnectionThread.java | |
parent | e156354a60d0286c66f18dd1fc4ad9e7e5852075 (diff) | |
download | craftbukkit-dcf83bc1b5e17d0a599b00aaba813d2ccff68dbb.tar craftbukkit-dcf83bc1b5e17d0a599b00aaba813d2ccff68dbb.tar.gz craftbukkit-dcf83bc1b5e17d0a599b00aaba813d2ccff68dbb.tar.lz craftbukkit-dcf83bc1b5e17d0a599b00aaba813d2ccff68dbb.tar.xz craftbukkit-dcf83bc1b5e17d0a599b00aaba813d2ccff68dbb.zip |
Restore configurable connection throttle.
Diffstat (limited to 'src/main/java/net/minecraft/server/DedicatedServerConnectionThread.java')
-rw-r--r-- | src/main/java/net/minecraft/server/DedicatedServerConnectionThread.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/main/java/net/minecraft/server/DedicatedServerConnectionThread.java b/src/main/java/net/minecraft/server/DedicatedServerConnectionThread.java index f27ce28f..28f804bf 100644 --- a/src/main/java/net/minecraft/server/DedicatedServerConnectionThread.java +++ b/src/main/java/net/minecraft/server/DedicatedServerConnectionThread.java @@ -22,7 +22,9 @@ public class DedicatedServerConnectionThread extends Thread { private final InetAddress g; private final int h; - public DedicatedServerConnectionThread(ServerConnection serverconnection, InetAddress inetaddress, int i) { + long connectionThrottle; // CraftBukkit + + public DedicatedServerConnectionThread(ServerConnection serverconnection, InetAddress inetaddress, int i) throws IOException { // CraftBukkit - added throws super("Listen thread"); this.f = serverconnection; this.g = inetaddress; @@ -62,8 +64,17 @@ public class DedicatedServerConnectionThread extends Thread { long i = System.currentTimeMillis(); HashMap hashmap = this.c; + // CraftBukkit start + if (((MinecraftServer) this.f.d()).server == null) { + socket.close(); + continue; + } + + connectionThrottle = ((MinecraftServer) this.f.d()).server.getConnectionThrottle(); + // CraftBukkit end + synchronized (this.c) { - if (this.c.containsKey(inetaddress) && !b(inetaddress) && i - ((Long) this.c.get(inetaddress)).longValue() < 4000L) { + if (this.c.containsKey(inetaddress) && !b(inetaddress) && i - ((Long) this.c.get(inetaddress)).longValue() < connectionThrottle) { this.c.put(inetaddress, Long.valueOf(i)); socket.close(); continue; |