jammsen / docker-palworld-dedicated-server

Docker container to easily provision and manage Palworld Dedicated Server
https://hub.docker.com/r/jammsen/palworld-dedicated-server
MIT License
897 stars 151 forks source link

Fix player join/leave with spaces in name. Resolves #224. #225

Closed Dashboy1998 closed 4 months ago

jammsen commented 4 months ago

Hey @Dashboy1998 - I like the idea to use shell-expansion for this. But sadly it only works 1-2 times out of 10 times, i tried to add it to the announce_leave function and/or to the rcon broadcast_player_join aliases and its the same there too.

Screenshot 2024-02-23 113511

Trying now the SED soultion.

jammsen commented 4 months ago

This works 10 out of 10 times, but the linter is complaining i should use your version xD

image

Any ideas on how to fix this weird edge case?

jammsen commented 4 months ago
broadcast_player_leave "${1// /\-}"

This works.

jammsen commented 4 months ago

Added this to https://github.com/jammsen/docker-palworld-dedicated-server/commit/b44719cef294af1927508ccf33ac9350ce8694a6

Thanks for the contribution. Closing this PR, if you want the Contribution tag, just send me another PR with a documentation change or something like that. Happy to give that!

Dashboy1998 commented 4 months ago

Makes sense that '"{1// /-}" works as the hyphen is a special character in parameter expansion. However it's still very strange that it works some of the time as "{1// /-}"

I have the contribution tag from adding in TZ.