From 7f4fe566de59db7fb14de337b81a7620d1677857 Mon Sep 17 00:00:00 2001 From: Gravita Date: Fri, 9 Dec 2022 20:19:22 +0700 Subject: [PATCH] [FIX] ClassCastException --- .../gravit/launchserver/auth/core/AbstractSQLCoreProvider.java | 2 +- .../pro/gravit/launchserver/auth/core/MySQLCoreProvider.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) 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 66b5f4b4..914b67e0 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 @@ -238,7 +238,7 @@ public void close() throws IOException { getSQLConfig().close(); } - private SQLUser constructUser(ResultSet set) throws SQLException { + protected SQLUser constructUser(ResultSet set) throws SQLException { return set.next() ? new SQLUser(UUID.fromString(set.getString(uuidColumn)), set.getString(usernameColumn), set.getString(accessTokenColumn), set.getString(serverIDColumn), set.getString(passwordColumn), requestPermissions(set.getString(uuidColumn))) : null; } diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/MySQLCoreProvider.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/MySQLCoreProvider.java index 427efcbb..dc9c6467 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/MySQLCoreProvider.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/MySQLCoreProvider.java @@ -63,7 +63,8 @@ public void init(LaunchServer server) { sqlUpdateUsers = String.format("UPDATE %s SET `%s` = ? WHERE `%s` = ?", table, hardwareIdColumn, uuidColumn); } - private MySQLUser constructUser(ResultSet set) throws SQLException { + @Override + protected MySQLUser constructUser(ResultSet set) throws SQLException { return set.next() ? new MySQLUser(UUID.fromString(set.getString(uuidColumn)), set.getString(usernameColumn), set.getString(accessTokenColumn), set.getString(serverIDColumn), set.getString(passwordColumn), requestPermissions(set.getString(uuidColumn)), set.getLong(hardwareIdColumn)) : null; }