mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 10:53:44 +00:00
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:
@@ -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);
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user