Closed sariyamelody closed 9 years ago
It seems like the issue is that -worldpath
and -world
are no longer respected. Because of this, the container was not able to know that TShock wanted the files to live in /home/terraria/My Games/Terraria/Worlds
, and so it simply failed with a cryptic error.
Reproduction steps:
-worldpath
parameter that is non-default (e.g. your current directory!)-worldpath
parameter directory~/My Games/Terraria/Worlds
Is there any way to support the -worldpath
command line option again?
lol ignore the above it was stupid
Anyways, there's an actual issue in which the server will crash in two circumstances:
-world
is specified and there is nothing there, even if there -autocreate
is specified$HOME/My Games/Terraria/favorites.json
cannot be created(2) is a problem in my specific case because I'm not running it in a "normal desktop linux environment" but as a daemon run in Docker in a limited container that does not have a home directory for the user that mono
(and, by extension, TerrariaServer.exe
) are being run under. It would be really nice if favorites.json
was defaulted to being searched for in the configpath
instead, as that's where I'd expect to be able to edit a json
file.
the simplest repro possible for (1) above is:
Windows:
$ rm test.wld
$ TerrariaServer.exe -autocreate 3 -world test.wld
Linux:
$ mono --server --gc=sgen -O=all TerrariaServer.exe -world test.wld -autocreate 3
(argument order does not matter)
current workaround:
$HOME/My Games/Terraria/
must exist and be editable by the user that the server will be run by
the world you want to run must exist, or must be manually created in the GUI (-autocreate will not work if you specify -world)
Suggestion: Add command line flag for config path or change its default path.
@Ijwu there is actually -configpath
which defaults to the directory of TerrariaServer.exe
, I believe
src: https://tshock.atlassian.net/wiki/display/TSHOCKPLUGINS/Command+Line+Parameters
I just spent an hour or so debugging. I'm not sure how to resolve this either. This is caused when the server enters the DedServer() code path, and nulls out because for some reason it tries to read the difficulty of the world from the non-existent world.
this.Initialize();
Lang.setLang(false);
for (int i = 0; i < 540; i++)
{
NPC nPC = new NPC();
nPC.SetDefaults(i, -1f);
Main.npcName[i] = nPC.name;
}
I'm not sure where a good place to put that code is, and I'm not sure a good way around it.
sorry for weird formatting, I grabbed this straight from
docker logs
running on what is effectively latest Ubuntu, Dockerfile is https://github.com/skyhighwings/dockerfiles/blob/master/games/terraria-tshock/Dockerfile and start script is https://github.com/skyhighwings/dockerfiles/blob/master/games/terraria-tshock/start-service
for convenience, the start script: