gorcon / rcon-cli

RCON client for executing queries on game server.
MIT License
497 stars 46 forks source link

PZ "Players" command timeout when unsupported characters present #46

Open SAPHROF opened 9 months ago

SAPHROF commented 9 months ago

When player names have invisible characters such as " ‎ ‎", which appears as "-ΓÇÄ ΓÇÄ ΓÇÄ" in the console, RCON will timeout with the following error on the server:

LOG : General , 1709045530266> 97.774.271> RCON: new connection Socket[addr=/127.0.0.1,port=55902,localport=] LOG : General , 1709045530267> 97.774.272> RCON: ID=0 Type=3 Body='' Socket[addr=/127.0.0.1,port=55902,localport=] ERROR: General , 1709045530370> 97.774.374> java.nio.BufferOverflowException ERROR: General , 1709045530370> 97.774.375> at java.base/java.nio.HeapByteBuffer.put(Unknown Source) ERROR: General , 1709045530370> 97.774.375> at java.base/java.nio.ByteBuffer.put(Unknown Source) ERROR: General , 1709045530370> 97.774.375> at zombie.network.RCONServer$ClientThread.handleResponse(RCONServer.java:280) ERROR: General , 1709045530370> 97.774.375> at zombie.network.RCONServer$ClientThread.handlePacket(RCONServer.java:213) ERROR: General , 1709045530370> 97.774.375> at zombie.network.RCONServer$ClientThread.runInner(RCONServer.java:165) ERROR: General , 1709045530370> 97.774.375> at zombie.network.RCONServer$ClientThread.run(RCONServer.java:121)

These player names are visible when running the "players" command directly on the server console itself, but throws this BufferOverflowException when done via RCON.

PascaleBeier commented 8 months ago

Noticed the same in palworld for player characters with special characters. I think this might be related.

@outdead would you accept a PR for this? This is something that impacts our metrics endpoints

https://github.com/gorcon/rcon/issues/8#issue-2166166489