From 9ee1431aab766302e0fdc80b2e03253339eb6461 Mon Sep 17 00:00:00 2001 From: Aaron Kimbrell Date: Tue, 29 Sep 2026 09:22:59 -0500 Subject: [PATCH] feat(master): say which folder setting is wrong at startup (issue 1113) Master stops with a message naming client_location, its value and the folder it resolves to when that folder doesn't exist, instead of failing later on missing client files; a missing dump_folder gets a warning. Check: set client_location to a folder that doesn't exist: master says so and stops. Co-Authored-By: Claude Opus 5.5 --- dMasterServer/MasterServer.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dMasterServer/MasterServer.cpp b/dMasterServer/MasterServer.cpp index 03c169321..0178100a6 100644 --- a/dMasterServer/MasterServer.cpp +++ b/dMasterServer/MasterServer.cpp @@ -263,6 +263,14 @@ int main(int argc, char** argv) { clientPath = BinaryPathFinder::GetBinaryDir() / clientPath; } + // Say which setting is wrong instead of failing later on missing client files + std::error_code ec; + if (!std::filesystem::is_directory(clientPath, ec)) { + LOG("client_location is \"%s\", which is %s, and that folder doesn't exist. Set client_location in sharedconfig.ini to your client's folder (the one with res/, or the one with client/ and versions/).", + clientPathStr.c_str(), clientPath.string().c_str()); + return EXIT_FAILURE; + } + Game::assetManager = new AssetManager(clientPath); } catch (std::runtime_error& ex) { LOG("Got an error while setting up assets: %s", ex.what()); @@ -270,6 +278,14 @@ int main(int argc, char** argv) { return EXIT_FAILURE; } + // Crash dumps are only written where the folder exists + if (const auto dumpFolder = Game::config->GetValue("dump_folder"); !dumpFolder.empty()) { + std::filesystem::path dumpPath(dumpFolder); + if (dumpPath.is_relative()) dumpPath = BinaryPathFinder::GetBinaryDir() / dumpPath; + std::error_code ec; + if (!std::filesystem::is_directory(dumpPath, ec)) LOG("dump_folder is \"%s\", which is %s, and that folder doesn't exist; crash dumps won't be written until it does.", dumpFolder.c_str(), dumpPath.string().c_str()); + } + MigrationRunner::RunMigrations(); // Settings edited on the dashboard (server_config table) are layered over the files from here on Game::config->SetDatabaseSync(ConfigSync::Sync);