Comments (8)
I'm fine with any solution you're happy with, I just wanted to propose some things and hear your thoughts.
Yeah sure im all ears for that.
I added now copy Default to location and sed-search-and-replace.
Your version for modifications in a manual way we have covered, its manual mode, there the script doesnt do anything. I think thats a solid base, both version are supported and the "config.sh" doesnt become a nightmare because of insane complexity.
Im open to later feedback, but lets go with this first.
Sounds reasonable. Thanks for fixing the issue, and thanks for listening to my suggestions, appreciate it.
from docker-palworld-dedicated-server.
I believe this will become a bigger issue in the future if Pocketpair decide to add new configuration values to Palworld in new updates.
from docker-palworld-dedicated-server.
Hey @Callum027
Always overwrite
PalWorldSettings.ini
withDefaultPalWorldSettings.ini
on startup, and overwrite the defaults with values set in the environment variables.
- This will ensure any configuration parameters managed by the container are always correct, but any manual changes made by the user will be lost.
This is litteraly what i do, IF the config does not exists, for backwards compability:
https://github.com/jammsen/docker-palworld-dedicated-server/blob/develop/includes/config.sh#L45
Reimplement config file management to insert configuration fields into the file if they exist.
- This takes much more work, but would preserve any manual modifications made by the user. Palworld uses default values if fields are not defined in
PalWorldSettings.ini
, so this would basically be the ideal solution.
What do you mean by that? I dont understand what you mean, please elaborate/reforumalte.
from docker-palworld-dedicated-server.
Always overwrite
PalWorldSettings.ini
withDefaultPalWorldSettings.ini
on startup, and overwrite the defaults with values set in the environment variables.
- This will ensure any configuration parameters managed by the container are always correct, but any manual changes made by the user will be lost.
This is litteraly what i do, IF the config does not exists, for backwards compability: https://github.com/jammsen/docker-palworld-dedicated-server/blob/develop/includes/config.sh#L45
If you go a little further up to includes/config.sh:39
, there is a condition set that it will only copy the file from DefaultPalWorldSettings.ini
if PalWorldSettings.ini
does not exist. This is the issue I am hitting: On existing installation the file already exists. So if a configuration parameter you're setting is not defined within the existing file (like in a Palworld version upgrade), it cannot be overwritten.
Reimplement config file management to insert configuration fields into the file if they exist.
- This takes much more work, but would preserve any manual modifications made by the user. Palworld uses default values if fields are not defined in
PalWorldSettings.ini
, so this would basically be the ideal solution.What do you mean by that? I dont understand what you mean, please elaborate/reforumalte.
So the current sed -E -i
commands will not add configuration files to PalWorldSettings.ini
if they are not already defined in there. What I mean is figure out a way to reimplement these so that it inserts the configuration field at the end of the file, if it is not already defined.
Here's an example of how it might be done for Difficulty
(it can be turned into a function to reduce the amount of duplication):
if grep "Difficulty=[a-zA-Z]*" "$GAME_SETTINGS_FILE" > /dev/null 2>&1; then
sed -E -i "s/Difficulty=[a-zA-Z]*/Difficulty=$DIFFICULTY/" "$GAME_SETTINGS_FILE"
else
sed -E -i "s/)$/,Difficulty=$DIFFICULTY)/" "$GAME_SETTINGS_FILE"
fi
from docker-palworld-dedicated-server.
Hey @Callum027
If you go a little further up to
includes/config.sh:39
, there is a condition set that it will only copy the file fromDefaultPalWorldSettings.ini
ifPalWorldSettings.ini
does not exist. This is the issue I am hitting: On existing installation the file already exists. So if a configuration parameter you're setting is not defined within the existing file (like in a Palworld version upgrade), it cannot be overwritten.
Oh so your request is bascially, ALWAYS copy the new default and change it?
So the current
sed -E -i
commands will not add configuration files toPalWorldSettings.ini
if they are not already defined in there. What I mean is figure out a way to reimplement these so that it inserts the configuration field at the end of the file, if it is not already defined.Here's an example of how it might be done for
Difficulty
(it can be turned into a function to reduce the amount of duplication):if grep "Difficulty=[a-zA-Z]*" "$GAME_SETTINGS_FILE" > /dev/null 2>&1; then sed -E -i "s/Difficulty=[a-zA-Z]*/Difficulty=$DIFFICULTY/" "$GAME_SETTINGS_FILE" else sed -E -i "s/)$/,Difficulty=$DIFFICULTY)/" "$GAME_SETTINGS_FILE" fi
I seed the code and see no difference, the values gets overwritten anyways, i dont see a change to what i have. Not sure what you want to do here. Sorry, maybe im blind or dumb, but i dont get it.
from docker-palworld-dedicated-server.
If you go a little further up to
includes/config.sh:39
, there is a condition set that it will only copy the file fromDefaultPalWorldSettings.ini
ifPalWorldSettings.ini
does not exist. This is the issue I am hitting: On existing installation the file already exists. So if a configuration parameter you're setting is not defined within the existing file (like in a Palworld version upgrade), it cannot be overwritten.Oh so your request is bascially, ALWAYS copy the new default and change it?
Not necessarily. I just thought this would be the easiest way to solve this issue. The disadvantage is that users cannot modify PalWorldSettings.ini
to manually add settings the container does not yet manage.
So the current
sed -E -i
commands will not add configuration files toPalWorldSettings.ini
if they are not already defined in there. What I mean is figure out a way to reimplement these so that it inserts the configuration field at the end of the file, if it is not already defined.
Here's an example of how it might be done forDifficulty
(it can be turned into a function to reduce the amount of duplication):if grep "Difficulty=[a-zA-Z]*" "$GAME_SETTINGS_FILE" > /dev/null 2>&1; then sed -E -i "s/Difficulty=[a-zA-Z]*/Difficulty=$DIFFICULTY/" "$GAME_SETTINGS_FILE" else sed -E -i "s/)$/,Difficulty=$DIFFICULTY)/" "$GAME_SETTINGS_FILE" fiI seed the code and see no difference, the values gets overwritten anyways, i dont see a change to what i have. Not sure what you want to do here. Sorry, maybe im blind or dumb, but i dont get it.
So here I'm proposing an alternative to "ALWAYS copy the new default and change it", as explained above.
Here is the current implementation for the DIFFICULTY
setting, as shown in develop:includes/config.sh:50-53
:
if [[ -n ${DIFFICULTY+x} ]]; then
e "> Setting Difficulty to '$DIFFICULTY'"
sed -E -i "s/Difficulty=[a-zA-Z]*/Difficulty=$DIFFICULTY/" "$GAME_SETTINGS_FILE"
fi
In this alternative solution, I'm proposing we could change it (effectively) to:
if [[ -n ${DIFFICULTY+x} ]]; then
e "> Setting Difficulty to '$DIFFICULTY'"
if grep "Difficulty=[a-zA-Z]*" "$GAME_SETTINGS_FILE" > /dev/null 2>&1; then
# If the `Difficulty` field already exists in `PalWorldSettings.ini`, overwrite it.
sed -E -i "s/Difficulty=[a-zA-Z]*/Difficulty=$DIFFICULTY/" "$GAME_SETTINGS_FILE"
else
# If the `Difficulty` field does not exist in `PalWorldSettings.ini`, add it to the end of the file.
sed -E -i "s/)$/,Difficulty=$DIFFICULTY)/" "$GAME_SETTINGS_FILE"
fi
fi
This makes the code more complicated (we can simplify this using functions), but it would fix the issue while also preserving the ability for users to manually add fields to the file.
from docker-palworld-dedicated-server.
I'm fine with any solution you're happy with, I just wanted to propose some things and hear your thoughts.
from docker-palworld-dedicated-server.
I'm fine with any solution you're happy with, I just wanted to propose some things and hear your thoughts.
Yeah sure im all ears for that.
I added now copy Default to location and sed-search-and-replace.
Your version for modifications in a manual way we have covered, its manual mode, there the script doesnt do anything.
I think thats a solid base, both version are supported and the "config.sh" doesnt become a nightmare because of insane complexity.
Im open to later feedback, but lets go with this first.
from docker-palworld-dedicated-server.
Related Issues (20)
- [Bug Report] Player join/left issue with character creation HOT 1
- [Bug Report] Player join/leave cannot have commas in name HOT 1
- [Bug Report] Player join/leave doesn't work with players of the same name HOT 1
- [Bug Report] Crash Loop (LowLevelFatalError) HOT 4
- [Feature Request] Automatic Restart should not wait 15 minutes when no player is on the server
- [Bug Report] RCON Port setting change in 1.50 HOT 6
- [Bug Report] Error when auto restart HOT 3
- docker部署后无法正常使用RCON,cli: execute: auth: rcon: dial tcp: lookup tcp/###RCON_PORT###:unknown port HOT 6
- [Feature Request] Make gosu-binary building more transparent
- [Bug Report] Log file consumes all remaining HDD space associated with Docker system HOT 3
- [Feature Request] Implement server OoM crash detection and restart HOT 2
- [Bug Report] RCON Log gets cut off
- [Bug Report] New alias for rconcli with timestamp
- [Bug Report] After docker container update Server failed to start with permission denied HOT 11
- [Bug Report] Container backups also backup the Palworld built-in backups HOT 1
- [Bug Report] Automatic Restart stopped working HOT 2
- [Question] 您好,我在游戏中,会接受到容器显示的备份 通知,我想询问下这个备份通知能否不在游戏内显示,可以在容器日志中 HOT 3
- [Feature Request] use semantic versioning HOT 7
- [Bug Report] No config found, generating one HOT 3
- [Bug Report] Your descriptive title here! HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-palworld-dedicated-server.