papermc/CraftBukkit-Patches/0071-Prevent-Duplicate-Handshakes.patch
2013-09-03 11:17:26 +10:00

21 lines
1 KiB
Diff

From cd94b224bb10b79c8d8252d549066b12741c6f3e Mon Sep 17 00:00:00 2001
From: Nathan Adams <dinnerbone@dinnerbone.com>
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