From 58dfc472ac3f802bfb8dbcbc9bcc0403c214abad Mon Sep 17 00:00:00 2001 From: Gravita Date: Tue, 12 Oct 2021 17:09:19 +0700 Subject: [PATCH] [FIX] ServerWrapper connect to ServerProfile --- .../gravit/launchserver/auth/protect/StdProtectHandler.java | 4 ++-- .../java/pro/gravit/launchserver/manangers/AuthManager.java | 3 ++- .../pro/gravit/launcher/profiles/optional/OptionalFile.java | 2 ++ build.gradle | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/StdProtectHandler.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/StdProtectHandler.java index d2bf0799..0815c230 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/StdProtectHandler.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/StdProtectHandler.java @@ -34,12 +34,12 @@ public void init(LaunchServer server) { @Override public boolean canGetProfile(ClientProfile profile, Client client) { - return client.isAuth && client.username != null && (!profile.isLimited() || isWhitelisted("launchserver.profile.%s.show", profile, client) ); + return !profile.isLimited() || isWhitelisted("launchserver.profile.%s.show", profile, client); } @Override public boolean canChangeProfile(ClientProfile profile, Client client) { - return client.isAuth && client.username != null && (!profile.isLimited() || isWhitelisted("launchserver.profile.%s.enter", profile, client) ); + return !profile.isLimited() || isWhitelisted("launchserver.profile.%s.enter", profile, client); } @Override diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/AuthManager.java b/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/AuthManager.java index e3a7e6ed..042ad606 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/AuthManager.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/AuthManager.java @@ -85,7 +85,8 @@ public boolean accept(Client client, AuthProviderPair pair, String extendedToken client.auth_id = info.authId; client.auth = server.config.getAuthProviderPair(info.authId); if(client.permissions == null) client.permissions = new ClientPermissions(); - client.permissions.addAction("launchserver\\.checkserver"); + client.permissions.addAction("launchserver.checkserver"); + client.permissions.addAction(String.format("launchserver.profiles.%s.show", info.serverName)); return true; } } diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/OptionalFile.java b/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/OptionalFile.java index d708a15e..a5ad4f25 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/OptionalFile.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/OptionalFile.java @@ -31,6 +31,8 @@ public class OptionalFile { public int subTreeLevel = 1; @LauncherNetworkAPI public boolean isPreset; + @LauncherNetworkAPI + public boolean limited; @Override public boolean equals(Object o) { diff --git a/build.gradle b/build.gradle index 684a1233..65dbd9c9 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ id 'org.openjfx.javafxplugin' version '0.0.10' apply false } group = 'pro.gravit.launcher' -version = '5.2.2' +version = '5.2.3-SNAPSHOT' apply from: 'props.gradle'