mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 17:43:23 -08:00
Fix ZeldaZach review for PR 7496: deck path in ctor, server-time baseline, single-query sync check
This commit is contained in:
parent
e73fcd602c
commit
8bb0a9b98a
6 changed files with 30 additions and 41 deletions
|
|
@ -299,11 +299,9 @@ void DeckSyncManager::syncNow()
|
|||
.modified = QFileInfo(absolutePath).lastModified()});
|
||||
}
|
||||
|
||||
if (!firstSyncRun && sidecar.lastSyncSecs > 0) {
|
||||
sendSyncCheck(sidecar.lastSyncSecs);
|
||||
return;
|
||||
}
|
||||
fetchFullList();
|
||||
// Always ask the server first: its server_time becomes the sync baseline,
|
||||
// so uploads racing the DeckList response cannot fall outside the window.
|
||||
sendSyncCheck(sidecar.lastSyncSecs);
|
||||
}
|
||||
|
||||
void DeckSyncManager::fetchFullList()
|
||||
|
|
@ -334,6 +332,9 @@ void DeckSyncManager::onCheckFinished(const Response &response, const CommandCon
|
|||
return;
|
||||
}
|
||||
const Response_DeckSyncStatus &status = response.GetExtension(Response_DeckSyncStatus::ext);
|
||||
if (status.has_server_time()) {
|
||||
pendingServerTime = static_cast<qint64>(status.server_time());
|
||||
}
|
||||
DeckSyncSidecar sidecar(sidecarPath);
|
||||
if (!sidecar.load()) {
|
||||
fetchFullList();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue