mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-26 06:32:49 +00:00
feat(cdclient): make a new CDServer.sqlite off-thread and swap tables in place
CDClientSnapshot converts a copy of the client's fdb into its own CDServer-<hash>.sqlite with the cdserver migrations applied, on its own connection. CDClientDatabase::Reconnect opens the new file before letting go of the old one; CDClientManager::Reload empties every table (old entries kept alive so references from spawned objects stay valid), retires the old fdb view and loads again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -30,6 +30,12 @@ namespace CDFdb {
|
||||
bool Open(const std::filesystem::path& path, bool allowMapping = true);
|
||||
void Close();
|
||||
|
||||
/**
|
||||
* Closes the fdb for a CDClient reload, but keeps its view open until the next Retire, so a row or table pointer
|
||||
* handed out before the reload still reads from memory that is there. Only the latest retired fdb is kept.
|
||||
*/
|
||||
void Retire();
|
||||
|
||||
// The open fdb, or nullptr
|
||||
const FdbReader* Get();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user