From 5c6d64a8b7ad3b7204eb58be4fe7d0ff174a7949 Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Tue, 3 Sep 2013 11:17:26 +1000 Subject: [PATCH] Prevent Duplicate Handshakes --- .../0071-Prevent-Duplicate-Handshakes.patch | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 CraftBukkit-Patches/0071-Prevent-Duplicate-Handshakes.patch diff --git a/CraftBukkit-Patches/0071-Prevent-Duplicate-Handshakes.patch b/CraftBukkit-Patches/0071-Prevent-Duplicate-Handshakes.patch new file mode 100644 index 0000000000..7289612e45 --- /dev/null +++ b/CraftBukkit-Patches/0071-Prevent-Duplicate-Handshakes.patch @@ -0,0 +1,21 @@ +From cd94b224bb10b79c8d8252d549066b12741c6f3e Mon Sep 17 00:00:00 2001 +From: Nathan Adams +Date: Tue, 3 Sep 2013 11:17:14 +1000 +Subject: [PATCH] Prevent Duplicate Handshakes + + +diff --git a/src/main/java/net/minecraft/server/PendingConnection.java b/src/main/java/net/minecraft/server/PendingConnection.java +index 3aeff44..f2aa839 100644 +--- a/src/main/java/net/minecraft/server/PendingConnection.java ++++ b/src/main/java/net/minecraft/server/PendingConnection.java +@@ -68,6 +68,7 @@ public class PendingConnection extends Connection { + + private static final java.util.regex.Pattern validName = java.util.regex.Pattern.compile("^[a-zA-Z0-9_-]{2,16}$"); // Spigot + public void a(Packet2Handshake packet2handshake) { ++ if (this.g != null) { this.disconnect("Quit repeating yourself."); return; } // Spigot - Thanks Dinnerbone! + // CraftBukkit start + this.hostname = packet2handshake.c == null ? "" : packet2handshake.c + ':' + packet2handshake.d; + // CraftBukkit end +-- +1.8.1.2 +