mirror of
https://github.com/PaperMC/Waterfall.git
synced 2025-01-05 23:48:06 +01:00
Allow customisation of the Mojang auth url (#550)
This commit is contained in:
parent
7b4d6e99a9
commit
056d6687ef
31
BungeeCord-Patches/0058-Add-auth-url-option.patch
Normal file
31
BungeeCord-Patches/0058-Add-auth-url-option.patch
Normal file
@ -0,0 +1,31 @@
|
||||
From 6a2b973f2c1499eb5508cd3424a0660e4f44c803 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 b848e451..4b40b465 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
|
||||
@@ -70,6 +70,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
|
||||
@@ -442,7 +444,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.24.3 (Apple Git-128)
|
||||
|
Loading…
Reference in New Issue
Block a user