Bram1903 / MinecraftPlayerCrasher

An easy-to-use Minecraft plugin that enables the crashing of a player's game through the use of a command.
GNU General Public License v3.0
24 stars 3 forks source link

[Bug] Console command issue on Flamecord #19

Open TheJoshue opened 1 month ago

TheJoshue commented 1 month ago

When you try to execute /crash <player> or just /crash command via console of bungee/spigot server, it simply throws this error

This is the log when we execute the crash command on Bungee This is FLAMECORD (waterfall fork; in core of it, it is not that much different than regular waterfall)

[22:38:06 ERROR]: Exception in thread "main" java.lang.LinkageError: loader constraint violation: when resolving interface method 'java.lang.String io.github.retrooper.packetevents.adventure.serializer.legacy.LegacyComponentSerializer.serialize(net.kyori.adventure.text.Component)' the class loader net.md_5.bungee.api.plugin.PluginClassloader @36061cf3 of the current class, com/deathmotion/playercrasher/BungeePlayerCrasher, and the class loader net.md_5.bungee.api.plugin.PluginClassloader @37af1f93 for the method's defining class, io/github/retrooper/packetevents/adventure/serializer/legacy/LegacyComponentSerializer, have different Class objects for the type net/kyori/adventure/text/Component used in the signature (com.deathmotion.playercrasher.BungeePlayerCrasher is in unnamed module of loader net.md_5.bungee.api.plugin.PluginClassloader @36061cf3, parent loader 'app'; io.github.retrooper.packetevents.adventure.serializer.legacy.LegacyComponentSerializer is in unnamed module of loader net.md_5.bungee.api.plugin.PluginClassloader @37af1f93, parent loader 'app')
[22:38:06 ERROR]:       at com.deathmotion.playercrasher.BungeePlayerCrasher.sendConsoleMessage(BungeePlayerCrasher.java:72)
[22:38:06 ERROR]:       at com.deathmotion.playercrasher.Util.MessageSender.sendMessages(MessageSender.java:39)
[22:38:06 ERROR]:       at com.deathmotion.playercrasher.commands.BungeeCrashCommand.execute(BungeeCrashCommand.java:58)
[22:38:06 ERROR]:       at net.md_5.bungee.api.plugin.PluginManager.dispatchCommand(PluginManager.java:215)
[22:38:06 ERROR]:       at net.md_5.bungee.api.plugin.PluginManager.dispatchCommand(PluginManager.java:166)
[22:38:06 ERROR]:       at io.github.waterfallmc.waterfall.console.WaterfallConsole.runCommand(WaterfallConsole.java:30)
[22:38:06 ERROR]:       at net.minecrell.terminalconsole.SimpleTerminalConsole.processInput(SimpleTerminalConsole.java:87)
[22:38:06 ERROR]:       at net.minecrell.terminalconsole.SimpleTerminalConsole.readCommands(SimpleTerminalConsole.java:168)
[22:38:06 ERROR]:       at net.minecrell.terminalconsole.SimpleTerminalConsole.start(SimpleTerminalConsole.java:141)
[22:38:06 ERROR]:       at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:57)
[22:38:06 ERROR]:       at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15)

This is the log when we execute the crash command on Spigot This is DIONYSUS (specifically paper 1.12.2 fork; in core of it, it is not that much different than regular paper)

[22:38:34 WARN]: Unexpected exception while parsing console command "crash"
org.bukkit.command.CommandException: Unhandled exception executing command 'crash' in plugin PlayerCrasher v3.0.1
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[paper-1.12.2]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:152) ~[paper-1.12.2]
        at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchCommand(CraftServer.java:688) ~[paper-1.12.2]
        at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchServerCommand(CraftServer.java:651) ~[paper-1.12.2]
        at net.minecraft.server.v1_12_R1.DedicatedServer.aP(DedicatedServer.java:469) ~[paper-1.12.2]
        at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:430) ~[paper-1.12.2]
        at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:790) ~[paper-1.12.2]
        at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:681) ~[paper-1.12.2]
        at java.lang.Thread.run(Thread.java:840) ~[?:?]
