V1nc3ntWasTaken / NoEncryption

Removes signatures from Minecraft chat messages

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Players "ghosts" get stuck on server when kicked by KauriVPN and can't join anymore.

lerokko opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues and have not found a duplicate relating to my issue.

Are you using the latest version of NoEncryption (Must be using V1nc3ntWasTaken's fork)?

  • I am using the latest version of NoEncryption compatible with my server version.

NoEncryption Version

4.0

Minecraft Version

1.19.2

Server Type

git-Paper 125, NoEncryption 4.0, KauriVPN 1.8

Describe the bug

When a player join with a VPN, KauriVPN kicks them this seems to cause an exception with NoEncryption. I am not sure if this is related to KauriVPN or NoEncryption but after the exception the player stays on the server as a ghost. No player entity, no ping, but still in tab lists and you can tp to them. Kicking them does not work, although the feedback of the kick message is positive.

I will try and see if the problem also affects the plugin called "whitelistPermsission" which kicks players in a hacky way it seems.

Log of the event:

  [Sat 18:03:18 INFO  Server/LoginListener] UUID of player BungalowBeet is 1bd42f0b-86cd-41dd-b487-8ec83d8f0808
  [Sat 18:03:18 INFO  Server] [P] BungalowBeet joined the game!
  [Sat 18:03:18 INFO  Server/PlayerList] BungalowBeet logged in with entity id 1283 at ([world_test]67.30255161185664, 83.93941544716823, -890.9870038663493)
  [Sat 18:03:19 INFO  Server/PlayerConnection] BungalowBeet lost connection: You seem to be using a VPN. Please ask on server26.net/discord (#general @moderators) to be whitelisted for VPN usage or disable your VPN.
  [Sat 18:03:19 INFO  Server] [P] BungalowBeet left the game!
  [Sat 18:03:19 INFO  Minecraft] BungalowBeet joined on a VPN/Proxy (VPN)
  [Sat 18:03:32 INFO  Server/LoginListener] UUID of player BungalowBeet is 1bd42f0b-86cd-41dd-b487-8ec83d8f0808
  [Sat 18:03:32 INFO  Server/PlayerConnection] BungalowBeet lost connection: You seem to be using a VPN. Please ask on server26.net/discord (#general @moderators) to be whitelisted for VPN usage or disable your VPN.
  [Sat 18:03:32 INFO  Minecraft] BungalowBeet joined on a VPN/Proxy (VPN)
  [Sat 18:03:43 INFO  Server/LoginListener] UUID of player BungalowBeet is 1bd42f0b-86cd-41dd-b487-8ec83d8f0808
  [Sat 18:03:43 INFO  Server/PlayerConnection] BungalowBeet lost connection: You seem to be using a VPN. Please ask on server26.net/discord (#general @moderators) to be whitelisted for VPN usage or disable your VPN.
  [Sat 18:03:43 INFO  Minecraft] BungalowBeet joined on a VPN/Proxy (VPN)
  [Sat 18:03:43 INFO  Server/PlayerConnection] Attempt to teleport removed player BungalowBeet restricted
 (edited)
[20:03]
- [Sat 18:03:43 ERROR Minecraft] Could not pass event PlayerJoinEvent to NoEncryption v4.0
java.util.NoSuchElementException: packet_handler
    at io.netty.channel.DefaultChannelPipeline.getContextOrDie(DefaultChannelPipeline.java:1073)
    at io.netty.channel.DefaultChannelPipeline.addBefore(DefaultChannelPipeline.java:248)
    at io.netty.channel.DefaultChannelPipeline.addBefore(DefaultChannelPipeline.java:237)
    at NoEncryption-v4.0--1.19.2_only.jar//me.doclic.noencryption.PlayerListener.onPlayerJoin(PlayerListener.java:59)
    at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor53.execute(Unknown Source)
    at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:75)
    at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:76)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:670)
    at net.minecraft.server.players.PlayerList.postChunkLoadJoin(PlayerList.java:366)
    at net.minecraft.server.players.PlayerList.lambda$placeNewPlayer$1(PlayerList.java:308)
    at net.minecraft.server.network.ServerGamePacketListenerImpl.tick(ServerGamePacketListenerImpl.java:354)
    at net.minecraft.network.Connection.tick(Connection.java:579)
    at net.minecraft.server.network.ServerConnectionListener.tick(ServerConnectionListener.java:233)
    at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1583)
    at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:446)
    at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1416)
    at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1192)
    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:305)
    at java.base/java.lang.Thread.run(Thread.java:833)
  [Sat 18:03:48 INFO  Server/LoginListener] UUID of player BungalowBeet is 1bd42f0b-86cd-41dd-b487-8ec83d8f0808
 (edited)
