mirror of
https://github.com/hero-persson/FjordLauncherUnlocked.git
synced 2025-04-11 22:58:48 +02:00
legacy: handle URL-encoded session ID
This commit is contained in:
parent
d9ca7d2e74
commit
84e9606e4f
1 changed files with 10 additions and 1 deletions
|
@ -84,7 +84,16 @@ public final class OnlineModeFix {
|
|||
|
||||
// sessionId has the form:
|
||||
// token:<accessToken>:<player UUID>
|
||||
String accessToken = sessionId.split(":")[1];
|
||||
// or, as of Minecraft release 1.3.1, it may be URL encoded:
|
||||
// token%3A<accessToken>%3A<player UUID>
|
||||
String accessToken;
|
||||
if (sessionId.contains(":")) {
|
||||
accessToken = sessionId.split(":")[1];
|
||||
} else if (sessionId.contains("%3A")) {
|
||||
accessToken = sessionId.split("%3A")[1];
|
||||
} else {
|
||||
throw new AssertionError("invalid sessionId");
|
||||
}
|
||||
|
||||
String uuid = null;
|
||||
uuid = MojangApi.getUuid(user, proxy);
|
||||
|
|
Loading…
Add table
Reference in a new issue