ropenttd / docker_openttd

🚂 OpenTTD in a container. Pure, plain, and simple.
GNU General Public License v3.0
35 stars 23 forks source link

config file overwritten on startup #20

Open FransTheekrans opened 1 year ago

FransTheekrans commented 1 year ago

Every time i startup the container my config files get overwritten. From looking at my mounted volumes,, the config files have been split up and changed location in the latest version from "/config" to "/config/.config". I couldn't find anything in the openttd documentation, but it seems to be happening.

openttd.cf and private,cfg are in ~/openttd Here is the log from a startup:

$ ~/openttd/.config$ docker run --name openttd -it -p 3979:3979/tcp -p 3979:3979/udp -v ~/openttd:/config:rw -e loadgame=xxx.sav" redditopenttd/openttd:latest
**No config file found: generating one**
Loading /config/save/xxx.sav
dbg: [net] Starting dedicated server, version 13.0
dbg: [net] Starting network
dbg: [net] Initializing UDP listeners
dbg: [net] Network online, multiplayer available
dbg: [net] Detected broadcast addresses:
dbg: [net]   0) 172.17.255.255
[2023-03-30 21:07:03] OpenTTD Game Console Revision 7 - 13.0
[2023-03-30 21:07:03] ------------------------------------
[2023-03-30 21:07:03] use "help" for more information.
[2023-03-30 21:07:03]
[2023-03-30 21:07:03] dbg: [net] Initializing UDP listeners
[2023-03-30 21:07:03] dbg: [net] Initializing UDP listeners
[2023-03-30 21:07:03] dbg: [net] Listening on 0.0.0.0:3979 (IPv4)
[2023-03-30 21:07:03] dbg: [net] Listening on 0.0.0.0:3979 (IPv4)
[2023-03-30 21:07:03] dbg: [net] Network revision name: 13.0
[2023-03-30 21:07:03] ‎*** Game still paused (manual, number of players)
[2023-03-30 21:07:04] dbg: [net] Connected to coordinator.openttd.org:3976
[2023-03-30 21:07:04] dbg: [net] Connected to stun.openttd.org:3975
[2023-03-30 21:07:07] dbg: [net] ----------------------------------------
[2023-03-30 21:07:07] dbg: [net] Your server is now registered with the Game Coordinator:
[2023-03-30 21:07:07] dbg: [net]   Game type:       Invite only
[2023-03-30 21:07:07] dbg: [net]   Connection type: Behind NAT
[2023-03-30 21:07:07] dbg: [net]   Invite code:     xxxxx
[2023-03-30 21:07:07] dbg: [net] ----------------------------------------

I suspect that changing line 7 in "entrypoint.sh" would resolve the issue:

_if [ ! -f /config/.config/openttd.cfg ]; then_
Dinth commented 8 months ago

I think there's a same/similar problem with last-autosave option. Docker log shows:

No config file found: generating one
ls: cannot access '/config/save/autosave/': No such file or directory
/config/save/autosave/ not found...

But the config exists in /config/.config/openttd.cfg and autosaves exist in /config/.local/share/save