Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-ascii player name causes RCON showplayers break #4

Closed
sh-cho opened this issue Feb 4, 2024 · 6 comments
Closed

Non-ascii player name causes RCON showplayers break #4

sh-cho opened this issue Feb 4, 2024 · 6 comments

Comments

@sh-cho
Copy link
Contributor

sh-cho commented Feb 4, 2024

Problem

In Source RCON protocol, packet body is defined as Null-terminated ASCII String. But we can set palworld player name as non-ascii characters(ex. Korean, Chinese, Cyrillic, ...) and this sets showplayers response packet body as non-ascii character, finally RCON client is failed or stuck.

Similar issues:

I think this should be mainly handled by RCON client.

But it looks like exporter's polling is somewhat problematic.

Screenshot 2024-02-04 at 9 13 18 PM

This is timeline of my server when non-ascii name user joined. After user joined, somehow player count is keep exported(which is outdated) and players info is not exported. (2~3 persons playing in the server at the time)

Suggestion

  • disable polling (or add on/off option)
    • I believe this would be more appropriate to control this in prometheus. So every attempt to get metric => generate current snapshot.
  • replace or modify RCON client package
    • For now, I haven't tested which python RCON package can handle this situation 🥲
@bostrt
Copy link
Contributor

bostrt commented Feb 4, 2024

Thanks for this report, this is great. I really want to disable polling and will look into that.

As for testing with non-ascii I will have to look into that some more. I'm not sure about support by various libraries either.

@bostrt
Copy link
Contributor

bostrt commented Feb 4, 2024

It looks like non-ascii character support is a problem to be resolved in Palworld itself. gorcon/rcon-cli#35

I will continue looking for workarounds in the meantime.

Do you know of any other tools/libraries (non-python) that work fine?

@bostrt
Copy link
Contributor

bostrt commented Feb 4, 2024

I'm leaving this error here for reference. When a Player has a name using non-ascii, it results in this error:

2024-02-04:15:41:40.936 ERROR    [exporter.py:97] Received few bytes!

The best I can tell is, Palworld's RCON implementation is truncating the player names or ends of the string for some reason when they have non-ascii characters which results in the "Received [too] few bytes". The size of the ShowPlayers response must be calculated before they are sent across the wire.

@sh-cho
Copy link
Contributor Author

sh-cho commented Feb 5, 2024

Thanks for the check! I haven't tested any other rcon library, but even though some library can handle non-ascii chars, player id will be trimmed, so.. looks like it's best to wait palworld patch ...

@sh-cho sh-cho closed this as completed Feb 5, 2024
@bostrt
Copy link
Contributor

bostrt commented Feb 5, 2024

I still plan on disabling polling as requested in this issue. Should have that ready today or tomorrow.

@bostrt
Copy link
Contributor

bostrt commented Feb 6, 2024

Polling/caching is no longer used as of v1.1.0 https://github.com/palworldlol/palworld-exporter/releases/tag/v1.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants