[Client+Server] Auto deck sync with change polling

This commit is contained in:
Lukas Brübach 2026-10-11 17:02:30 +02:00
parent dcccb0f332
commit e73fcd602c
18 changed files with 448 additions and 18 deletions

View file

@ -26,6 +26,7 @@ set(PROTO_FILES
command_deck_share_list.proto
command_deck_share_list_mine.proto
command_deck_share_remove.proto
command_deck_sync_check.proto
command_deck_upload.proto
command_del_counter.proto
command_delete_arrow.proto
@ -151,6 +152,7 @@ set(PROTO_FILES
response_deck_share_download.proto
response_deck_share_list.proto
response_deck_share_list_mine.proto
response_deck_sync_status.proto
response_deck_upload.proto
response_dump_zone.proto
response_forgotpasswordrequest.proto

View file

@ -0,0 +1,11 @@
syntax = "proto2";
import "session_commands.proto";
message Command_DeckSyncCheck {
extend SessionCommand {
optional Command_DeckSyncCheck ext = 1034;
}
// Seconds since Unix epoch of the client's last completed sync.
// 0 means "never synced": the server reports every stored row.
optional uint64 last_sync_time = 1 [default = 0];
}

View file

@ -85,6 +85,7 @@ message Response {
DECK_SHARE_LIST = 1104; // Response listing shared decks
DECK_SHARE_DOWNLOAD = 1105; // Response for shared deck download
DECK_SHARE_LIST_MINE = 1106; // Response listing the caller's own shares
DECK_SYNC_STATUS = 1107; // Response with changed decks since a timestamp
CARD_ART_RULE_LIST = 1200; // Response containing a list of card art rules
}

View file

@ -0,0 +1,21 @@
syntax = "proto2";
import "response.proto";
message DeckSyncChangedFile {
// Server-relative folder path without file extension, e.g. "Modern/Affinity".
optional string path = 1;
optional uint32 deck_id = 2;
optional string guid = 3;
optional string hash = 4;
optional uint64 last_modified = 5;
optional bool deleted = 6 [default = false];
}
message Response_DeckSyncStatus {
extend Response {
optional Response_DeckSyncStatus ext = 1107;
}
repeated DeckSyncChangedFile changed_files = 1;
// Server clock at query time; the client adopts it as its sync baseline.
optional uint64 server_time = 2;
}

View file

@ -37,6 +37,7 @@ message SessionCommand {
DECK_SHARE_LIST_MINE = 1032;
DECK_SHARE_REMOVE = 1033;
SUBMIT_PASSWORD_VERIFIER = 1034;
DECK_SYNC_CHECK = 1035;
REPLAY_LIST = 1100;
REPLAY_DOWNLOAD = 1101;
REPLAY_MODIFY_MATCH = 1102;