Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 12:30:06 +01:00
31 Zeilen
2.1 KiB
Diff
31 Zeilen
2.1 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Shane Freeder <theboyetronic@gmail.com>
|
|
Date: Sun, 18 Apr 2021 21:27:01 +0100
|
|
Subject: [PATCH] Add bypass host check
|
|
|
|
Paper.bypassHostCheck
|
|
|
|
Seriously, fix your firewalls. -.-
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/network/HandshakeListener.java b/src/main/java/net/minecraft/server/network/HandshakeListener.java
|
|
index 26fe1f612e9dab37e5bf6bc431eb362bd7e4803a..74006c0af831c0e6a2b84b3638e397ab54984dc5 100644
|
|
--- a/src/main/java/net/minecraft/server/network/HandshakeListener.java
|
|
+++ b/src/main/java/net/minecraft/server/network/HandshakeListener.java
|
|
@@ -30,6 +30,7 @@ public class HandshakeListener implements PacketHandshakingInListener {
|
|
private static final IChatBaseComponent a = new ChatComponentText("Ignoring status request");
|
|
private final MinecraftServer b;
|
|
private final NetworkManager c; final NetworkManager getNetworkManager() { return this.c; } // Paper - OBFHELPER
|
|
+ private static final boolean BYPASS_HOSTCHECK = Boolean.getBoolean("Paper.bypassHostCheck"); // Paper
|
|
|
|
public HandshakeListener(MinecraftServer minecraftserver, NetworkManager networkmanager) {
|
|
this.b = minecraftserver;
|
|
@@ -118,7 +119,7 @@ public class HandshakeListener implements PacketHandshakingInListener {
|
|
// Spigot Start
|
|
//if (org.spigotmc.SpigotConfig.bungee) { // Paper - comment out, we check above!
|
|
String[] split = packethandshakinginsetprotocol.hostname.split("\00");
|
|
- if ( ( split.length == 3 || split.length == 4 ) && ( HOST_PATTERN.matcher( split[1] ).matches() ) ) {
|
|
+ if ( ( split.length == 3 || split.length == 4 ) && ( BYPASS_HOSTCHECK || HOST_PATTERN.matcher( split[1] ).matches() ) ) { // Paper
|
|
packethandshakinginsetprotocol.hostname = split[0];
|
|
c.socketAddress = new java.net.InetSocketAddress(split[1], ((java.net.InetSocketAddress) c.getSocketAddress()).getPort());
|
|
c.spoofedUUID = com.mojang.util.UUIDTypeAdapter.fromString( split[2] );
|