Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.7.3] Update to OpenAuth 1.1.6, now using xuid and clientId #92

Merged
merged 2 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
project_version=1.7.2
project_version=1.7.3
2 changes: 1 addition & 1 deletion headlessmc-launcher/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies {
jarLibs group: 'org.ow2.asm', name: 'asm', version: '9.5'
jarLibs group: 'org.ow2.asm', name: 'asm-tree', version: '9.5'
jarLibs group: 'com.google.code.gson', name: 'gson', version: '2.10.1'
jarLibs group: 'fr.litarvan', name: 'openauth', version: '1.1.5'
jarLibs group: 'fr.litarvan', name: 'openauth', version: '1.1.6'

includeJarInResources ('net.kunmc.lab:forgecli:1.1.0:all') {
// this is to make it build, jar will still have legacy classes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@Getter
@RequiredArgsConstructor
public class Launcher implements HeadlessMc {
public static final String VERSION = "1.7.2";
public static final String VERSION = "1.7.3";

@Delegate
private final HeadlessMc headlessMc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,12 @@ public class Account implements HasName {
@SerializedName("refreshToken")
private String refreshToken;

@ToString.Exclude
@SerializedName("xuid")
private String xuid;

@ToString.Exclude
@SerializedName("clientId")
private String clientId;

}
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ private Account toAccount(MicrosoftAuthResult result) {
return new Account(result.getProfile().getName(),
result.getProfile().getId(),
result.getAccessToken(),
result.getRefreshToken());
result.getRefreshToken(),
result.getXuid(),
result.getClientId());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ public static ArgumentAdapter create(Launcher launcher,
adapter.add("${launcher_version}", config.get(
LauncherProperties.LAUNCHER_VERSION, Launcher.VERSION));

// TODO: find out wtf this is
adapter.add("${auth_xuid}", config.get(LauncherProperties.XUID));
// TODO: find out wtf this is
adapter.add("${clientid}", config.get(LauncherProperties.CLIENT_ID));
adapter.add("${auth_xuid}", config.get(
LauncherProperties.XUID, account.getXuid()));
adapter.add("${clientid}", config.get(
LauncherProperties.CLIENT_ID, account.getClientId()));
// TODO: this is {} for the normal launcher too
adapter.add("${user_properties}", config.get(
LauncherProperties.USER_PROPERTIES, "{}"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public DummyAccountManager(AccountStore accountStore,

@Override
public Account login(Config config) {
return new Account("d", "d", "d", "d");
return new Account("d", "d", "d", "d", "d", "d");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
@CustomLog
@Disabled("Authentification tests are only meant to be tested manually.")
public class TestAuth {
private static final Account DUMMY = new Account("d", "d", "d", "d");
private static final Account DUMMY = new Account("d", "d", "d", "d", "d", "d");
private static final AccountValidator VALIDATOR = new AccountValidator();

@Test
Expand Down
2 changes: 1 addition & 1 deletion headlessmc-scripts/hmc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/env sh
java -jar headlessmc-launcher-1.7.2.jar --command $@
java -jar headlessmc-launcher-1.7.3.jar --command $@
2 changes: 1 addition & 1 deletion headlessmc-scripts/hmc.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@echo off
"%JAVA_HOME%\bin\java" -jar headlessmc-launcher-1.7.2.jar --command %*
"%JAVA_HOME%\bin\java" -jar headlessmc-launcher-1.7.3.jar --command %*
2 changes: 1 addition & 1 deletion headlessmc-scripts/hmw
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
# when running in docker on windows bash seems to be at /bin/bash TODO: can we make this one script?
java -jar headlessmc-launcher-1.7.2.jar --command $@
java -jar headlessmc-launcher-1.7.3.jar --command $@
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
rootProject.name = 'HeadlessMC'
rootProject.name = 'headlessmc'
include 'headlessmc-api'
include 'headlessmc-commons'
include 'headlessmc-runtime'
Expand Down