Waterfall/BungeeCord-Patches/0055-Add-auth-url-option.patch
_tomcraft 85c0a35f0b
Updated Upstream (BungeeCord) (#695)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

BungeeCord Changes:
6613aaea Add test fix for library classes being visible to non-dependent plugins
53ce6b93 #3200: Fix protocol for 21w40a
d8e29384 #2466: Use switch in "BungeeCord" plugin message handling
5cf869df #3198: Remove terminally deprecated SecurityManager
f26f7d88 Add optional 1.18 (21w40a) snapshot protocol support
2021-10-09 10:43:12 +01:00

32 lines
1.7 KiB
Diff

From 1da5defd28c4fad2c5b3448ea8ab4752ce2b4431 Mon Sep 17 00:00:00 2001
From: theminecoder <theminecoder.dev@gmail.com>
Date: Sun, 19 Jul 2020 10:18:23 +1000
Subject: [PATCH] Add auth url option
diff --git a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java
index d07f60c9..0fd58e83 100644
--- a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java
+++ b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java
@@ -73,6 +73,8 @@ import net.md_5.bungee.util.QuietException;
public class InitialHandler extends PacketHandler implements PendingConnection
{
+ private static final String MOJANG_AUTH_URL = System.getProperty("waterfall.auth.url", "https://sessionserver.mojang.com/session/minecraft/hasJoined?username=%s&serverId=%s%s");
+
private final BungeeCord bungee;
private ChannelWrapper ch;
@Getter
@@ -448,7 +450,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection
String encodedHash = URLEncoder.encode( new BigInteger( sha.digest() ).toString( 16 ), "UTF-8" );
String preventProxy = ( BungeeCord.getInstance().config.isPreventProxyConnections() && getSocketAddress() instanceof InetSocketAddress ) ? "&ip=" + URLEncoder.encode( getAddress().getAddress().getHostAddress(), "UTF-8" ) : "";
- String authURL = "https://sessionserver.mojang.com/session/minecraft/hasJoined?username=" + encName + "&serverId=" + encodedHash + preventProxy;
+ String authURL = String.format( MOJANG_AUTH_URL, encName, encodedHash, preventProxy );
Callback<String> handler = new Callback<String>()
{
--
2.30.1 (Apple Git-130)