fix: removed ignore signed players option

Now that my UnSignedVelocity plugin exists, this option is no longer needed
This commit is contained in:
Adrian 2023-03-03 15:50:01 -05:00
parent 5e872b54b0
commit a500090723
No known key found for this signature in database
GPG Key ID: FB8EF84DCE1BE452
3 changed files with 3 additions and 34 deletions

View File

@ -8,7 +8,7 @@ java {
withSourcesJar() withSourcesJar()
withJavadocJar() withJavadocJar()
} }
/*
publishing { publishing {
publications { publications {
create<MavenPublication>("mavenJava") { create<MavenPublication>("mavenJava") {
@ -70,4 +70,4 @@ signing {
sign(configurations.archives.get()) sign(configurations.archives.get())
sign(publishing.publications["mavenJava"]) sign(publishing.publications["mavenJava"])
} }
*/

View File

@ -24,6 +24,7 @@ import io.github._4drian3d.authmevelocity.common.enums.SendMode;
import java.util.List; import java.util.List;
@SuppressWarnings("FieldMayBeFinal")
@ConfigSerializable @ConfigSerializable
public class ProxyConfiguration { public class ProxyConfiguration {
@Comment("List of login/registration servers") @Comment("List of login/registration servers")
@ -128,18 +129,5 @@ public class ProxyConfiguration {
public int randomAttempts() { public int randomAttempts() {
return this.randomAttempts; return this.randomAttempts;
} }
@Comment("""
Ignore blocking of commands and chat messages to 1.19.1 clients with a valid signed key
When trying to block these executions, the proxy will kick the player out.
This option allows you to prevent the plugin from trying to block these executions,
avoiding the player to be kicked out""")
private boolean ignoreSignedPlayers = false;
public boolean ignoreSignedPlayers() {
return this.ignoreSignedPlayers;
}
} }
} }

View File

@ -25,7 +25,6 @@ import com.velocitypowered.api.event.command.CommandExecuteEvent;
import com.velocitypowered.api.event.connection.DisconnectEvent; import com.velocitypowered.api.event.connection.DisconnectEvent;
import com.velocitypowered.api.event.player.PlayerChatEvent; import com.velocitypowered.api.event.player.PlayerChatEvent;
import com.velocitypowered.api.event.player.TabCompleteEvent; import com.velocitypowered.api.event.player.TabCompleteEvent;
import com.velocitypowered.api.network.ProtocolVersion;
import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.Player;
import io.github._4drian3d.authmevelocity.velocity.AuthMeVelocityPlugin; import io.github._4drian3d.authmevelocity.velocity.AuthMeVelocityPlugin;
import io.github._4drian3d.authmevelocity.velocity.utils.AuthMeUtils; import io.github._4drian3d.authmevelocity.velocity.utils.AuthMeUtils;
@ -61,12 +60,6 @@ public final class ProxyListener {
return; return;
} }
if (canBeIgnored(player)) {
plugin.logDebug("CommandExecuteEvent | Ignored signed player");
continuation.resume();
return;
}
if (plugin.isInAuthServer(player)) { if (plugin.isInAuthServer(player)) {
plugin.logDebug("CommandExecuteEvent | Player is in Auth Server"); plugin.logDebug("CommandExecuteEvent | Player is in Auth Server");
String command = AuthMeUtils.getFirstArgument(event.getCommand()); String command = AuthMeUtils.getFirstArgument(event.getCommand());
@ -93,12 +86,6 @@ public final class ProxyListener {
plugin.logDebug("PlayerChatEvent | Player is not logged"); plugin.logDebug("PlayerChatEvent | Player is not logged");
if (canBeIgnored(event.getPlayer())) {
plugin.logDebug("PlayerChatEvent | Ignored signed player");
continuation.resume();
return;
}
event.setResult(PlayerChatEvent.ChatResult.denied()); event.setResult(PlayerChatEvent.ChatResult.denied());
continuation.resume(); continuation.resume();
} }
@ -128,10 +115,4 @@ public final class ProxyListener {
} }
} }
boolean canBeIgnored(Player player) {
return player.getIdentifiedKey() != null
&& player.getProtocolVersion().compareTo(ProtocolVersion.MINECRAFT_1_19_1) >= 0
&& plugin.config().get().advanced().ignoreSignedPlayers();
}
} }