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

The ShowPlayers and Broadcast commands prefer to use the REST API when it is enabled for player logging. #537

Conversation

MusclePr
Copy link
Contributor

@MusclePr MusclePr commented Apr 19, 2024

RCON cannot handle multibyte strings, so the ShowPlayers and Broadcast commands prefer to use the REST API when it is enabled.

Context

Work around bug with multibyte strings in RCON.

The multibyte strings are now displayed correctly.

Choices

This is because it takes time to fix bugs in RCON.

Test instructions

  1. create docker-compose.override.yml
services:
  palworld:
    image: thijsvanloef/palworld-server-docker:debug
    ports:
      - 8212:8212/tcp  # add REST API port
    environment:
      REST_API_ENABLED: true
      REST_API_PORT: 8212
      SERVER_PASSWORD: "" # [override] no password for debug
  1. build docker image for debug
docker build -t thijsvanloef/palworld-server-docker:debug .
  1. run docker container
docker compose up
  1. connect from client (PalWorld) and make new character with multibyte string name.
    example name:
まっする
  1. show docker logs.
[2024-04-19 20:49:37] [LOG] REST accessed endpoint /v1/api/players OK
muscle,3657AB7D000000000000000000000000,76561198847285114 has joined
[2024-04-19 20:49:37] [LOG] まっする joined the server. (User id: steam_76561198847285114)
[2024-04-19 20:49:37] [LOG] REST accessed endpoint /v1/api/announce OK
OK[2024-04-19 20:49:42] [LOG] REST accessed endpoint /v1/api/players OK
muscle,3657AB7D000000000000000000000000,76561198847285114 has left
[2024-04-19 20:49:42] [LOG] REST accessed endpoint /v1/api/announce OK
OKまっする,3657AB7D000000000000000000000000,76561198847285114 has joined
[2024-04-19 20:49:42] [LOG] REST accessed endpoint /v1/api/announce OK
OK[2024-04-19 20:49:47] [LOG] REST accessed endpoint /v1/api/players OK

Checklist before requesting a review

  • I have performed a self-review/test of my code
  • I've added documentation about this change to the docs.
  • I've not introduced breaking changes.
  • My changes do not violate linting rules.

@MusclePr MusclePr changed the title the ShowPlayers and Broadcast commands prefer to use the REST API when it is enabled. The ShowPlayers and Broadcast commands prefer to use the REST API when it is enabled for player logging. Apr 19, 2024
@thijsvanloef
Copy link
Owner

Thank you for taking the time to create the PR, I have not had the time yet to review, but will do so soon!

@MusclePr MusclePr force-pushed the feature/use_REST_API_for_player_logging branch from fefb96a to da9e9b1 Compare April 22, 2024 09:57
@MusclePr MusclePr force-pushed the feature/use_REST_API_for_player_logging branch from da9e9b1 to 0d31f45 Compare April 22, 2024 10:04
@thijsvanloef
Copy link
Owner

Just confirmed that your latest changes also fix the player logging bug! Thanks so much for doing the extra work.
I did notice one thing (which is an oversight on my part) if the REST_API_PORT is not defined in docker-compose.yml through env variables. The following error shows:

palworld-server  | REST API started on port 8212
palworld-server  | Waiting for REST API() port to open to show player logging...
palworld-server  | invalid port  : No such file or directory
palworld-server  | Waiting for REST API() port to open to show player logging...
palworld-server  | invalid port  : No such file or directory

Just pushed a fix that sets it to 8212 by default in the dockerfile :)

Love the work you've done, PR approved ❤️

@thijsvanloef thijsvanloef merged commit 2743c3f into thijsvanloef:main Apr 22, 2024
10 checks passed
@MusclePr MusclePr deleted the feature/use_REST_API_for_player_logging branch May 7, 2024 02:45
MusclePr pushed a commit to MusclePr/palworld-server-docker that referenced this pull request Jun 19, 2024
…I_for_player_logging

The ShowPlayers and Broadcast commands prefer to use the REST API when it is enabled for player logging.
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

Successfully merging this pull request may close these issues.

Strange things with the ENABLE_PLAYER_LOGGING function and discord messages after the last update
2 participants