feat(cdclient): servers open master's fdb copy, never the client's file

Worlds, the UGC server and the dashboard open the pair named in
resServer/cdclient-current (CDServer.sqlite without an fdb when there is
none). Worlds switch to a new pair on CDCLIENT_RELOAD between frames.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-29 23:19:55 -05:00
parent b05b84ff30
commit 1f87b2557d
6 changed files with 70 additions and 6 deletions

View File

@@ -62,6 +62,17 @@ namespace FdbSnapshot {
std::optional<Current> ReadCurrent(const std::filesystem::path& dir);
/**
* The files a server opens at startup: the pair the pointer file names, when both are there, or CDServer.sqlite
* and no fdb (never the client's own file).
*/
struct Resolved {
std::filesystem::path sqlite;
std::filesystem::path fdb; // empty: read CDServer.sqlite only
};
Resolved Resolve(const std::filesystem::path& dir);
// Writes the pointer file under a temporary name and renames it over the old one (it is never held open)
bool WriteCurrent(const std::filesystem::path& dir, const Current& current);