Skip to content

Conversation

@doctorjei
Copy link

No description provided.

@doctorjei doctorjei closed this Apr 4, 2021
@doctorjei doctorjei reopened this Apr 4, 2021
Copy link
Owner

@ryansheehan ryansheehan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am going to be honest, in that i've spent far less time learning the vanilla server switches as I have spent maintaining the TShock version over the years. I have some concerns with how this bootstrapper is defined, and the world argument is always present.

#!/usr/bin/env bash

if [ -z "$WORLD_FILENAME" ]; then
/terraria-server/TerrariaServer -world $@
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I havent tried to execute this code yet, but if I am reading this correctly, if the $WORLD_FILENAME is null, then why would we specify the world flag without a value?

if [ -z "$WORLD_FILENAME" ]; then
/terraria-server/TerrariaServer -world $@
else
/terraria-server/TerrariaServer -world $CONFIGPATH/$WORLD_FILENAME $@
Copy link
Owner

@ryansheehan ryansheehan Apr 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the intent is that worlds are volumed in the /root/.local/share/Terraria/Worlds path where the executable defaults saving world files. Is the intent that the configuration data lives side-by-side with the world file on the host machine?

Making this change would force users through the bootstrapper. If they do not have a world file how would that work? They would have to volume in the directory to save the data and then copy the data to where they store their config.

Copy link
Author

@doctorjei doctorjei Apr 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops! You're right, I shouldn't have the "-world" on line 4. I can fix that.

The goal was to make it so that the bootstrapper is a pass-through if WORLD_FILENAME is not defined. I.e., if they do not define WORLD_FILENAME, it should just call "/terraria-server/TerrariaServer $@" (which should still work if the users append "-world somefile.wld").

With respect to the CONFIGPATH, this is really meant to sync up with the tshock version (which defaults to the world path - "ENV CONFIGPATH=/root/.local/share/Terraria/Worlds"). I actually moved over from the tshock version to vanilla (due to the most recent Terraria update), so my goal was to sync up with that. Alternatively, I could add another "WORLDPATH" variable if we wanted to separate the world and configuration paths.

The overall goal was to try avoiding the necessity of hardcoding world file paths into the entrypoint / command, but to do so by using an abstraction that might be helpful in the future (by adding a thin wrapper around the vanilla server launcher).

Fixed bug when no WORLD_FILENAME is provided
@doctorjei
Copy link
Author

@ryansheehan, just checking on this. :) The "-world" error should be fixed now.

@doctorjei doctorjei closed this Jun 20, 2021
@doctorjei doctorjei deleted the branch ryansheehan:master June 20, 2021 13:36
@doctorjei doctorjei deleted the master branch June 20, 2021 13:36
@doctorjei doctorjei restored the master branch June 20, 2021 13:37
@doctorjei doctorjei reopened this Jun 20, 2021
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.

2 participants