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

@@ -174,6 +174,17 @@ std::optional<FdbSnapshot::Current> FdbSnapshot::ReadCurrent(const std::filesyst
return current;
}
FdbSnapshot::Resolved FdbSnapshot::Resolve(const std::filesystem::path& dir) {
Resolved resolved{ dir / DEFAULT_SQLITE, {} };
const auto current = ReadCurrent(dir);
if (!current) return resolved;
std::error_code code;
if (!std::filesystem::is_regular_file(dir / current->sqlite, code) || !std::filesystem::is_regular_file(dir / current->fdb, code)) return resolved;
resolved.sqlite = dir / current->sqlite;
resolved.fdb = dir / current->fdb;
return resolved;
}
bool FdbSnapshot::WriteCurrent(const std::filesystem::path& dir, const Current& current) {
const auto temp = dir / TempName(CURRENT_FILE);
{