From abe904d73c6eb8dc740f1f115f2828cb8b0ce3c6 Mon Sep 17 00:00:00 2001 From: Gravita <12893402+gravit0@users.noreply.github.com> Date: Wed, 2 Oct 2024 20:50:36 +0700 Subject: [PATCH 1/3] [FEATURE] ExtendedCheckServer support in SQLAuthCoreProvider --- .../launchserver/auth/core/SQLCoreProvider.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/SQLCoreProvider.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/SQLCoreProvider.java index 34d131e3..990840a0 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/SQLCoreProvider.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/SQLCoreProvider.java @@ -7,8 +7,10 @@ import pro.gravit.launchserver.auth.MySQLSourceConfig; import pro.gravit.launchserver.auth.SQLSourceConfig; import pro.gravit.launchserver.auth.core.interfaces.UserHardware; +import pro.gravit.launchserver.auth.core.interfaces.provider.AuthSupportExtendedCheckServer; import pro.gravit.launchserver.auth.core.interfaces.provider.AuthSupportHardware; import pro.gravit.launchserver.auth.core.interfaces.session.UserSessionSupportHardware; +import pro.gravit.launchserver.socket.Client; import pro.gravit.utils.helper.IOHelper; import java.io.ByteArrayInputStream; @@ -19,7 +21,7 @@ import java.util.List; import java.util.UUID; -public class SQLCoreProvider extends AbstractSQLCoreProvider implements AuthSupportHardware { +public class SQLCoreProvider extends AbstractSQLCoreProvider implements AuthSupportHardware, AuthSupportExtendedCheckServer { public HikariSQLSourceConfig holder; @Override @@ -291,6 +293,18 @@ protected AbstractSQLCoreProvider.SQLUserSession createSession(AbstractSQLCorePr return new SQLUserSession(user); } + @Override + public UserSession extendedCheckServer(Client client, String username, String serverID) throws IOException { + AbstractSQLCoreProvider.SQLUser user = (AbstractSQLCoreProvider.SQLUser) getUserByUsername(username); + if (user == null) { + return null; + } + if (user.getUsername().equals(username) && user.getServerId().equals(serverID)) { + return createSession(user); + } + return null; + } + public class SQLUserSession extends AbstractSQLCoreProvider.SQLUserSession implements UserSessionSupportHardware { private transient SQLUser SQLUser; protected transient SQLUserHardware hardware; From f16f5fbc6d21304cdc7d654e1997a2b4b52920bb Mon Sep 17 00:00:00 2001 From: Gravita <12893402+gravit0@users.noreply.github.com> Date: Sun, 6 Oct 2024 22:59:49 +0700 Subject: [PATCH 2/3] [FIX] NPE: User not found and permissions enabled --- .../launchserver/auth/core/AbstractSQLCoreProvider.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/AbstractSQLCoreProvider.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/AbstractSQLCoreProvider.java index 4e732542..bdb4a4c5 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/AbstractSQLCoreProvider.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/AbstractSQLCoreProvider.java @@ -295,7 +295,9 @@ private SQLUser queryUser(String sql, String value) throws SQLException { user = constructUser(set); } } - user.permissions = requestPermissions(user.uuid.toString()); + if(user != null) { + user.permissions = requestPermissions(user.uuid.toString()); + } return user; } From c4d1251429bb44aab2975a03e9fe23bd71e1190e Mon Sep 17 00:00:00 2001 From: Gravita <12893402+gravit0@users.noreply.github.com> Date: Sun, 13 Oct 2024 19:05:35 +0700 Subject: [PATCH 3/3] [ANY] 5.6.8 stable --- LauncherCore/src/main/java/pro/gravit/utils/Version.java | 2 +- build.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/LauncherCore/src/main/java/pro/gravit/utils/Version.java b/LauncherCore/src/main/java/pro/gravit/utils/Version.java index fbbeee4c..65e30118 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/Version.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/Version.java @@ -6,7 +6,7 @@ public final class Version implements Comparable { public static final int MAJOR = 5; public static final int MINOR = 6; - public static final int PATCH = 7; + public static final int PATCH = 8; public static final int BUILD = 1; public static final Version.Type RELEASE = Type.STABLE; public final int major; diff --git a/build.gradle b/build.gradle index 0d8b8a34..1a1f5a77 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ id 'org.openjfx.javafxplugin' version '0.1.0' apply false } group = 'pro.gravit.launcher' -version = '5.6.7' +version = '5.6.8' apply from: 'props.gradle'