Compare commits
No commits in common. "9ae4ee76cfca574f20866519f02b7876c970be18" and "ccd2903de8f069c3a8e16d92c291364c983b78f9" have entirely different histories.
9ae4ee76cf
...
ccd2903de8
4
.github/workflows/gradle.yml
vendored
4
.github/workflows/gradle.yml
vendored
@ -10,10 +10,10 @@ jobs:
|
|||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up JDK 16
|
- name: Set up JDK 17
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
java-version: 16
|
java-version: 17
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
cache: 'gradle'
|
cache: 'gradle'
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ This plugin adds the support for [Velocity](https://velocitypowered.com/) to [Au
|
|||||||
## Requirements
|
## Requirements
|
||||||
- Paper or Folia 1.20+
|
- Paper or Folia 1.20+
|
||||||
- Velocity 3.3.0+
|
- Velocity 3.3.0+
|
||||||
- Java 16+
|
- Java 17+
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
- Prevent your players from executing commands or typing in the chat before they are logged in
|
- Prevent your players from executing commands or typing in the chat before they are logged in
|
||||||
|
@ -5,7 +5,6 @@ plugins {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly(libs.paper)
|
compileOnly(libs.paper)
|
||||||
compileOnly(libs.annotations)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
|
@ -37,7 +37,7 @@ public final class LoginByProxyEvent extends PlayerEvent {
|
|||||||
* @param who the player to be logged in
|
* @param who the player to be logged in
|
||||||
*/
|
*/
|
||||||
public LoginByProxyEvent(@NotNull Player who) {
|
public LoginByProxyEvent(@NotNull Player who) {
|
||||||
super(who);
|
super(who, !Bukkit.isPrimaryThread());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -37,7 +37,7 @@ public final class PreSendLoginEvent extends PlayerEvent implements Cancellable
|
|||||||
* @param player the player to be sent
|
* @param player the player to be sent
|
||||||
*/
|
*/
|
||||||
public PreSendLoginEvent(@NotNull Player player) {
|
public PreSendLoginEvent(@NotNull Player player) {
|
||||||
super(player);
|
super(player, !Bukkit.isPrimaryThread());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -50,11 +50,6 @@ public final class PreSendLoginEvent extends PlayerEvent implements Cancellable
|
|||||||
this.isCancelled = cancelled;
|
this.isCancelled = cancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean callEvent() {
|
|
||||||
Bukkit.getPluginManager().callEvent(this);
|
|
||||||
return !isCancelled();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @NotNull HandlerList getHandlers() {
|
public @NotNull HandlerList getHandlers() {
|
||||||
return HANDLERS;
|
return HANDLERS;
|
||||||
|
@ -14,6 +14,6 @@ repositories {
|
|||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
jvmToolchain {
|
jvmToolchain {
|
||||||
languageVersion.set(JavaLanguageVersion.of(16))
|
languageVersion.set(JavaLanguageVersion.of(17))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,10 +3,10 @@ allprojects {
|
|||||||
|
|
||||||
tasks.withType<JavaCompile> {
|
tasks.withType<JavaCompile> {
|
||||||
options.encoding = Charsets.UTF_8.name()
|
options.encoding = Charsets.UTF_8.name()
|
||||||
options.release.set(16)
|
options.release.set(17)
|
||||||
}
|
}
|
||||||
|
|
||||||
configure<JavaPluginExtension> {
|
configure<JavaPluginExtension> {
|
||||||
toolchain.languageVersion.set(JavaLanguageVersion.of(16))
|
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ dependencies {
|
|||||||
compileOnly(libs.libby.core)
|
compileOnly(libs.libby.core)
|
||||||
|
|
||||||
testImplementation(libs.configurate.hocon)
|
testImplementation(libs.configurate.hocon)
|
||||||
testImplementation(platform("org.junit:junit-bom:5.11.0"))
|
testImplementation(platform("org.junit:junit-bom:5.10.3"))
|
||||||
testImplementation("org.junit.jupiter:junit-jupiter")
|
testImplementation("org.junit.jupiter:junit-jupiter")
|
||||||
testImplementation(libs.assertj)
|
testImplementation(libs.assertj)
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
group = io.github.4drian3d
|
group = io.github.4drian3d
|
||||||
version = 4.1.2
|
version = 4.1.1
|
||||||
description = AuthMeReloaded Support for Velocity
|
description = AuthMeReloaded Support for Velocity
|
||||||
url = https://modrinth.com/plugin/authmevelocity
|
url = https://modrinth.com/plugin/authmevelocity
|
||||||
id = authmevelocity
|
id = authmevelocity
|
||||||
|
@ -2,24 +2,23 @@ metadata.format.version = "1.1"
|
|||||||
|
|
||||||
[versions]
|
[versions]
|
||||||
|
|
||||||
velocity = "3.1.0"
|
velocity = "3.3.0-SNAPSHOT"
|
||||||
spigot = "1.16.5-R0.1-SNAPSHOT"
|
paper = "1.20.4-R0.1-SNAPSHOT"
|
||||||
miniplaceholders = "2.0.0"
|
miniplaceholders = "2.2.3"
|
||||||
fastlogin = "1.12-SNAPSHOT"
|
fastlogin = "1.12-SNAPSHOT"
|
||||||
authme = "5.6.0"
|
authme = "5.6.0"
|
||||||
libby = "1.3.1"
|
libby = "1.3.1"
|
||||||
pluginyml = "0.6.0"
|
pluginyml = "0.6.0"
|
||||||
bstats = "3.0.3"
|
bstats = "3.0.2"
|
||||||
shadow = "8.1.1"
|
shadow = "8.1.1"
|
||||||
configurate = "4.1.2"
|
configurate = "4.1.2"
|
||||||
adventure = "4.11.0"
|
adventure = "4.17.0"
|
||||||
blossom = "2.1.0"
|
blossom = "2.1.0"
|
||||||
geantyref = "1.3.13"
|
geantyref = "1.3.13"
|
||||||
indra = "3.1.3"
|
indra = "3.1.3"
|
||||||
runtask = "2.3.1"
|
runtask = "2.3.0"
|
||||||
vpacketevents = "1.0.1"
|
vpacketevents = "1.1.0"
|
||||||
luckperms = "5.4"
|
luckperms = "5.4"
|
||||||
annotations = "26.0.1"
|
|
||||||
|
|
||||||
# Test versions
|
# Test versions
|
||||||
assertj = "3.26.3"
|
assertj = "3.26.3"
|
||||||
@ -27,18 +26,19 @@ assertj = "3.26.3"
|
|||||||
[libraries]
|
[libraries]
|
||||||
|
|
||||||
adventure = { group = "net.kyori", name = "adventure-api", version.ref = "adventure" }
|
adventure = { group = "net.kyori", name = "adventure-api", version.ref = "adventure" }
|
||||||
minimessage = { group = "net.kyori", name = "adventure-text-minimessage", version.ref = "adventure" }
|
|
||||||
logger-slf4j = { group = "net.kyori", name = "adventure-text-logger-slf4j", version.ref = "adventure" }
|
|
||||||
|
|
||||||
paper = { group = "org.spigotmc", name = "spigot-api", version.ref = "spigot" }
|
paper = { group = "io.papermc.paper", name = "paper-api", version.ref = "paper" }
|
||||||
velocity-api = { group = "com.velocitypowered", name = "velocity-api", version.ref = "velocity" }
|
velocity-api = { group = "com.velocitypowered", name = "velocity-api", version.ref = "velocity" }
|
||||||
|
velocity-proxy = { group = "com.velocitypowered", name = "velocity-proxy", version.ref = "velocity" }
|
||||||
authme = { module = "fr.xephi:authme", version.ref = "authme" }
|
authme = { module = "fr.xephi:authme", version.ref = "authme" }
|
||||||
|
|
||||||
libby-core = { group = "net.byteflux", name = "libby-core", version.ref = "libby" }
|
libby-core = { group = "net.byteflux", name = "libby-core", version.ref = "libby" }
|
||||||
libby-bukkit = { group = "net.byteflux", name = "libby-bukkit", version.ref = "libby" }
|
libby-bukkit = { group = "net.byteflux", name = "libby-bukkit", version.ref = "libby" }
|
||||||
|
libby-paper = { group = "net.byteflux", name = "libby-paper", version.ref = "libby" }
|
||||||
libby-velocity = { group = "net.byteflux", name = "libby-velocity", version.ref = "libby" }
|
libby-velocity = { group = "net.byteflux", name = "libby-velocity", version.ref = "libby" }
|
||||||
|
|
||||||
miniplaceholders = { group = "io.github.miniplaceholders", name = "miniplaceholders-api", version.ref = "miniplaceholders" }
|
miniplaceholders = { group = "io.github.miniplaceholders", name = "miniplaceholders-api", version.ref = "miniplaceholders" }
|
||||||
|
vpacketevents = { group = "io.github.4drian3d", name = "vpacketevents-api", version.ref = "vpacketevents" }
|
||||||
luckperms = { module = "net.luckperms:api", version.ref = "luckperms" }
|
luckperms = { module = "net.luckperms:api", version.ref = "luckperms" }
|
||||||
|
|
||||||
fastlogin-velocity = { group = "com.github.games647", name = "fastlogin.velocity", version.ref = "fastlogin" }
|
fastlogin-velocity = { group = "com.github.games647", name = "fastlogin.velocity", version.ref = "fastlogin" }
|
||||||
@ -52,8 +52,6 @@ plugin-shadow = { group = "com.github.johnrengelman", name = "shadow", version.r
|
|||||||
|
|
||||||
assertj = { module = "org.assertj:assertj-core", version.ref = "assertj" }
|
assertj = { module = "org.assertj:assertj-core", version.ref = "assertj" }
|
||||||
|
|
||||||
annotations = { group = "org.jetbrains", name = "annotations", version.ref = "annotations" }
|
|
||||||
|
|
||||||
[plugins]
|
[plugins]
|
||||||
|
|
||||||
pluginyml-bukkit = { id = "net.minecrell.plugin-yml.bukkit", version.ref = "pluginyml" }
|
pluginyml-bukkit = { id = "net.minecrell.plugin-yml.bukkit", version.ref = "pluginyml" }
|
||||||
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
@ -12,11 +12,8 @@ dependencies {
|
|||||||
|
|
||||||
implementation(projects.authmevelocityCommon)
|
implementation(projects.authmevelocityCommon)
|
||||||
implementation(projects.authmevelocityApiPaper)
|
implementation(projects.authmevelocityApiPaper)
|
||||||
implementation(libs.minimessage)
|
|
||||||
implementation(libs.logger.slf4j)
|
|
||||||
implementation(libs.adventure)
|
|
||||||
|
|
||||||
implementation(libs.libby.bukkit)
|
implementation(libs.libby.paper)
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
@ -32,10 +29,10 @@ tasks {
|
|||||||
dependsOn(shadowJar)
|
dependsOn(shadowJar)
|
||||||
}
|
}
|
||||||
runServer {
|
runServer {
|
||||||
minecraftVersion("1.16.5")
|
minecraftVersion("1.20.4")
|
||||||
}
|
}
|
||||||
processResources {
|
processResources {
|
||||||
filesMatching("plugin.yml") {
|
filesMatching("paper-plugin.yml") {
|
||||||
expand("version" to project.version)
|
expand("version" to project.version)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ final class AuthMePlaceholders {
|
|||||||
|
|
||||||
static Expansion getExpansion() {
|
static Expansion getExpansion() {
|
||||||
return Expansion.builder("authme")
|
return Expansion.builder("authme")
|
||||||
.filter((s) -> s instanceof Player)
|
.filter(Player.class)
|
||||||
.audiencePlaceholder("is_logged", (aud, queue, ctx) ->
|
.audiencePlaceholder("is_logged", (aud, queue, ctx) ->
|
||||||
Tag.selfClosingInserting(AuthMeApi.getInstance().isAuthenticated((Player)aud)
|
Tag.selfClosingInserting(AuthMeApi.getInstance().isAuthenticated((Player)aud)
|
||||||
? TRUE_COMPONENT
|
? TRUE_COMPONENT
|
||||||
|
@ -17,9 +17,21 @@
|
|||||||
|
|
||||||
package io.github._4drian3d.authmevelocity.paper;
|
package io.github._4drian3d.authmevelocity.paper;
|
||||||
|
|
||||||
|
import io.papermc.paper.plugin.bootstrap.BootstrapContext;
|
||||||
|
import io.papermc.paper.plugin.bootstrap.PluginBootstrap;
|
||||||
|
import io.papermc.paper.plugin.bootstrap.PluginProviderContext;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
@SuppressWarnings("all")
|
@SuppressWarnings("all")
|
||||||
public class AuthMeVelocityBootstrap extends JavaPlugin {
|
public class AuthMeVelocityBootstrap implements PluginBootstrap {
|
||||||
|
@Override
|
||||||
|
public void bootstrap(@NotNull BootstrapContext context) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public @NotNull JavaPlugin createPlugin(@NotNull PluginProviderContext context) {
|
||||||
|
return new AuthMeVelocityPlugin(context.getDataDirectory());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -19,29 +19,21 @@ package io.github._4drian3d.authmevelocity.paper;
|
|||||||
|
|
||||||
import com.google.common.io.ByteArrayDataOutput;
|
import com.google.common.io.ByteArrayDataOutput;
|
||||||
import com.google.common.io.ByteStreams;
|
import com.google.common.io.ByteStreams;
|
||||||
import com.google.common.reflect.ClassPath;
|
|
||||||
import io.github._4drian3d.authmevelocity.common.LibsManager;
|
import io.github._4drian3d.authmevelocity.common.LibsManager;
|
||||||
import io.github._4drian3d.authmevelocity.common.MessageType;
|
import io.github._4drian3d.authmevelocity.common.MessageType;
|
||||||
import io.github._4drian3d.authmevelocity.common.configuration.ConfigurationContainer;
|
import io.github._4drian3d.authmevelocity.common.configuration.ConfigurationContainer;
|
||||||
import io.github._4drian3d.authmevelocity.common.configuration.PaperConfiguration;
|
import io.github._4drian3d.authmevelocity.common.configuration.PaperConfiguration;
|
||||||
import io.github._4drian3d.authmevelocity.paper.listeners.AuthMeListener;
|
import io.github._4drian3d.authmevelocity.paper.listeners.AuthMeListener;
|
||||||
import io.github._4drian3d.authmevelocity.paper.listeners.MessageListener;
|
import io.github._4drian3d.authmevelocity.paper.listeners.MessageListener;
|
||||||
import net.byteflux.libby.BukkitLibraryManager;
|
|
||||||
import net.byteflux.libby.LibraryManager;
|
import net.byteflux.libby.LibraryManager;
|
||||||
import net.kyori.adventure.text.Component;
|
import net.byteflux.libby.PaperLibraryManager;
|
||||||
import net.kyori.adventure.text.logger.slf4j.ComponentLogger;
|
import net.kyori.adventure.text.logger.slf4j.ComponentLogger;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.InputStreamReader;
|
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.Set;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import static net.kyori.adventure.text.minimessage.MiniMessage.miniMessage;
|
import static net.kyori.adventure.text.minimessage.MiniMessage.miniMessage;
|
||||||
|
|
||||||
@ -51,14 +43,14 @@ public final class AuthMeVelocityPlugin extends JavaPlugin {
|
|||||||
private ComponentLogger componentLogger;
|
private ComponentLogger componentLogger;
|
||||||
private ConfigurationContainer<PaperConfiguration> config;
|
private ConfigurationContainer<PaperConfiguration> config;
|
||||||
|
|
||||||
public AuthMeVelocityPlugin() {
|
public AuthMeVelocityPlugin(final Path dataFolder) {
|
||||||
this.dataFolder = getDataFolder().toPath();
|
this.dataFolder = dataFolder;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
this.componentLogger = ComponentLogger.logger();
|
this.componentLogger = getComponentLogger();
|
||||||
final LibraryManager libraryManager = new BukkitLibraryManager(this);
|
final LibraryManager libraryManager = new PaperLibraryManager(this);
|
||||||
new LibsManager(libraryManager).loadLibraries();
|
new LibsManager(libraryManager).loadLibraries();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -79,11 +71,6 @@ public final class AuthMeVelocityPlugin extends JavaPlugin {
|
|||||||
AuthMePlaceholders.getExpansion().register();
|
AuthMePlaceholders.getExpansion().register();
|
||||||
}
|
}
|
||||||
|
|
||||||
Set<Class<?>> classes;
|
|
||||||
String packageName = "net.kyori.adventure.text";
|
|
||||||
|
|
||||||
Class c = Component.class;
|
|
||||||
|
|
||||||
componentLogger.info(miniMessage().deserialize("<gradient:aqua:dark_aqua>AuthMeVelocity</gradient> <aqua>enabled"));
|
componentLogger.info(miniMessage().deserialize("<gradient:aqua:dark_aqua>AuthMeVelocity</gradient> <aqua>enabled"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,12 +40,12 @@ public final class AuthMeListener implements Listener {
|
|||||||
final Player player = event.getPlayer();
|
final Player player = event.getPlayer();
|
||||||
plugin.logDebug("LoginEvent | Start");
|
plugin.logDebug("LoginEvent | Start");
|
||||||
|
|
||||||
plugin.getServer().getScheduler().runTaskLaterAsynchronously(plugin, task -> {
|
plugin.getServer().getAsyncScheduler().runDelayed(plugin, task -> {
|
||||||
if (new PreSendLoginEvent(player).callEvent()) {
|
if (new PreSendLoginEvent(player).callEvent()) {
|
||||||
plugin.sendMessageToProxy(player, MessageType.LOGIN, player.getName());
|
plugin.sendMessageToProxy(player, MessageType.LOGIN, player.getName());
|
||||||
plugin.logDebug("LoginEvent | PreSendLoginEvent allowed");
|
plugin.logDebug("LoginEvent | PreSendLoginEvent allowed");
|
||||||
}
|
}
|
||||||
}, 20);
|
}, 1, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
@ -53,12 +53,12 @@ public final class AuthMeListener implements Listener {
|
|||||||
final Player player = event.getPlayer();
|
final Player player = event.getPlayer();
|
||||||
plugin.logDebug("RestoreSessionEvent | Start");
|
plugin.logDebug("RestoreSessionEvent | Start");
|
||||||
|
|
||||||
plugin.getServer().getScheduler().runTaskLater(plugin, task -> {
|
plugin.getServer().getAsyncScheduler().runDelayed(plugin, task -> {
|
||||||
if (new PreSendLoginEvent(player).callEvent()) {
|
if (new PreSendLoginEvent(player).callEvent()) {
|
||||||
plugin.sendMessageToProxy(player, MessageType.LOGIN, player.getName());
|
plugin.sendMessageToProxy(player, MessageType.LOGIN, player.getName());
|
||||||
plugin.logDebug("RestoreSessionEvent | PreSendLoginEvent allowed");
|
plugin.logDebug("RestoreSessionEvent | PreSendLoginEvent allowed");
|
||||||
}
|
}
|
||||||
}, 20);
|
}, 1, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
|
@ -7,7 +7,7 @@ authors:
|
|||||||
- xQuickGlare
|
- xQuickGlare
|
||||||
- 4drian3d
|
- 4drian3d
|
||||||
website: https://modrinth.com/plugin/authmevelocity
|
website: https://modrinth.com/plugin/authmevelocity
|
||||||
api-version: '1.16'
|
api-version: '1.20'
|
||||||
folia-supported: true
|
folia-supported: true
|
||||||
dependencies:
|
dependencies:
|
||||||
server:
|
server:
|
@ -39,6 +39,5 @@ dependencyResolutionManagement {
|
|||||||
includeGroup("net.byteflux")
|
includeGroup("net.byteflux")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mavenCentral()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,10 +6,12 @@ plugins {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly(libs.velocity.api)
|
compileOnly(libs.velocity.api)
|
||||||
|
compileOnly(libs.velocity.proxy)
|
||||||
annotationProcessor(libs.velocity.api)
|
annotationProcessor(libs.velocity.api)
|
||||||
|
|
||||||
compileOnly(libs.miniplaceholders)
|
compileOnly(libs.miniplaceholders)
|
||||||
compileOnly(libs.fastlogin.velocity)
|
compileOnly(libs.fastlogin.velocity)
|
||||||
|
compileOnly(libs.vpacketevents)
|
||||||
compileOnly(libs.luckperms)
|
compileOnly(libs.luckperms)
|
||||||
|
|
||||||
implementation(projects.authmevelocityCommon)
|
implementation(projects.authmevelocityCommon)
|
||||||
@ -17,7 +19,7 @@ dependencies {
|
|||||||
|
|
||||||
implementation(libs.bstats.velocity)
|
implementation(libs.bstats.velocity)
|
||||||
|
|
||||||
testImplementation(platform("org.junit:junit-bom:5.11.0"))
|
testImplementation(platform("org.junit:junit-bom:5.10.3"))
|
||||||
testImplementation("org.junit.jupiter:junit-jupiter")
|
testImplementation("org.junit.jupiter:junit-jupiter")
|
||||||
testImplementation(libs.assertj)
|
testImplementation(libs.assertj)
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,8 @@
|
|||||||
|
|
||||||
package io.github._4drian3d.authmevelocity.velocity.listener.connection;
|
package io.github._4drian3d.authmevelocity.velocity.listener.connection;
|
||||||
|
|
||||||
|
import com.google.common.io.ByteArrayDataOutput;
|
||||||
|
import com.google.common.io.ByteStreams;
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import com.velocitypowered.api.event.EventManager;
|
import com.velocitypowered.api.event.EventManager;
|
||||||
import com.velocitypowered.api.event.EventTask;
|
import com.velocitypowered.api.event.EventTask;
|
||||||
@ -59,13 +61,13 @@ public final class PostConnectListener implements Listener<ServerPostConnectEven
|
|||||||
}
|
}
|
||||||
|
|
||||||
plugin.logDebug("ServerPostConnectEvent | Already logged player and connected to an Auth server");
|
plugin.logDebug("ServerPostConnectEvent | Already logged player and connected to an Auth server");
|
||||||
final boolean messageResult = server.sendPluginMessage(AuthMeVelocityPlugin.MODERN_CHANNEL, (encoder) -> {
|
final ByteArrayDataOutput buf = ByteStreams.newDataOutput();
|
||||||
plugin.logDebug(() -> "ServerPostConnectEvent | " + player.getUsername() + " | Encoding LOGIN data");
|
buf.writeUTF("LOGIN");
|
||||||
encoder.writeUTF("LOGIN");
|
buf.writeUTF(player.getUsername());
|
||||||
encoder.writeUTF(player.getUsername());
|
|
||||||
|
final byte[] byteArray = buf.toByteArray();
|
||||||
plugin.logDebug(() -> "ServerPostConnectEvent | " + player.getUsername() + " | Sending LOGIN data");
|
plugin.logDebug(() -> "ServerPostConnectEvent | " + player.getUsername() + " | Sending LOGIN data");
|
||||||
});
|
if (server.sendPluginMessage(AuthMeVelocityPlugin.MODERN_CHANNEL, byteArray)) {
|
||||||
if (messageResult) {
|
|
||||||
plugin.logDebug(() -> "ServerPostConnectEvent | " + player.getUsername() + " | Correctly send data");
|
plugin.logDebug(() -> "ServerPostConnectEvent | " + player.getUsername() + " | Correctly send data");
|
||||||
} else {
|
} else {
|
||||||
plugin.logDebug("ServerPostConnectEvent | Failed to send data");
|
plugin.logDebug("ServerPostConnectEvent | Failed to send data");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user