mirror of
https://github.com/Minestom/Minestom.git
synced 2025-02-05 23:11:36 +01:00
Make Mojang SessionServer Configurable (#499)
This commit is contained in:
parent
b6bce86eca
commit
11d0f82b86
@ -26,6 +26,7 @@ import java.util.Arrays;
|
||||
import java.util.UUID;
|
||||
|
||||
public class EncryptionResponsePacket implements ClientPreplayPacket {
|
||||
private static final String MOJANG_AUTH_URL = System.getProperty("minestom.auth.url", "https://sessionserver.mojang.com/session/minecraft/hasJoined").concat("?username=%s&serverId=%s");
|
||||
private static final Gson GSON = new Gson();
|
||||
private byte[] sharedSecret;
|
||||
private byte[] verifyToken;
|
||||
@ -64,9 +65,7 @@ public class EncryptionResponsePacket implements ClientPreplayPacket {
|
||||
final String serverId = new BigInteger(digestedData).toString(16);
|
||||
final String username = URLEncoder.encode(loginUsername, StandardCharsets.UTF_8);
|
||||
|
||||
final String url = "https://sessionserver.mojang.com/session/minecraft/hasJoined?"
|
||||
+ "username=" + username + "&"
|
||||
+ "serverId=" + serverId;
|
||||
final String url = String.format(MOJANG_AUTH_URL, username, serverId);
|
||||
// TODO: Add ability to add ip query tag. See: https://wiki.vg/Protocol_Encryption#Authentication
|
||||
|
||||
final HttpClient client = HttpClient.newHttpClient();
|
||||
|
Loading…
Reference in New Issue
Block a user