aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-09-12 17:19:56 +0200
committernea <nea@nea.moe>2023-09-12 17:19:56 +0200
commit6129b723a23f18715b3196beea75396e027648f4 (patch)
tree35d6c79b7a1069e1f7e8e7d3b1c9adbc6f2df782
parente58907019e2eea057586841d625fe018ce42cd02 (diff)
downloadSkyblock-Dungeons-Guide-6129b723a23f18715b3196beea75396e027648f4.tar.gz
Skyblock-Dungeons-Guide-6129b723a23f18715b3196beea75396e027648f4.tar.bz2
Skyblock-Dungeons-Guide-6129b723a23f18715b3196beea75396e027648f4.zip
No Authnoauth
-rw-r--r--loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/auth/AuthManager.java52
-rw-r--r--mod/src/main/resources/assets/dungeonsguide/gui/config/normalconfig.gui4
2 files changed, 3 insertions, 53 deletions
diff --git a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/auth/AuthManager.java b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/auth/AuthManager.java
index 30152423..a5e8ae00 100644
--- a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/auth/AuthManager.java
+++ b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/auth/AuthManager.java
@@ -32,6 +32,7 @@ import kr.syeyoung.dungeonsguide.launcher.gui.screen.WidgetPrivacyPolicy;
import kr.syeyoung.dungeonsguide.launcher.gui.tooltip.Notification;
import kr.syeyoung.dungeonsguide.launcher.gui.tooltip.NotificationManager;
import kr.syeyoung.dungeonsguide.launcher.gui.tooltip.WidgetNotification;
+import kr.syeyoung.dungeonsguide.launcher.gui.tooltip.WidgetNotificationAutoClose;
import kr.syeyoung.dungeonsguide.launcher.guiv2.GuiScreenAdapter;
import kr.syeyoung.dungeonsguide.launcher.guiv2.elements.GlobalHUDScale;
import net.minecraft.client.Minecraft;
@@ -116,57 +117,6 @@ public class AuthManager {
private static final UUID privacyPolicyRequired = UUID.randomUUID();
AuthToken reAuth() {
- if (reauthLock) {
- while (reauthLock) ;
- return currentToken;
- }
-
- reauthLock = true;
-
- try {
- String token = DgAuthUtil.requestAuth();
- byte[] encSecret = DgAuthUtil.checkSessionAuthenticityAndReturnEncryptedSecret(token);
- currentToken = DgAuthUtil.verifyAuth(token, encSecret);
- Minecraft.getMinecraft().addScheduledTask(() -> {
- MinecraftForge.EVENT_BUS.post(new AuthChangedEvent(currentToken));
- });
-
-
- if (currentToken instanceof PrivacyPolicyRequiredToken) {
- GuiDisplayer.INSTANCE.displayGui(new GuiScreenAdapter(new GlobalHUDScale(new WidgetPrivacyPolicy())));
- throw new PrivacyPolicyRequiredException();
- }
-
-
- NotificationManager.getInstance().removeNotification(authenticationFailure);
- NotificationManager.getInstance().removeNotification(privacyPolicyRequired);
- } catch (Exception e) {
- if (e instanceof PrivacyPolicyRequiredException) {
- NotificationManager.getInstance().removeNotification(authenticationFailure);
- NotificationManager.getInstance().updateNotification(privacyPolicyRequired, new WidgetNotification(privacyPolicyRequired, Notification.builder()
- .title("Privacy Policy")
- .description("Please accept Dungeons Guide\nPrivacy Policy to enjoy server based\nfeatures of Dungeons Guide\n\n(Including Auto-Update/Remote-Jar)")
- .titleColor(0xFFFF0000)
- .onClick(() -> {
- GuiDisplayer.INSTANCE.displayGui(new GuiScreenAdapter(new GlobalHUDScale(new WidgetPrivacyPolicy())));
- })
- .build()));
- } else {
- currentToken = new FailedAuthToken(e);
- NotificationManager.getInstance().updateNotification(authenticationFailure, new WidgetNotification(authenticationFailure, Notification.builder()
- .title("Auth Error")
- .description("Authentication Error Occurred\n"+e.getMessage())
- .titleColor(0xFFFF0000)
- .onClick(() -> {
- GuiDisplayer.INSTANCE.displayGui(new GuiScreenAdapter(new GlobalHUDScale(new WidgetError(e))));
- })
- .build()));
- }
- logger.error("Re-auth failed with message {}, trying again in a 2 seconds", String.valueOf(Throwables.getRootCause(e)));
- throw new AuthFailedException(e);
- } finally {
- reauthLock = false;
- }
return currentToken;
}
diff --git a/mod/src/main/resources/assets/dungeonsguide/gui/config/normalconfig.gui b/mod/src/main/resources/assets/dungeonsguide/gui/config/normalconfig.gui
index 3acb0660..448ad41a 100644
--- a/mod/src/main/resources/assets/dungeonsguide/gui/config/normalconfig.gui
+++ b/mod/src/main/resources/assets/dungeonsguide/gui/config/normalconfig.gui
@@ -44,7 +44,7 @@
</aspectRatio>
<padding left="5" top="5" bottom="5" right="5">
<row>
- <Text text="Dungeons Guide v" color="0xFFFFFFFF"/>
+ <Text text="Dungeons Guide (without auth) v" color="0xFFFFFFFF"/>
<Text bind:text="version" color="#FFFFFFFF"/>
<Text text=" By syeyoung" color="#FFFFFFFF"/>
</row>
@@ -97,4 +97,4 @@
</bgcolor>
</ConstrainedBox>
</align>
-</PopupManager> \ No newline at end of file
+</PopupManager>