From 8a7b2e6fe6ac4d57eec2d14516dd2acc196a1bc5 Mon Sep 17 00:00:00 2001 From: SkyWatcher_2019 Date: Fri, 26 Jan 2024 19:31:19 +0300 Subject: [PATCH] Velocity b329+ support --- HEADER.txt | 2 +- build.gradle | 10 +++++++--- gradle.properties | 6 +++--- gradle/wrapper/gradle-wrapper.properties | 2 +- .../java/net/elytrium/limboauth/LimboAuth.java | 2 +- src/main/java/net/elytrium/limboauth/Settings.java | 2 +- .../limboauth/command/ChangePasswordCommand.java | 2 +- .../limboauth/command/CommandPermissionState.java | 2 +- .../limboauth/command/DestroySessionCommand.java | 2 +- .../command/ForceChangePasswordCommand.java | 2 +- .../limboauth/command/ForceRegisterCommand.java | 2 +- .../limboauth/command/ForceUnregisterCommand.java | 2 +- .../limboauth/command/LimboAuthCommand.java | 4 ++-- .../elytrium/limboauth/command/PremiumCommand.java | 2 +- .../limboauth/command/RatelimitedCommand.java | 2 +- .../elytrium/limboauth/command/TotpCommand.java | 4 ++-- .../limboauth/command/UnregisterCommand.java | 2 +- .../limboauth/dependencies/BaseLibrary.java | 2 +- .../limboauth/dependencies/DatabaseLibrary.java | 14 ++++++++------ .../dependencies/IsolatedClassLoader.java | 2 +- .../limboauth/event/AuthPluginReloadEvent.java | 2 +- .../limboauth/event/AuthUnregisterEvent.java | 2 +- .../limboauth/event/ChangePasswordEvent.java | 2 +- .../limboauth/event/PostAuthorizationEvent.java | 2 +- .../net/elytrium/limboauth/event/PostEvent.java | 2 +- .../limboauth/event/PostRegisterEvent.java | 2 +- .../limboauth/event/PreAuthorizationEvent.java | 2 +- .../net/elytrium/limboauth/event/PreEvent.java | 2 +- .../elytrium/limboauth/event/PreRegisterEvent.java | 2 +- .../net/elytrium/limboauth/event/TaskEvent.java | 2 +- .../limboauth/floodgate/FloodgateApiHolder.java | 2 +- .../limboauth/handler/AuthSessionHandler.java | 13 +++++-------- .../elytrium/limboauth/listener/AuthListener.java | 2 +- .../limboauth/migration/MigrationHash.java | 2 +- .../limboauth/migration/MigrationHashVerifier.java | 2 +- .../elytrium/limboauth/model/RegisteredPlayer.java | 2 +- .../limboauth/model/SQLRuntimeException.java | 2 +- .../net/elytrium/limboauth/BuildConstants.java | 2 +- 38 files changed, 59 insertions(+), 56 deletions(-) diff --git a/HEADER.txt b/HEADER.txt index 1fde5b4a..d543d1ed 100644 --- a/HEADER.txt +++ b/HEADER.txt @@ -1,4 +1,4 @@ -Copyright (C) 2021 - 2023 Elytrium +Copyright (C) 2021 - 2024 Elytrium This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by diff --git a/build.gradle b/build.gradle index b78a0e52..c25a026d 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ plugins { id("java") id("checkstyle") id("maven-publish") - id("com.github.spotbugs").version("5.0.7") + id("com.github.spotbugs").version("5.0.14") id("org.cadixdev.licenser").version("0.6.1") id("com.github.johnrengelman.shadow").version("7.1.2") } @@ -13,8 +13,8 @@ setGroup("net.elytrium") setVersion("1.1.14-SNAPSHOT") java { - setSourceCompatibility(JavaVersion.VERSION_11) - setTargetCompatibility(JavaVersion.VERSION_11) + setSourceCompatibility(JavaVersion.VERSION_17) + setTargetCompatibility(JavaVersion.VERSION_17) } compileJava { @@ -36,6 +36,10 @@ repositories { setName("opencollab-snapshot") setUrl("https://repo.opencollab.dev/maven-snapshots") } + maven() { + setName("sonatype-snapshots-repo") + setUrl("https://s01.oss.sonatype.org/content/repositories/snapshots/") + } } dependencies { diff --git a/gradle.properties b/gradle.properties index 36034476..1da3d7a4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ -limboapiVersion=1.1.7 -velocityVersion=3.2.0-SNAPSHOT -nettyVersion=4.1.86.Final +limboapiVersion=1.1.18 +velocityVersion=3.3.0-SNAPSHOT +nettyVersion=4.1.105.Final floodgateVersion=2.2.0-SNAPSHOT fastutilVersion=8.5.11 bstatsVersion=3.0.1 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 070cb702..a5952066 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/java/net/elytrium/limboauth/LimboAuth.java b/src/main/java/net/elytrium/limboauth/LimboAuth.java index 1e214aa3..792bd0bc 100644 --- a/src/main/java/net/elytrium/limboauth/LimboAuth.java +++ b/src/main/java/net/elytrium/limboauth/LimboAuth.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 - 2023 Elytrium + * Copyright (C) 2021 - 2024 Elytrium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/src/main/java/net/elytrium/limboauth/Settings.java b/src/main/java/net/elytrium/limboauth/Settings.java index 8f7a6347..84c5471c 100644 --- a/src/main/java/net/elytrium/limboauth/Settings.java +++ b/src/main/java/net/elytrium/limboauth/Settings.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 - 2023 Elytrium + * Copyright (C) 2021 - 2024 Elytrium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/src/main/java/net/elytrium/limboauth/command/ChangePasswordCommand.java b/src/main/java/net/elytrium/limboauth/command/ChangePasswordCommand.java index f46db08e..28dcd8e5 100644 --- a/src/main/java/net/elytrium/limboauth/command/ChangePasswordCommand.java +++ b/src/main/java/net/elytrium/limboauth/command/ChangePasswordCommand.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 - 2023 Elytrium + * Copyright (C) 2021 - 2024 Elytrium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/src/main/java/net/elytrium/limboauth/command/CommandPermissionState.java b/src/main/java/net/elytrium/limboauth/command/CommandPermissionState.java index 47e92085..82dd8325 100644 --- a/src/main/java/net/elytrium/limboauth/command/CommandPermissionState.java +++ b/src/main/java/net/elytrium/limboauth/command/CommandPermissionState.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 - 2023 Elytrium + * Copyright (C) 2021 - 2024 Elytrium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/src/main/java/net/elytrium/limboauth/command/DestroySessionCommand.java b/src/main/java/net/elytrium/limboauth/command/DestroySessionCommand.java index 4bb23699..22396d24 100644 --- a/src/main/java/net/elytrium/limboauth/command/DestroySessionCommand.java +++ b/src/main/java/net/elytrium/limboauth/command/DestroySessionCommand.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 - 2023 Elytrium + * Copyright (C) 2021 - 2024 Elytrium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/src/main/java/net/elytrium/limboauth/command/ForceChangePasswordCommand.java b/src/main/java/net/elytrium/limboauth/command/ForceChangePasswordCommand.java index 0ae09c71..23a7d8a9 100644 --- a/src/main/java/net/elytrium/limboauth/command/ForceChangePasswordCommand.java +++ b/src/main/java/net/elytrium/limboauth/command/ForceChangePasswordCommand.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 - 2023 Elytrium + * Copyright (C) 2021 - 2024 Elytrium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/src/main/java/net/elytrium/limboauth/command/ForceRegisterCommand.java b/src/main/java/net/elytrium/limboauth/command/ForceRegisterCommand.java index ff3a9a86..ad8fa00c 100644 --- a/src/main/java/net/elytrium/limboauth/command/ForceRegisterCommand.java +++ b/src/main/java/net/elytrium/limboauth/command/ForceRegisterCommand.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 - 2023 Elytrium + * Copyright (C) 2021 - 2024 Elytrium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/src/main/java/net/elytrium/limboauth/command/ForceUnregisterCommand.java b/src/main/java/net/elytrium/limboauth/command/ForceUnregisterCommand.java index dd4ce2ef..20510b83 100644 --- a/src/main/java/net/elytrium/limboauth/command/ForceUnregisterCommand.java +++ b/src/main/java/net/elytrium/limboauth/command/ForceUnregisterCommand.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 - 2023 Elytrium + * Copyright (C) 2021 - 2024 Elytrium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/src/main/java/net/elytrium/limboauth/command/LimboAuthCommand.java b/src/main/java/net/elytrium/limboauth/command/LimboAuthCommand.java index 0b1b4fdb..0c158865 100644 --- a/src/main/java/net/elytrium/limboauth/command/LimboAuthCommand.java +++ b/src/main/java/net/elytrium/limboauth/command/LimboAuthCommand.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 - 2023 Elytrium + * Copyright (C) 2021 - 2024 Elytrium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -33,7 +33,7 @@ public class LimboAuthCommand extends RatelimitedCommand { private static final List HELP_MESSAGE = List.of( Component.text("This server is using LimboAuth and LimboAPI.", NamedTextColor.YELLOW), - Component.text("(C) 2021 - 2023 Elytrium", NamedTextColor.YELLOW), + Component.text("(C) 2021 - 2024 Elytrium", NamedTextColor.YELLOW), Component.text("https://elytrium.net/github/", NamedTextColor.GREEN), Component.empty() ); diff --git a/src/main/java/net/elytrium/limboauth/command/PremiumCommand.java b/src/main/java/net/elytrium/limboauth/command/PremiumCommand.java index 707598fc..99c5439f 100644 --- a/src/main/java/net/elytrium/limboauth/command/PremiumCommand.java +++ b/src/main/java/net/elytrium/limboauth/command/PremiumCommand.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 - 2023 Elytrium + * Copyright (C) 2021 - 2024 Elytrium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/src/main/java/net/elytrium/limboauth/command/RatelimitedCommand.java b/src/main/java/net/elytrium/limboauth/command/RatelimitedCommand.java index bf7af0f3..769ee9a9 100644 --- a/src/main/java/net/elytrium/limboauth/command/RatelimitedCommand.java +++ b/src/main/java/net/elytrium/limboauth/command/RatelimitedCommand.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 - 2023 Elytrium + * Copyright (C) 2021 - 2024 Elytrium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/src/main/java/net/elytrium/limboauth/command/TotpCommand.java b/src/main/java/net/elytrium/limboauth/command/TotpCommand.java index e444941e..447b8461 100644 --- a/src/main/java/net/elytrium/limboauth/command/TotpCommand.java +++ b/src/main/java/net/elytrium/limboauth/command/TotpCommand.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 - 2023 Elytrium + * Copyright (C) 2021 - 2024 Elytrium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -156,7 +156,7 @@ public void execute(CommandSource source, String[] args) { return; } - if (AuthSessionHandler.getTotpCodeVerifier().isValidCode(playerInfo.getTotpToken(), args[1])) { + if (AuthSessionHandler.TOTP_CODE_VERIFIER.isValidCode(playerInfo.getTotpToken(), args[1])) { try { updateBuilder = this.playerDao.updateBuilder(); updateBuilder.where().eq(RegisteredPlayer.LOWERCASE_NICKNAME_FIELD, usernameLowercase); diff --git a/src/main/java/net/elytrium/limboauth/command/UnregisterCommand.java b/src/main/java/net/elytrium/limboauth/command/UnregisterCommand.java index 37458162..73d9843f 100644 --- a/src/main/java/net/elytrium/limboauth/command/UnregisterCommand.java +++ b/src/main/java/net/elytrium/limboauth/command/UnregisterCommand.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 - 2023 Elytrium + * Copyright (C) 2021 - 2024 Elytrium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/src/main/java/net/elytrium/limboauth/dependencies/BaseLibrary.java b/src/main/java/net/elytrium/limboauth/dependencies/BaseLibrary.java index 9b795dd2..23c0aff2 100644 --- a/src/main/java/net/elytrium/limboauth/dependencies/BaseLibrary.java +++ b/src/main/java/net/elytrium/limboauth/dependencies/BaseLibrary.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 - 2023 Elytrium + * Copyright (C) 2021 - 2024 Elytrium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/src/main/java/net/elytrium/limboauth/dependencies/DatabaseLibrary.java b/src/main/java/net/elytrium/limboauth/dependencies/DatabaseLibrary.java index 82641219..9cab1768 100644 --- a/src/main/java/net/elytrium/limboauth/dependencies/DatabaseLibrary.java +++ b/src/main/java/net/elytrium/limboauth/dependencies/DatabaseLibrary.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 - 2023 Elytrium + * Copyright (C) 2021 - 2024 Elytrium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -30,8 +30,8 @@ import java.sql.Connection; import java.sql.Driver; import java.sql.DriverManager; +import java.sql.PreparedStatement; import java.sql.SQLException; -import java.sql.Statement; import java.util.Properties; public enum DatabaseLibrary { @@ -49,13 +49,15 @@ public enum DatabaseLibrary { if (Files.exists(legacyDatabase)) { Path dumpFile = dir.resolve("limboauth.dump.sql"); try (Connection legacyConnection = H2_LEGACY_V1.connect(dir, null, null, user, password)) { - try (Statement migrateStatement = legacyConnection.createStatement()) { - migrateStatement.execute("SCRIPT TO '" + dumpFile + "'"); + try (PreparedStatement migrateStatement = legacyConnection.prepareStatement("SCRIPT TO '?'")) { + migrateStatement.setString(1, dumpFile.toString()); + migrateStatement.execute(); } } - try (Statement migrateStatement = modernConnection.createStatement()) { - migrateStatement.execute("RUNSCRIPT FROM '" + dumpFile + "'"); + try (PreparedStatement migrateStatement = modernConnection.prepareStatement("RUNSCRIPT FROM '?'")) { + migrateStatement.setString(1, dumpFile.toString()); + migrateStatement.execute(); } Files.delete(dumpFile); diff --git a/src/main/java/net/elytrium/limboauth/dependencies/IsolatedClassLoader.java b/src/main/java/net/elytrium/limboauth/dependencies/IsolatedClassLoader.java index 7023d822..230d3afe 100644 --- a/src/main/java/net/elytrium/limboauth/dependencies/IsolatedClassLoader.java +++ b/src/main/java/net/elytrium/limboauth/dependencies/IsolatedClassLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 - 2023 Elytrium + * Copyright (C) 2021 - 2024 Elytrium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/src/main/java/net/elytrium/limboauth/event/AuthPluginReloadEvent.java b/src/main/java/net/elytrium/limboauth/event/AuthPluginReloadEvent.java index a1c0c58c..c2351313 100644 --- a/src/main/java/net/elytrium/limboauth/event/AuthPluginReloadEvent.java +++ b/src/main/java/net/elytrium/limboauth/event/AuthPluginReloadEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 - 2023 Elytrium + * Copyright (C) 2021 - 2024 Elytrium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/src/main/java/net/elytrium/limboauth/event/AuthUnregisterEvent.java b/src/main/java/net/elytrium/limboauth/event/AuthUnregisterEvent.java index b1c77405..4a2b46d9 100644 --- a/src/main/java/net/elytrium/limboauth/event/AuthUnregisterEvent.java +++ b/src/main/java/net/elytrium/limboauth/event/AuthUnregisterEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 - 2023 Elytrium + * Copyright (C) 2021 - 2024 Elytrium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/src/main/java/net/elytrium/limboauth/event/ChangePasswordEvent.java b/src/main/java/net/elytrium/limboauth/event/ChangePasswordEvent.java index ff1f33cc..2e88ad8c 100644 --- a/src/main/java/net/elytrium/limboauth/event/ChangePasswordEvent.java +++ b/src/main/java/net/elytrium/limboauth/event/ChangePasswordEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 - 2023 Elytrium + * Copyright (C) 2021 - 2024 Elytrium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/src/main/java/net/elytrium/limboauth/event/PostAuthorizationEvent.java b/src/main/java/net/elytrium/limboauth/event/PostAuthorizationEvent.java index 42576c35..7919d3e4 100644 --- a/src/main/java/net/elytrium/limboauth/event/PostAuthorizationEvent.java +++ b/src/main/java/net/elytrium/limboauth/event/PostAuthorizationEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 - 2023 Elytrium + * Copyright (C) 2021 - 2024 Elytrium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/src/main/java/net/elytrium/limboauth/event/PostEvent.java b/src/main/java/net/elytrium/limboauth/event/PostEvent.java index 0e879809..9d1996e3 100644 --- a/src/main/java/net/elytrium/limboauth/event/PostEvent.java +++ b/src/main/java/net/elytrium/limboauth/event/PostEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 - 2023 Elytrium + * Copyright (C) 2021 - 2024 Elytrium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/src/main/java/net/elytrium/limboauth/event/PostRegisterEvent.java b/src/main/java/net/elytrium/limboauth/event/PostRegisterEvent.java index d498b81c..f18c52ea 100644 --- a/src/main/java/net/elytrium/limboauth/event/PostRegisterEvent.java +++ b/src/main/java/net/elytrium/limboauth/event/PostRegisterEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 - 2023 Elytrium + * Copyright (C) 2021 - 2024 Elytrium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/src/main/java/net/elytrium/limboauth/event/PreAuthorizationEvent.java b/src/main/java/net/elytrium/limboauth/event/PreAuthorizationEvent.java index ecbbd80c..d04c0b93 100644 --- a/src/main/java/net/elytrium/limboauth/event/PreAuthorizationEvent.java +++ b/src/main/java/net/elytrium/limboauth/event/PreAuthorizationEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 - 2023 Elytrium + * Copyright (C) 2021 - 2024 Elytrium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/src/main/java/net/elytrium/limboauth/event/PreEvent.java b/src/main/java/net/elytrium/limboauth/event/PreEvent.java index d572a78e..e4ae65a6 100644 --- a/src/main/java/net/elytrium/limboauth/event/PreEvent.java +++ b/src/main/java/net/elytrium/limboauth/event/PreEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 - 2023 Elytrium + * Copyright (C) 2021 - 2024 Elytrium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/src/main/java/net/elytrium/limboauth/event/PreRegisterEvent.java b/src/main/java/net/elytrium/limboauth/event/PreRegisterEvent.java index 658c5127..6396d748 100644 --- a/src/main/java/net/elytrium/limboauth/event/PreRegisterEvent.java +++ b/src/main/java/net/elytrium/limboauth/event/PreRegisterEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 - 2023 Elytrium + * Copyright (C) 2021 - 2024 Elytrium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/src/main/java/net/elytrium/limboauth/event/TaskEvent.java b/src/main/java/net/elytrium/limboauth/event/TaskEvent.java index 435e3f2c..575e23ac 100644 --- a/src/main/java/net/elytrium/limboauth/event/TaskEvent.java +++ b/src/main/java/net/elytrium/limboauth/event/TaskEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 - 2023 Elytrium + * Copyright (C) 2021 - 2024 Elytrium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/src/main/java/net/elytrium/limboauth/floodgate/FloodgateApiHolder.java b/src/main/java/net/elytrium/limboauth/floodgate/FloodgateApiHolder.java index cc03e353..6cc1910b 100644 --- a/src/main/java/net/elytrium/limboauth/floodgate/FloodgateApiHolder.java +++ b/src/main/java/net/elytrium/limboauth/floodgate/FloodgateApiHolder.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 - 2023 Elytrium + * Copyright (C) 2021 - 2024 Elytrium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java b/src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java index e4ad322d..a8a5f608 100644 --- a/src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java +++ b/src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 - 2023 Elytrium + * Copyright (C) 2021 - 2024 Elytrium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -21,7 +21,7 @@ import com.google.common.primitives.Longs; import com.j256.ormlite.dao.Dao; import com.velocitypowered.api.proxy.Player; -import com.velocitypowered.proxy.protocol.packet.PluginMessage; +import com.velocitypowered.proxy.protocol.packet.PluginMessagePacket; import dev.samstevens.totp.code.CodeVerifier; import dev.samstevens.totp.code.DefaultCodeGenerator; import dev.samstevens.totp.code.DefaultCodeVerifier; @@ -56,7 +56,7 @@ public class AuthSessionHandler implements LimboSessionHandler { - private static final CodeVerifier TOTP_CODE_VERIFIER = new DefaultCodeVerifier(new DefaultCodeGenerator(), new SystemTimeProvider()); + public static final CodeVerifier TOTP_CODE_VERIFIER = new DefaultCodeVerifier(new DefaultCodeGenerator(), new SystemTimeProvider()); private static final BCrypt.Verifyer HASH_VERIFIER = BCrypt.verifyer(); private static final BCrypt.Hasher HASHER = BCrypt.withDefaults(); @@ -271,8 +271,8 @@ public void onChat(String message) { @Override public void onGeneric(Object packet) { - if (Settings.IMP.MAIN.MOD.ENABLED && packet instanceof PluginMessage) { - PluginMessage pluginMessage = (PluginMessage) packet; + if (Settings.IMP.MAIN.MOD.ENABLED && packet instanceof PluginMessagePacket) { + PluginMessagePacket pluginMessage = (PluginMessagePacket) packet; String channel = pluginMessage.getChannel(); if (channel.equals("MC|Brand") || channel.equals("minecraft:brand")) { @@ -575,9 +575,6 @@ public static String genHash(String password) { return HASHER.hashToString(Settings.IMP.MAIN.BCRYPT_COST, password.toCharArray()); } - public static CodeVerifier getTotpCodeVerifier() { - return TOTP_CODE_VERIFIER; - } private enum Command { diff --git a/src/main/java/net/elytrium/limboauth/listener/AuthListener.java b/src/main/java/net/elytrium/limboauth/listener/AuthListener.java index 368dab6f..2a445e36 100644 --- a/src/main/java/net/elytrium/limboauth/listener/AuthListener.java +++ b/src/main/java/net/elytrium/limboauth/listener/AuthListener.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 - 2023 Elytrium + * Copyright (C) 2021 - 2024 Elytrium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/src/main/java/net/elytrium/limboauth/migration/MigrationHash.java b/src/main/java/net/elytrium/limboauth/migration/MigrationHash.java index ab35e176..38c9ee21 100644 --- a/src/main/java/net/elytrium/limboauth/migration/MigrationHash.java +++ b/src/main/java/net/elytrium/limboauth/migration/MigrationHash.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 - 2023 Elytrium + * Copyright (C) 2021 - 2024 Elytrium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/src/main/java/net/elytrium/limboauth/migration/MigrationHashVerifier.java b/src/main/java/net/elytrium/limboauth/migration/MigrationHashVerifier.java index fa39f785..0b044de2 100644 --- a/src/main/java/net/elytrium/limboauth/migration/MigrationHashVerifier.java +++ b/src/main/java/net/elytrium/limboauth/migration/MigrationHashVerifier.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 - 2023 Elytrium + * Copyright (C) 2021 - 2024 Elytrium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/src/main/java/net/elytrium/limboauth/model/RegisteredPlayer.java b/src/main/java/net/elytrium/limboauth/model/RegisteredPlayer.java index a752e07c..7bfea59e 100644 --- a/src/main/java/net/elytrium/limboauth/model/RegisteredPlayer.java +++ b/src/main/java/net/elytrium/limboauth/model/RegisteredPlayer.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 - 2023 Elytrium + * Copyright (C) 2021 - 2024 Elytrium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/src/main/java/net/elytrium/limboauth/model/SQLRuntimeException.java b/src/main/java/net/elytrium/limboauth/model/SQLRuntimeException.java index 19aa10df..5f2b4f6a 100644 --- a/src/main/java/net/elytrium/limboauth/model/SQLRuntimeException.java +++ b/src/main/java/net/elytrium/limboauth/model/SQLRuntimeException.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 - 2023 Elytrium + * Copyright (C) 2021 - 2024 Elytrium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/src/main/templates/net/elytrium/limboauth/BuildConstants.java b/src/main/templates/net/elytrium/limboauth/BuildConstants.java index fdedbe50..df41fc38 100644 --- a/src/main/templates/net/elytrium/limboauth/BuildConstants.java +++ b/src/main/templates/net/elytrium/limboauth/BuildConstants.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 - 2023 Elytrium + * Copyright (C) 2021 - 2024 Elytrium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by