RobustToolbox
RobustToolbox copied to clipboard
Server fails to start when passed a directory with trailing slash in --data-dir
Previously, starting a packaged server with a --data-dir containing a trailing slash worked. Now, this causes maps to fail to load:
System.InvalidOperationException: This branch should never be reached. Path: /Maps/Test/dev_map.yml
at Robust.Shared.ContentPack.PathHelpers.SafeGetResourcePath(String baseDir, ResPath path) in RobustToolbox/Robust.Shared/ContentPack/PathHelpers.cs:line 88
Steps to Reproduce
- Check out space-station-14 fb22cefd8 and update engine submodule.
dotnet build- Compare running
./bin/Content.Server/Content.Server --data-dir /tmpwith./bin/Content.Server/Content.Server --data-dir /tmp/
You can also run Content.Packaging, get a ZIP, extract, and run Robust.Server with --data-dir. Because this doesn't load a map immediately, there is a latent fault when you try to start round and map loading fails.
Workaround
Don't pass directories with trailing slashes to --data-dir.
Likely regressed in d4f265c314.
both of the This branch should never be reached errors are infact reachable
the first one is very easy just have .. in any path, the other is trailing /