[20:03]
  [Sat 18:03:48 INFO  Minecraft] BungalowBeet joined on a VPN/Proxy (VPN)
  [Sat 18:04:03 INFO  Server/LoginListener] Disconnecting com.mojang.authlib.GameProfile@2f4aed46[id=1bd42f0b-86cd-41dd-b487-8ec83d8f0808,name=BungalowBeet,properties={textures=[com.mojang.authlib.properties.Property@1bb376dc]},legacy=false] (/REDACTED IP): Took too long to log in
  [Sat 18:04:03 INFO  Server/LoginListener] com.mojang.authlib.GameProfile@2f4aed46[id=1bd42f0b-86cd-41dd-b487-8ec83d8f0808,name=BungalowBeet,properties={textures=[com.mojang.authlib.properties.Property@1bb376dc]},legacy=false] (/REDACTED IP) lost connection: Took too long to log in
  [Sat 18:04:09 INFO  Server/LoginListener] UUID of player BungalowBeet is 1bd42f0b-86cd-41dd-b487-8ec83d8f0808
  [Sat 18:04:09 INFO  Minecraft] BungalowBeet joined on a VPN/Proxy (VPN)
  [Sat 18:04:24 INFO  Server/LoginListener] Disconnecting com.mojang.authlib.GameProfile@46396e52[id=1bd42f0b-86cd-41dd-b487-8ec83d8f0808,name=BungalowBeet,properties={textures=[com.mojang.authlib.properties.Property@63721c0c]},legacy=false] (/REDACTED IP): Took too long to log in
  [Sat 18:04:24 INFO  Server/LoginListener] com.mojang.authlib.GameProfile@46396e52[id=1bd42f0b-86cd-41dd-b487-8ec83d8f0808,name=BungalowBeet,properties={textures=[com.mojang.authlib.properties.Property@63721c0c]},legacy=false] (/REDACTED IP) lost connection: Took too long to log in

Reproducible Test

Get NoEncryption, paper, KauriVPN, enable VPN (probably geo restriction in config should work the same if you don't have a VPN). Try to join repeatedly. At some point the bug occurs.

https://api.papermc.io/v2/projects/paper/versions/1.19.2/builds/125/downloads/paper-1.19.2-125.jar
https://www.spigotmc.org/resources/kaurivpn-anti-proxy-tor-and-vpn-free-api.93355/updates

Anything else?

No response

I am not home at the moment, but it is possible that this is because AntiVPN lets the connection go through to join the server before checking if it's a VPN connection, and NoEncryption is trying to grab the handler as AntiVPN kicks the player, thus not finding it. I can probably fix the exception, but other than that, bad handling on the AntiVPN side of things. Again, not home and I would have to do more testing.

(Does the ghost player thing still happen without the plugin installed?)

So now that I'm looking at the code, the plugin has an error finding a channel on the player's connection pipeline. (Essentially the injector [Don't know what else to call it] was called when the player joined, before the player is kicked, and the player was kicked and the connection was closed before the interceptor was injected. ["packet_handler" is put in the pipeline from the server itself.])

I'm going to keep this open because I do not know if this patch will be fully effective on your end, but feel free to keep testing!

FYI I do get the same error message client side with Whitelist Permission (https://www.spigotmc.org/resources/whitelistpermission-%E2%99%A6-1-8-1-17.75880/) but it does not create a ghost player. But this may be due to me having a 10 times lower ping that the person experiencing this with the AntiVPN.

Just leaving this coment here in case it helps:


! [Wed 11:03:00 WARN ] java.lang.Throwable: [ERROR] Illegal PlayerChunkMap::addEntity for world world_test: EntityPlayer['40_2'/13570, uuid='bb7a6035-ada9-4ab8-a18e-9570e139ef6e', l='ServerLevel[world_test]', x=-264.46, y=64.00, z=-247.53, cpos=[-17, -16], tl=141439, v=false, removed=UNLOADED_WITH_PLAYER](40_2 at -264.4573293090676,64.0,-247.53031572883395)
! [Wed 11:03:00 WARN ]     at net.minecraft.server.level.PlayerChunkMap.a(PlayerChunkMap.java:2017)
! [Wed 11:03:00 WARN ]     at net.minecraft.server.players.PlayerList.postChunkLoadJoin(PlayerList.java:398)
! [Wed 11:03:00 WARN ]     at net.minecraft.server.players.PlayerList.lambda$placeNewPlayer$1(PlayerList.java:308)
! [Wed 11:03:00 WARN ]     at net.minecraft.server.network.PlayerConnection.c(PlayerConnection.java:357)
! [Wed 11:03:00 WARN ]     at net.minecraft.network.NetworkManager.a(NetworkManager.java:579)
! [Wed 11:03:00 WARN ]     at net.minecraft.server.network.ServerConnection.c(ServerConnection.java:233)
! [Wed 11:03:00 WARN ]     at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1583)
! [Wed 11:03:00 WARN ]     at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:446)
! [Wed 11:03:00 WARN ]     at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1416)
! [Wed 11:03:00 WARN ]     at net.minecraft.server.MinecraftServer.v(MinecraftServer.java:1192)
! [Wed 11:03:00 WARN ]     at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:305)
 
! [Wed 11:03:00 WARN ]     at java.base/java.lang.Thread.run(Thread.java:833)
  [Wed 11:03:00 INFO  Server/PlayerList] 40_2 logged in with entity id 13570 at ([world_test]-264.4573293090676, 64.0, -247.53031572883395)
  [Wed 11:03:08 INFO  Server/LoginListener] UUID of player 40_2 is bb7a6035-ada9-4ab8-a18e-9570e139ef6e
! [Wed 11:03:08 WARN  Server/WorldServer] Force-added player with duplicate UUID bb7a6035-ada9-4ab8-a18e-9570e139ef6e
  [Wed 11:03:08 INFO  Server/PlayerConnection] 40_2 lost connection: WP » Sorry, %player% you dont have the correct permission to join
! [Wed 11:03:08 WARN ] java.lang.Throwable: [ERROR] Illegal PlayerChunkMap::addEntity for world world_test: EntityPlayer['40_2'/13710, uuid='bb7a6035-ada9-4ab8-a18e-9570e139ef6e', l='ServerLevel[world_test]', x=-264.46, y=64.00, z=-247.53, cpos=[-17, -16], tl=141439, v=false, removed=UNLOADED_WITH_PLAYER](40_2 at -264.4573293090676,64.0,-247.53031572883395)
! [Wed 11:03:08 WARN ]     at net.minecraft.server.level.PlayerChunkMap.a(PlayerChunkMap.java:2017)
! [Wed 11:03:08 WARN ]     at net.minecraft.server.players.PlayerList.postChunkLoadJoin(PlayerList.java:398)
! [Wed 11:03:08 WARN ]     at net.minecraft.server.players.PlayerList.lambda$placeNewPlayer$1(PlayerList.java:308)
! [Wed 11:03:08 WARN ]     at net.minecraft.server.network.PlayerConnection.c(PlayerConnection.java:357)
! [Wed 11:03:08 WARN ]     at net.minecraft.network.NetworkManager.a(NetworkManager.java:579)
! [Wed 11:03:08 WARN ]     at net.minecraft.server.network.ServerConnection.c(ServerConnection.java:233)
! [Wed 11:03:08 WARN ]     at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1583)
! [Wed 11:03:08 WARN ]     at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:446)
! [Wed 11:03:08 WARN ]     at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1416)
! [Wed 11:03:08 WARN ]     at net.minecraft.server.MinecraftServer.v(MinecraftServer.java:1192)
 
! [Wed 11:03:08 WARN ]     at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:305)
! [Wed 11:03:08 WARN ]     at java.base/java.lang.Thread.run(Thread.java:833)
  [Wed 11:03:08 INFO  Server/PlayerList] 40_2 logged in with entity id 13710 at ([world_test]-264.4573293090676, 64.0, -247.53031572883395)
  [Wed 11:03:11 INFO  Server/LoginListener] UUID of player 40_2 is bb7a6035-ada9-4ab8-a18e-9570e139ef6e
! [Wed 11:03:11 WARN  Server/WorldServer] Force-added player with duplicate UUID bb7a6035-ada9-4ab8-a18e-9570e139ef6e
  [Wed 11:03:11 INFO  Server/PlayerConnection] 40_2 lost connection: WP » Sorry, %player% you dont have the correct permission to join
  [Wed 11:03:14 INFO  Server/LoginListener] com.mojang.authlib.GameProfile@40be1972[id=<null>,name=40_2,properties={},legacy=false] (/REDACTED IP:43628) lost connection: Disconnected
  [Wed 11:03:16 INFO  Server/LoginListener] UUID of player 40_2 is bb7a6035-ada9-4ab8-a18e-9570e139ef6e
  [Wed 11:03:16 INFO  Server/PlayerConnection] 40_2 lost connection: WP » Sorry, %player% you dont have the correct permission to join
  [Wed 11:03:19 INFO  Server/LoginListener] com.mojang.authlib.GameProfile@68ea3b8b[id=<null>,name=40_2,properties={},legacy=false] (/REDACTED IP:43749) lost connection: Disconnected
  [Wed 11:03:21 INFO  Server/LoginListener] com.mojang.authlib.GameProfile@1e5ce8ae[id=<null>,name=40_2,properties={},legacy=false] (/REDACTED IP:43612) lost connection: Disconnected
  [Wed 11:06:17 INFO  Server/LoginListener] UUID of player 40_2 is bb7a6035-ada9-4ab8-a18e-9570e139ef6e
 
  [Wed 11:06:17 INFO  Server/PlayerConnection] 40_2 lost connection: WP » Sorry, %player% you dont have the correct permission to join
  [Wed 11:06:19 INFO  Server/LoginListener] UUID of player 40_2 is bb7a6035-ada9-4ab8-a18e-9570e139ef6e
  [Wed 11:06:19 INFO  Server/PlayerConnection] 40_2 lost connection: WP » Sorry, %player% you dont have the correct permission to join

So it's possible that this was patched in the 4.1 release. If you can test on your end with your plugins and please let me know the results, that would be awesome!

I am unable to reproduce this with the 4.2 version. However I should add that the offending plugin KauriVPN has also released an update and I only did tests against that version (https://www.spigotmc.org/resources/kaurivpn-anti-proxy-tor-and-vpn-free-api.93355/update?update=470052)

Fixed an issue where player references would not be removed from a cache on player disconnect.

In conclusion: players still get error messages sometimes when blocked by WhitelistPermission or KauriVPN but on the serverside all is clean, I do not think those issues are in the scope of NoEncryption so I'd consider this fixed. Thank you for taking your time addressing this @V1nc3ntWasTaken!