aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/net/elytrium/limboauth/handler
diff options
context:
space:
mode:
authorPetr Ilin <hevav@hevav.dev>2023-01-16 12:57:25 +0300
committerPetr Ilin <hevav@hevav.dev>2023-01-16 12:58:14 +0300
commit51e8126e9df3e61f7bc65279b324a83922823099 (patch)
treed15557a1af737587d6d2e2b0f8b15102eb03b6c6 /src/main/java/net/elytrium/limboauth/handler
parent176bd85c992b8992c57853915b1b6c2068e7e345 (diff)
downloadLimboAuth-51e8126e9df3e61f7bc65279b324a83922823099.tar.gz
LimboAuth-51e8126e9df3e61f7bc65279b324a83922823099.tar.bz2
LimboAuth-51e8126e9df3e61f7bc65279b324a83922823099.zip
Hotfix: Legacy PluginMessages tag on legacy versions
Diffstat (limited to 'src/main/java/net/elytrium/limboauth/handler')
-rw-r--r--src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java b/src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java
index e9de364..941ba1b 100644
--- a/src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java
+++ b/src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java
@@ -21,8 +21,6 @@ import at.favre.lib.crypto.bcrypt.BCrypt;
import com.google.common.primitives.Longs;
import com.j256.ormlite.dao.Dao;
import com.velocitypowered.api.proxy.Player;
-import com.velocitypowered.api.proxy.messages.ChannelIdentifier;
-import com.velocitypowered.api.proxy.messages.MinecraftChannelIdentifier;
import com.velocitypowered.proxy.protocol.packet.PluginMessage;
import dev.samstevens.totp.code.CodeVerifier;
import dev.samstevens.totp.code.DefaultCodeGenerator;
@@ -61,9 +59,6 @@ public class AuthSessionHandler implements LimboSessionHandler {
private 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();
- // Architectury API appends /541f59e4256a337ea252bc482a009d46 to the channel name, that is a UUID.nameUUIDFromBytes from the TokenMessage class name
- public static final ChannelIdentifier MOD_CHANNEL = MinecraftChannelIdentifier.create("limboauth", "mod/541f59e4256a337ea252bc482a009d46");
- public static final String MOD_CHANNEL_STRING = MOD_CHANNEL.getId();
private static BossBar.Color bossbarColor;
private static BossBar.Overlay bossbarOverlay;
@@ -278,9 +273,9 @@ public class AuthSessionHandler implements LimboSessionHandler {
// Minecraft can't handle the plugin message immediately after going to the PLAY
// state, so we have to postpone sending it
if (Settings.IMP.MAIN.MOD.ENABLED) {
- this.proxyPlayer.sendPluginMessage(MOD_CHANNEL, new byte[0]);
+ this.proxyPlayer.sendPluginMessage(this.plugin.getChannelIdentifier(this.proxyPlayer), new byte[0]);
}
- } else if (channel.equals(MOD_CHANNEL_STRING)) {
+ } else if (channel.equals(this.plugin.getChannelIdentifier(this.proxyPlayer).getId())) {
if (this.tokenReceived) {
this.checkBruteforceAttempts();
this.proxyPlayer.disconnect(Component.empty());