ryansheehan/terraria

Issue with most of GUI docker apps when trying to use existing world

akanistudio opened this issue · 4 comments

According to bootstrap.sh file and documentation I can add any variables for TerrariaServer.exe after docker run command:

#!/bin/sh

echo "\nBootstrap:\nconfigpath=$CONFIGPATH\nworldpath=$WORLDPATH\nlogpath=$LOGPATH\n"
echo "Copying plugins..."
cp -Rfv /plugins/* ./ServerPlugins

mono --server --gc=sgen -O=all TerrariaServer.exe -configPath "$CONFIGPATH" -worldpath "$WORLDPATH" -logpath "$LOGPATH" "$@" 

However my GUI docker hosting does not allow me to set custom commands, I can only add environment variables like $CONFIGPATH, $WORLDPATH, $LOGPATH.

Could you please add $WORLD variable with the name of the world as well? Like:
mono --server --gc=sgen -O=all TerrariaServer.exe -configPath "$CONFIGPATH" -worldpath "$WORLDPATH" -logpath "$LOGPATH" -world "$WORLD" "$@"

That would fix my issue.

I agree with this. I guess you can fork it, modify it, and then make a pull request.

Eventually config file path in env variables would do as well.

EDIT: Ye I could, but its kinda hard to test it on my side since I don't have any other docker atm except GUI one.

Aight, I created pull request for it, but the only test I did was checking on steam version of game if
TerrariaServer.exe -world "" works, and seems like leaving variable empty will work fine if someone dont wanna load world but create new one.

I added WORLD_FILENAME environment variable that can be used in place of the -world flag in the latest release. Forewarning though, TShock removed the -worldpath flag so the volume mount has changed from /world to /root/.local/share/Terraria/Worlds

The WORLD_FILENAME is just the file name of the world inside the mounted directory.