Caused by: java.lang.NoSuchMethodError: 'void org.bukkit.command.ConsoleCommandSender.sendMessage(net.kyori.adventure.text.Component)'
        at com.deathmotion.playercrasher.BukkitPlayerCrasher.sendConsoleMessage(BukkitPlayerCrasher.java:92) ~[?:?]
        at com.deathmotion.playercrasher.util.MessageSender.sendMessages(MessageSender.java:39) ~[?:?]
        at com.deathmotion.playercrasher.commands.BukkitCrashCommand.onCommand(BukkitCrashCommand.java:59) ~[?:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[paper-1.12.2]
        ... 8 more

The thing is that i would like to punish cheaters or rule breakers with final warning which would be automatic execution of /crash <target> which will some plugin execute which could potentially happen from console because of the system i have and how i am using RCON too.

I hope you will implement this, really needed, plugin works as intended. Thank you very much!

Bram1903 commented 1 month ago

Hey there,

Thanks for creating this issue! I wasn't aware of this bug. I will try and fix this tomorrow, and release a patch once I find the solution!

Kind regards, Bram

TheJoshue commented 1 month ago

@Bram1903 nice!

Just so i don't open another github issue, i will give you another different issue here (if you want i can post as new one)

This is how to reproduce it:

This is the only thing that happens in console log too, nothing else

Bram1903 commented 1 month ago

@Bram1903 nice!

Just so i don't open another github issue, i will give you another different issue here (if you want i can post as new one)

This is how to reproduce it:

  • put latest 3.0.1 PlayerCrasher plugin on bungeecord (in my case i am using FlameCord) with latest dependencies such as PacketEvents plugin, etc
  • join server on admin account and execute /crash or /crash <some_player>
  • you will get disconnected from whole network (proxy) with this message: image

This is the only thing that happens in console log too, nothing else

I am sure Flamecord had a compatibility issue with PacketEvents, which was fixed in a new version released yesterday. See: https://builtbybit.com/resources/flamecord-ultimate-anti-bot-solution.13492/updates#resource-update-146426

That should already fix multiple issues that might have occurred and I hope also this one. If that's not the case you might want to try the latest development build of PacketEvents, as I have heard there were some issues with Bungeecord support in version 2.5.0. Using 2.5.1-SNAPSHOT should also fix these issues. Latest PacketEvents builds: https://ci.codemc.io/job/retrooper/job/packetevents/lastSuccessfulBuild/artifact/bungeecord/build/libs/packetevents-bungeecord-2.5.1-SNAPSHOT.jar

I am now going to try and resolve the earlier-mentioned issue with executing the command from the console!

Bram1903 commented 1 month ago

Hey @TheJoshue,

I just tried to crash myself using the latest Bungeecord build and the latest version of the PlayerCrasher and PacketEvents and everything seems to work fine. Could you try updating to the latest Flamecord and PacketEvents build and test it again?

Screenshot: image

Kind regards, Bram

Bram1903 commented 1 month ago

@TheJoshue ?

TheJoshue commented 1 month ago

Updated to latest FlameCord and latest dev build of PacketEventsAPI Now i can't even execute /crash

I also tried /crash same issue

crash [11:10:44 INFO]: CONSOLE executed command: /crash [11:10:44 ERROR]: Exception in thread "main" java.lang.LinkageError: loader constraint violation: when resolving interface method 'java.lang.String io.github.retrooper.packetevents.adventure.serializer.legacy.LegacyComponentSerializer.serialize(net.kyori.adventure.text.Component)' the class loader net.md_5.bungee.api.plugin.PluginClassloader @66420549 of the current class, com/deathmotion/playercrasher/BungeePlayerCrasher, and the class loader net.md_5.bungee.api.plugin.PluginClassloader @5633dafd for the method's defining class, io/github/retrooper/packetevents/adventure/serializer/legacy/LegacyComponentSerializer, have different Class objects for the type net/kyori/adventure/text/Component used in the signature (com.deathmotion.playercrasher.BungeePlayerCrasher is in unnamed module of loader net.md_5.bungee.api.plugin.PluginClassloader @66420549, parent loader 'app'; io.github.retrooper.packetevents.adventure.serializer.legacy.LegacyComponentSerializer is in unnamed module of loader net.md_5.bungee.api.plugin.PluginClassloader @5633dafd, parent loader 'app') [11:10:44 ERROR]: at com.deathmotion.playercrasher.BungeePlayerCrasher.sendConsoleMessage(BungeePlayerCrasher.java:72) [11:10:44 ERROR]: at com.deathmotion.playercrasher.Util.MessageSender.sendMessages(MessageSender.java:39) [11:10:44 ERROR]: at com.deathmotion.playercrasher.commands.BungeeCrashCommand.execute(BungeeCrashCommand.java:58) [11:10:44 ERROR]: at net.md_5.bungee.api.plugin.PluginManager.dispatchCommand(PluginManager.java:215) [11:10:44 ERROR]: at net.md_5.bungee.api.plugin.PluginManager.dispatchCommand(PluginManager.java:166) [11:10:44 ERROR]: at io.github.waterfallmc.waterfall.console.WaterfallConsole.runCommand(WaterfallConsole.java:30) [11:10:44 ERROR]: at net.minecrell.terminalconsole.SimpleTerminalConsole.processInput(SimpleTerminalConsole.java:87) [11:10:44 ERROR]: at net.minecrell.terminalconsole.SimpleTerminalConsole.readCommands(SimpleTerminalConsole.java:168) [11:10:44 ERROR]: at net.minecrell.terminalconsole.SimpleTerminalConsole.start(SimpleTerminalConsole.java:141) [11:10:44 ERROR]: at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:57) [11:10:44 ERROR]: at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15)

TheJoshue commented 1 month ago

@Bram1903

Bram1903 commented 1 month ago

This looks like an issue due to something Flamecord changed. I'll try to talk to their developers to see if this can be fixed, or what I can change to fix this incompatibility.

TheJoshue commented 1 month ago

@LinsaFTW