summaryrefslogtreecommitdiffstats
path: root/nms-patches/HandshakeListener.patch
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2017-05-30 21:25:59 +1000
committermd_5 <git@md-5.net>2017-05-30 21:55:13 +1000
commite13d1196863d5dcfea3d17b79238427dfb2c61b2 (patch)
tree56220ee8c2b98066fddfce1f7239a6f3e6261187 /nms-patches/HandshakeListener.patch
parentc155d8dd32556a197ab73c437760e6194ae4e04a (diff)
downloadcraftbukkit-e13d1196863d5dcfea3d17b79238427dfb2c61b2.tar
craftbukkit-e13d1196863d5dcfea3d17b79238427dfb2c61b2.tar.gz
craftbukkit-e13d1196863d5dcfea3d17b79238427dfb2c61b2.tar.lz
craftbukkit-e13d1196863d5dcfea3d17b79238427dfb2c61b2.tar.xz
craftbukkit-e13d1196863d5dcfea3d17b79238427dfb2c61b2.zip
Update to Minecraft 1.12-pre6
Diffstat (limited to 'nms-patches/HandshakeListener.patch')
-rw-r--r--nms-patches/HandshakeListener.patch16
1 files changed, 8 insertions, 8 deletions
diff --git a/nms-patches/HandshakeListener.patch b/nms-patches/HandshakeListener.patch
index 99a2fdd9..6d92c5f2 100644
--- a/nms-patches/HandshakeListener.patch
+++ b/nms-patches/HandshakeListener.patch
@@ -20,7 +20,7 @@
@@ -16,6 +26,41 @@
this.b.setProtocol(EnumProtocol.LOGIN);
- ChatComponentText chatcomponenttext;
+ ChatMessage chatmessage;
+ // CraftBukkit start - Connection throttle
+ try {
@@ -31,9 +31,9 @@
+ synchronized (throttleTracker) {
+ if (throttleTracker.containsKey(address) && !"127.0.0.1".equals(address.getHostAddress()) && currentTime - throttleTracker.get(address) < connectionThrottle) {
+ throttleTracker.put(address, currentTime);
-+ chatcomponenttext = new ChatComponentText("Connection throttled! Please wait before reconnecting.");
-+ this.b.sendPacket(new PacketLoginOutDisconnect(chatcomponenttext));
-+ this.b.close(chatcomponenttext);
++ chatmessage = new ChatMessage("Connection throttled! Please wait before reconnecting.");
++ this.b.sendPacket(new PacketLoginOutDisconnect(chatmessage));
++ this.b.close(chatmessage);
+ return;
+ }
+
@@ -57,11 +57,11 @@
+ }
+ // CraftBukkit end
+
- if (packethandshakinginsetprotocol.b() > 332) {
- chatcomponenttext = new ChatComponentText("Outdated server! I\'m still on 1.12-pre5");
- this.b.sendPacket(new PacketLoginOutDisconnect(chatcomponenttext));
+ if (packethandshakinginsetprotocol.b() > 333) {
+ chatmessage = new ChatMessage("multiplayer.disconnect.outdated_server", new Object[] { "1.12-pre6"});
+ this.b.sendPacket(new PacketLoginOutDisconnect(chatmessage));
@@ -26,6 +71,7 @@
- this.b.close(chatcomponenttext);
+ this.b.close(chatmessage);
} else {
this.b.setPacketListener(new LoginListener(this.a, this.b));
+ ((LoginListener) this.b.i()).hostname = packethandshakinginsetprotocol.hostname + ":" + packethandshakinginsetprotocol.port; // CraftBukkit - set hostname