summaryrefslogtreecommitdiffstats
path: root/nms-patches/HandshakeListener.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nms-patches/HandshakeListener.patch')
-rw-r--r--nms-patches/HandshakeListener.patch12
1 files changed, 7 insertions, 5 deletions
diff --git a/nms-patches/HandshakeListener.patch b/nms-patches/HandshakeListener.patch
index 081af021..920c5c6a 100644
--- a/nms-patches/HandshakeListener.patch
+++ b/nms-patches/HandshakeListener.patch
@@ -18,7 +18,7 @@
private final MinecraftServer a;
private final NetworkManager b;
-@@ -11,12 +21,48 @@
+@@ -11,21 +21,58 @@
}
public void a(PacketHandshakingInSetProtocol packethandshakinginsetprotocol) {
@@ -28,7 +28,6 @@
this.b.setProtocol(EnumProtocol.LOGIN);
ChatComponentText chatcomponenttext;
-- if (packethandshakinginsetprotocol.b() > 107) {
+ // CraftBukkit start - Connection throttle
+ try {
+ long currentTime = System.currentTimeMillis();
@@ -64,11 +63,14 @@
+ }
+ // CraftBukkit end
+
-+ if (packethandshakinginsetprotocol.b() > 109) {
- chatcomponenttext = new ChatComponentText("Outdated server! I\'m still on 1.9");
+ if (packethandshakinginsetprotocol.b() > 109) {
+ chatcomponenttext = new ChatComponentText("Outdated server! I\'m still on 1.9.2");
this.b.sendPacket(new PacketLoginOutDisconnect(chatcomponenttext));
this.b.close(chatcomponenttext);
-@@ -26,6 +72,7 @@
+- } else if (packethandshakinginsetprotocol.b() < 109) {
++ } else if (packethandshakinginsetprotocol.b() < 107) {
+ chatcomponenttext = new ChatComponentText("Outdated client! Please use 1.9.2");
+ this.b.sendPacket(new PacketLoginOutDisconnect(chatcomponenttext));
this.b.close(chatcomponenttext);
} else {
this.b.setPacketListener(new LoginListener(this.a, this.b));