mirror of
https://github.com/Minestom/Minestom.git
synced 2024-06-26 14:34:59 +02:00
Move MOJANG_AUTH_URL
This commit is contained in:
parent
0b4dd3b8aa
commit
85677360eb
|
@ -8,6 +8,7 @@ import org.jetbrains.annotations.Nullable;
|
|||
import java.security.KeyPair;
|
||||
|
||||
public final class MojangAuth {
|
||||
public static final String AUTH_URL = System.getProperty("minestom.auth.url", "https://sessionserver.mojang.com/session/minecraft/hasJoined").concat("?username=%s&serverId=%s");
|
||||
private static volatile boolean enabled = false;
|
||||
private static volatile KeyPair keyPair;
|
||||
|
||||
|
|
|
@ -26,7 +26,6 @@ import java.util.Arrays;
|
|||
import java.util.UUID;
|
||||
|
||||
public record EncryptionResponsePacket(byte[] sharedSecret, byte[] verifyToken) 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();
|
||||
|
||||
public EncryptionResponsePacket(BinaryReader reader) {
|
||||
|
@ -59,7 +58,7 @@ public record EncryptionResponsePacket(byte[] sharedSecret, byte[] verifyToken)
|
|||
final String serverId = new BigInteger(digestedData).toString(16);
|
||||
final String username = URLEncoder.encode(loginUsername, StandardCharsets.UTF_8);
|
||||
|
||||
final String url = String.format(MOJANG_AUTH_URL, username, serverId);
|
||||
final String url = String.format(MojangAuth.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