Waterfall/BungeeCord-Patches/0053-Add-auth-url-option.patch
Shane Freeder 25ecd402f3
Updated Upstream (BungeeCord)
Upstream has released updates that appear 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:
1a807731 #3567: Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.6.2 to 3.6.3
772ad995 #3566: Bump actions/setup-java from 3 to 4
2431c40a #3562: Bump io.netty:netty-bom from 4.1.100.Final to 4.1.101.Final
8144ae8d #3555: Bump com.mysql:mysql-connector-j from 8.1.0 to 8.2.0
0757c39a Attempt upgrade of resolver libraries
2023-12-13 15:18:04 +00:00

32 lines
1.7 KiB
Diff

From c97c6f85ccca1dbf601500ee7b975788d7af7acc 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 b0caf6d6..03608ef1 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
@@ -74,6 +74,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
@@ -498,7 +500,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.43.0