diff options
-rwxr-xr-x | .gitignore | 2 | ||||
-rw-r--r-- | .vscode/launch.json | 29 | ||||
-rwxr-xr-x | build.gradle | 2 | ||||
-rw-r--r-- | gradle.properties | 1 | ||||
-rw-r--r-- | loader/build.gradle | 20 | ||||
-rwxr-xr-x | loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/Main.java | 8 | ||||
-rwxr-xr-x | loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/authentication/Authenticator.java | 5 | ||||
-rw-r--r-- | mod/build.gradle | 2 | ||||
-rw-r--r-- | runtime/.mixin.out/audit/mixin_implementation_report.csv | 1 | ||||
-rw-r--r-- | runtime/.mixin.out/audit/mixin_implementation_report.txt | 1 | ||||
-rw-r--r-- | settings.gradle | 1 |
11 files changed, 57 insertions, 15 deletions
@@ -5,11 +5,11 @@ eclipse/* build/* jars/* -runtime/* run/* DEBUG/* sdk/* essential/* +runtime/* # Ignore Gradle GUI config gradle-app.setting diff --git a/.vscode/launch.json b/.vscode/launch.json index b3e96bec..60ab5bbf 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,4 +1,31 @@ { "version": "0.2.0", - "configurations": [] + "configurations": [ + { + "type": "java", + "name": "Minecraft Client", + "request": "launch", + "cwd": "${workspaceFolder}/runtime", + "console": "internalConsole", + "stopOnEntry": false, + "mainClass": "net.fabricmc.devlaunchinjector.Main", + "vmArgs": "\"-Dfabric.dli.config\u003d/home/syeyoung/Documents/dungeonsguide/Dungeons@@0020Guide/.gradle/loom-cache/launch.cfg\" \"-Dfabric.dli.env\u003dclient\" \"-Dfabric.dli.main\u003dnet.minecraft.launchwrapper.Launch\"", + "args": "", + "env": {}, + "projectName": "" + }, + { + "type": "java", + "name": "Minecraft Server", + "request": "launch", + "cwd": "${workspaceFolder}/run", + "console": "internalConsole", + "stopOnEntry": false, + "mainClass": "net.fabricmc.devlaunchinjector.Main", + "vmArgs": "\"-Dfabric.dli.config\u003d/home/syeyoung/Documents/dungeonsguide/Dungeons@@0020Guide/.gradle/loom-cache/launch.cfg\" \"-Dfabric.dli.env\u003dserver\" \"-Dfabric.dli.main\u003dnet.minecraft.launchwrapper.Launch\"", + "args": "\"nogui\"", + "env": {}, + "projectName": "" + } + ] }
\ No newline at end of file diff --git a/build.gradle b/build.gradle index 5987721e..83f62df1 100755 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,3 @@ - - tasks.wrapper { gradleVersion = "7.4" // You can either download the binary-only version of Gradle (BIN) or diff --git a/gradle.properties b/gradle.properties index 6c41dec1..ab7e8705 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,3 @@ org.gradle.jvmargs=-Xmx2G +org.gradle.caching=true loom.platform=forge
\ No newline at end of file diff --git a/loader/build.gradle b/loader/build.gradle index a86269ce..14bd8e7b 100644 --- a/loader/build.gradle +++ b/loader/build.gradle @@ -10,18 +10,27 @@ version = "4.0.0" group = "kr.syeyoung.dungeonsguide" archivesBaseName = "dungeonsguide" + java { toolchain.languageVersion.set(JavaLanguageVersion.of(8)) } loom { launchConfigs { - "client" { + client { // probably will have to my own mixin tweaker, due to dungeonsguide's weird dynamic loading stuff // property("mixin.debug", "true") // property("asmhelper.verbose", "true") // arg("--tweakClass", "org.spongepowered.asm.launch.MixinTweaker") // arg("--mixin", "mixins.examplemod.json") + + } + } + runs { + client { + runDir = 'runtime' + property('devauth.enabled','true') + client() } } forge { @@ -38,6 +47,8 @@ sourceSets.main { repositories { mavenCentral() maven { url "https://jitpack.io" } + // dev auth + maven {url "https://pkgs.dev.azure.com/djtheredstoner/DevAuth/_packaging/public/maven/v1"} } configurations { @@ -54,6 +65,7 @@ dependencies { implementation "org.json:json:20171018" implementation 'io.nayuki:qrcodegen:1.4.0' + runtimeOnly project(':mod') compileOnly "org.projectlombok:lombok:1.18.20" annotationProcessor "org.projectlombok:lombok:1.18.16" @@ -61,7 +73,8 @@ dependencies { testCompileOnly "org.projectlombok:lombok:1.18.20" testAnnotationProcessor "org.projectlombok:lombok:1.18.20" - runtimeOnly project(":mod") + + modRuntimeOnly("me.djtheredstoner:DevAuth-forge-legacy:1.1.0") } @@ -70,7 +83,7 @@ tasks.withType(JavaCompile) { } tasks.withType(Jar) { - archiveBaseName = "examplemod" + archivesBaseName = "dungeonsguide-loader" manifest { attributes["FMLCorePluginContainsFMLMod"] = "true" attributes["ForceLoadAsMod"] = "true" @@ -83,7 +96,6 @@ tasks.withType(Jar) { tasks.shadowJar { - archiveFileName = jar.archiveFileName relocate "org.java_websocket", "kr.syeyoung.org.java_websocket" diff --git a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/Main.java b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/Main.java index 1df59f83..66d7e79b 100755 --- a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/Main.java +++ b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/Main.java @@ -18,6 +18,8 @@ package kr.syeyoung.dungeonsguide.launcher; +import com.mojang.authlib.exceptions.AuthenticationUnavailableException; +import com.mojang.authlib.exceptions.InvalidCredentialsException; import kr.syeyoung.dungeonsguide.launcher.exceptions.AuthServerException; import kr.syeyoung.dungeonsguide.launcher.authentication.Authenticator; import kr.syeyoung.dungeonsguide.launcher.branch.ModDownloader; @@ -54,7 +56,7 @@ public class Main { public static final String MOD_ID = "dungeons_guide_wrapper"; public static final String VERSION = "1.0"; - public static final String DOMAIN = "http://testmachine:8080/panel/api"; + public static final String DOMAIN = "http://testmachine:8080/api"; private static Main main; @@ -156,6 +158,10 @@ public class Main } else if (lastError instanceof AuthServerException) { + } else if (lastError instanceof InvalidCredentialsException) { + + } else if (lastError instanceof AuthenticationUnavailableException) { + } else if (lastError != null){ return new GuiLoadingError(lastError, () -> {lastError = null;}); } diff --git a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/authentication/Authenticator.java b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/authentication/Authenticator.java index d06e3a39..d16f70ed 100755 --- a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/authentication/Authenticator.java +++ b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/authentication/Authenticator.java @@ -46,7 +46,6 @@ import java.util.concurrent.locks.ReentrantLock; public class Authenticator { private String dgAccessToken; - private Instant validThru; @Getter private TokenStatus tokenStatus = TokenStatus.UNAUTHENTICATED; @@ -55,13 +54,13 @@ public class Authenticator { private Lock authenticationLock = new ReentrantLock(); static { - Reflection.registerFieldsToFilter(Authenticator.class, "token"); // Please do not touch this field. I know there is a way to block it completely, but I won't do it here. + Reflection.registerFieldsToFilter(Authenticator.class, "dgAccessToken"); // Please do not touch this field. I know there is a way to block it completely, but I won't do it here. } public String getRawToken() { return dgAccessToken; } - public String getUnexpiredToken() { + public String getUnexpiredToken() { // THIS METHOD MAY BLOCK. if (tokenStatus != TokenStatus.AUTHENTICATED) throw new IllegalStateException("Token is not available"); long expiry = getJwtPayload(dgAccessToken).getLong("exp"); if (System.currentTimeMillis() >= expiry-2000 || tokenStatus == TokenStatus.EXPIRED) { diff --git a/mod/build.gradle b/mod/build.gradle index bbbc033a..85b44238 100644 --- a/mod/build.gradle +++ b/mod/build.gradle @@ -72,7 +72,7 @@ tasks.withType(JavaCompile) { } tasks.withType(Jar) { - archiveBaseName = "examplemod" + archivesBaseName = "dungeonsguide" manifest { attributes["FMLCorePluginContainsFMLMod"] = "true" attributes["ForceLoadAsMod"] = "true" diff --git a/runtime/.mixin.out/audit/mixin_implementation_report.csv b/runtime/.mixin.out/audit/mixin_implementation_report.csv deleted file mode 100644 index 41cb2712..00000000 --- a/runtime/.mixin.out/audit/mixin_implementation_report.csv +++ /dev/null @@ -1 +0,0 @@ -Class,Method,Signature,Interface diff --git a/runtime/.mixin.out/audit/mixin_implementation_report.txt b/runtime/.mixin.out/audit/mixin_implementation_report.txt deleted file mode 100644 index 2501c7b4..00000000 --- a/runtime/.mixin.out/audit/mixin_implementation_report.txt +++ /dev/null @@ -1 +0,0 @@ -Mixin Implementation Report generated on 2022-05-21 23:55:14 diff --git a/settings.gradle b/settings.gradle index a3178245..137771c1 100644 --- a/settings.gradle +++ b/settings.gradle @@ -22,3 +22,4 @@ pluginManagement { include 'mod' include 'loader' +rootProject.name = "Dungeons Guide"
\ No newline at end of file |