Spartan AntiCheat error on bedrock player connect
SavageTheUnicorn opened this issue · 2 comments
- [Nope] This issue is not solved in a development build
Describe the bug
When a bedrock player connects to a 1.20.4 paper or purpur server running Spartan AntiCheat and ProtocolLib the console spit spit out a huge error and cause a lag spike dropping tps.
To Reproduce
Steps to reproduce the behavior:
- Have Spartan AntiCheat, Geyser/Floodgate, and ViaVersion installed on a 1.20.4 paper or purpur server and try to join via bedrock.
Additional context
[10:59:49] [Server thread/ERROR]: [Spartan] Unhandled exception occurred in onPacketSending(PacketEvent) for Spartan
java.lang.UnsupportedOperationException: The method getUniqueId is not supported for temporary players.
at com.comphenix.protocol.injector.temporary.TemporaryPlayerFactory$1.delegate(TemporaryPlayerFactory.java:138) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.injector.temporary.TemporaryPlayerInvocationHandler.getUniqueId(Unknown Source) ~[ProtocolLib.jar:?]
at com.vagdedes.spartan.functionality.server.b.i(SpartanBukkit.java:117) ~[SpartanUCYXAIYY.jar:?]
at com.vagdedes.spartan.listeners.protocol.c.onPacketSending(Join.java:26) ~[SpartanUCYXAIYY.jar:?]
at com.comphenix.protocol.injector.SortedPacketListenerList.invokeSendingListener(SortedPacketListenerList.java:219) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.injector.SortedPacketListenerList.invokeUnpackedPacketSending(SortedPacketListenerList.java:204) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.injector.SortedPacketListenerList.invokePacketSending(SortedPacketListenerList.java:149) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.injector.SortedPacketListenerList.invokePacketSending(SortedPacketListenerList.java:139) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.injector.PacketFilterManager.postPacketToListeners(PacketFilterManager.java:553) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.injector.PacketFilterManager.invokePacketSending(PacketFilterManager.java:526) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.injector.netty.manager.NetworkManagerInjector.onPacketSending(NetworkManagerInjector.java:100) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.injector.netty.channel.NettyChannelInjector.processOutbound(NettyChannelInjector.java:553) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.injector.netty.channel.NettyChannelInjector$2.doProxyRunnable(NettyChannelInjector.java:456) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.injector.netty.channel.NettyEventLoopProxy.proxyRunnable(NettyEventLoopProxy.java:43) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.injector.netty.channel.NettyEventLoopProxy.execute(NettyEventLoopProxy.java:252) ~[ProtocolLib.jar:?]
at net.minecraft.network.Connection.sendPacket(Connection.java:433) ~[?:?]
at net.minecraft.network.Connection.send(Connection.java:393) ~[?:?]
at net.minecraft.server.network.ServerCommonPacketListenerImpl.send(ServerCommonPacketListenerImpl.java:289) ~[purpur-1.20.4.jar:git-Purpur-2176]
at net.minecraft.server.network.ServerCommonPacketListenerImpl.send(ServerCommonPacketListenerImpl.java:274) ~[purpur-1.20.4.jar:git-Purpur-2176]
at net.minecraft.server.players.PlayerList.placeNewPlayer(PlayerList.java:297) ~[purpur-1.20.4.jar:git-Purpur-2176]
at net.minecraft.server.network.ServerConfigurationPacketListenerImpl.handleConfigurationFinished(ServerConfigurationPacketListenerImpl.java:134) ~[purpur-1.20.4.jar:git-Purpur-2176]
at net.minecraft.network.protocol.configuration.ServerboundFinishConfigurationPacket.handle(ServerboundFinishConfigurationPacket.java:18) ~[purpur-1.20.4.jar:git-Purpur-2176]
at net.minecraft.network.protocol.configuration.ServerboundFinishConfigurationPacket.a(ServerboundFinishConfigurationPacket.java:9) ~[purpur-1.20.4.jar:git-Purpur-2176]
at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$0(PacketUtils.java:54) ~[?:?]
at net.minecraft.server.TickTask.run(TickTask.java:18) ~[purpur-1.20.4.jar:git-Purpur-2176]
at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:149) ~[?:?]
at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[?:?]
at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1498) ~[purpur-1.20.4.jar:git-Purpur-2176]
at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:194) ~[purpur-1.20.4.jar:git-Purpur-2176]
at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:123) ~[?:?]
at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1475) ~[purpur-1.20.4.jar:git-Purpur-2176]
at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1398) ~[purpur-1.20.4.jar:git-Purpur-2176]
at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:133) ~[?:?]
at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1376) ~[purpur-1.20.4.jar:git-Purpur-2176]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1265) ~[purpur-1.20.4.jar:git-Purpur-2176]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:323) ~[purpur-1.20.4.jar:git-Purpur-2176]
at java.lang.Thread.run(Thread.java:1583) ~[?:?]
[10:59:49] [Server thread/ERROR]: Parameters:
net.minecraft.network.protocol.game.PacketPlayOutLogin@38d21951[
a=953258
b=false
c=[ResourceKey[minecraft:dimension / minecraft:overworld], ResourceKey[minecraft:dimension / minecraft:the_nether], ResourceKey[minecraft:dimension / minecraft:witp], ResourceKey[minecraft:dimension / minecraft:iep]]
d=100
e=6
f=4
g=false
h=true
i=false
j=CommonPlayerSpawnInfo[dimensionType=ResourceKey[minecraft:dimension_type / minecraft:overworld], dimension=ResourceKey[minecraft:dimension / minecraft:overworld], seed=651008623067167026, gameType=SURVIVAL, previousGameType=ADVENTURE, isDebug=false, isFlat=false, lastDeathLocation=Optional.empty, portalCooldown=0]
]
[10:59:49] [Server thread/ERROR]: [Spartan] Unhandled exception occurred in onPacketSending(PacketEvent) for Spartan
java.lang.UnsupportedOperationException: The method getUniqueId is not supported for temporary players.
at com.comphenix.protocol.injector.temporary.TemporaryPlayerFactory$1.delegate(TemporaryPlayerFactory.java:138) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.injector.temporary.TemporaryPlayerInvocationHandler.getUniqueId(Unknown Source) ~[ProtocolLib.jar:?]
at com.vagdedes.spartan.functionality.server.b.i(SpartanBukkit.java:117) ~[SpartanUCYXAIYY.jar:?]
at com.vagdedes.spartan.listeners.protocol.d.onPacketSending(ServerPosition.java:28) ~[SpartanUCYXAIYY.jar:?]
at com.comphenix.protocol.injector.SortedPacketListenerList.invokeSendingListener(SortedPacketListenerList.java:219) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.injector.SortedPacketListenerList.invokeUnpackedPacketSending(SortedPacketListenerList.java:204) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.injector.SortedPacketListenerList.invokePacketSending(SortedPacketListenerList.java:149) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.injector.SortedPacketListenerList.invokePacketSending(SortedPacketListenerList.java:139) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.injector.PacketFilterManager.postPacketToListeners(PacketFilterManager.java:553) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.injector.PacketFilterManager.invokePacketSending(PacketFilterManager.java:526) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.injector.netty.manager.NetworkManagerInjector.onPacketSending(NetworkManagerInjector.java:100) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.injector.netty.channel.NettyChannelInjector.processOutbound(NettyChannelInjector.java:553) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.injector.netty.channel.NettyChannelInjector$2.doProxyRunnable(NettyChannelInjector.java:456) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.injector.netty.channel.NettyEventLoopProxy.proxyRunnable(NettyEventLoopProxy.java:43) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.injector.netty.channel.NettyEventLoopProxy.execute(NettyEventLoopProxy.java:252) ~[ProtocolLib.jar:?]
at net.minecraft.network.Connection.sendPacket(Connection.java:433) ~[?:?]
at net.minecraft.network.Connection.send(Connection.java:393) ~[?:?]
at net.minecraft.server.network.ServerCommonPacketListenerImpl.send(ServerCommonPacketListenerImpl.java:289) ~[purpur-1.20.4.jar:git-Purpur-2176]
at net.minecraft.server.network.ServerCommonPacketListenerImpl.send(ServerCommonPacketListenerImpl.java:274) ~[purpur-1.20.4.jar:git-Purpur-2176]
at net.minecraft.server.network.ServerGamePacketListenerImpl.internalTeleport(ServerGamePacketListenerImpl.java:1834) ~[?:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.teleport(ServerGamePacketListenerImpl.java:1763) ~[?:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.teleport(ServerGamePacketListenerImpl.java:1743) ~[?:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.teleport(ServerGamePacketListenerImpl.java:1739) ~[?:?]
at net.minecraft.server.players.PlayerList.placeNewPlayer(PlayerList.java:319) ~[purpur-1.20.4.jar:git-Purpur-2176]
at net.minecraft.server.network.ServerConfigurationPacketListenerImpl.handleConfigurationFinished(ServerConfigurationPacketListenerImpl.java:134) ~[purpur-1.20.4.jar:git-Purpur-2176]
at net.minecraft.network.protocol.configuration.ServerboundFinishConfigurationPacket.handle(ServerboundFinishConfigurationPacket.java:18) ~[purpur-1.20.4.jar:git-Purpur-2176]
at net.minecraft.network.protocol.configuration.ServerboundFinishConfigurationPacket.a(ServerboundFinishConfigurationPacket.java:9) ~[purpur-1.20.4.jar:git-Purpur-2176]
at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$0(PacketUtils.java:54) ~[?:?]
at net.minecraft.server.TickTask.run(TickTask.java:18) ~[purpur-1.20.4.jar:git-Purpur-2176]
at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:149) ~[?:?]
at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[?:?]
at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1498) ~[purpur-1.20.4.jar:git-Purpur-2176]
at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:194) ~[purpur-1.20.4.jar:git-Purpur-2176]
at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:123) ~[?:?]
at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1475) ~[purpur-1.20.4.jar:git-Purpur-2176]
at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1398) ~[purpur-1.20.4.jar:git-Purpur-2176]
at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:133) ~[?:?]
at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1376) ~[purpur-1.20.4.jar:git-Purpur-2176]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1265) ~[purpur-1.20.4.jar:git-Purpur-2176]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:323) ~[purpur-1.20.4.jar:git-Purpur-2176]
at java.lang.Thread.run(Thread.java:1583) ~[?:?]
[10:59:49] [Server thread/ERROR]: Parameters:
net.minecraft.network.protocol.game.PacketPlayOutPosition@17664062[
a=-1744.5933
b=69.0
c=-387.23468
d=-50.10486
e=5.84198
f=[]
g=1
]
Based on the error message you provided, it appears that the issue stems from Spartan AntiCheat not validating whether the player instance in the PacketEvent is a temporary player. This oversight leads to an error because temporary players do not support all methods defined in the player interface. To resolve this, Spartan AntiCheat should include a check to verify the type of player instance before invoking these methods. For example with this:
Please report this to Spartan AntiCheat.
Thanks for the information, it has been passed along! Now I just need to figure out why and how to fix my server crashing after 9+ hours consistently, typically spouting that it cant create a thread or something 🤔😩
Unrelated edit: Seems to be a jvm issue causing the crash, replacing -Xmx with -XX:MaxRAMPercentage stops crashing for me.