diff options
Diffstat (limited to 'nms-patches/HandshakeListener.patch')
-rw-r--r-- | nms-patches/HandshakeListener.patch | 16 |
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 |