2024-04-02 19:16:10 +02:00
|
|
|
From f1aae6c964dfc1b53891c412dbf2073e48f4ef36 Mon Sep 17 00:00:00 2001
|
2020-08-13 21:59:22 +02:00
|
|
|
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
|
2024-02-24 18:21:31 +01:00
|
|
|
index d8d65093..ffb078d6 100644
|
2020-08-13 21:59:22 +02:00
|
|
|
--- a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java
|
|
|
|
+++ b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java
|
2024-02-24 18:21:31 +01:00
|
|
|
@@ -83,6 +83,8 @@ import net.md_5.bungee.util.QuietException;
|
2020-08-13 21:59:22 +02:00
|
|
|
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
|
2024-02-24 18:21:31 +01:00
|
|
|
@@ -530,7 +532,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection
|
2020-08-13 21:59:22 +02:00
|
|
|
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>()
|
|
|
|
{
|
|
|
|
--
|
2024-04-02 19:16:10 +02:00
|
|
|
2.44.0
|
2020-08-13 21:59:22 +02:00
|
|
|
|