mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-08 23:13:10 -04:00
skip mojang login if offline (or better Config.skipAuthentication is set)
This commit is contained in:
parent
d40379f975
commit
1e40bf73e9
@ -16,4 +16,5 @@ package de.bixilon.minosoft;
|
||||
public class Config {
|
||||
public static String homeDir;
|
||||
public static String configFileName = "game.yml";
|
||||
public static boolean skipAuthentication = true; // only for offline developement#
|
||||
}
|
||||
|
@ -13,6 +13,7 @@
|
||||
|
||||
package de.bixilon.minosoft.mojang.api;
|
||||
|
||||
import de.bixilon.minosoft.Config;
|
||||
import de.bixilon.minosoft.Minosoft;
|
||||
import de.bixilon.minosoft.config.GameConfiguration;
|
||||
import de.bixilon.minosoft.logging.Log;
|
||||
@ -51,6 +52,9 @@ public class MojangAuthentication {
|
||||
}
|
||||
|
||||
public static void joinServer(MojangAccount account, String serverId) {
|
||||
if (Config.skipAuthentication) {
|
||||
return;
|
||||
}
|
||||
|
||||
JSONObject payload = new JSONObject();
|
||||
payload.put("accessToken", account.getAccessToken());
|
||||
@ -73,6 +77,9 @@ public class MojangAuthentication {
|
||||
}
|
||||
|
||||
public static String refresh(String clientToken, String accessToken) {
|
||||
if (Config.skipAuthentication) {
|
||||
return clientToken;
|
||||
}
|
||||
JSONObject payload = new JSONObject();
|
||||
payload.put("accessToken", accessToken);
|
||||
payload.put("clientToken", clientToken);
|
||||
|
Loading…
x
Reference in New Issue
Block a user