[Client+Server] Deck version history with restore

This commit is contained in:
Lukas Brübach 2026-10-11 17:10:01 +02:00
parent 875e87d1bc
commit 44f57aa2b9
17 changed files with 437 additions and 0 deletions

View file

@ -16,6 +16,7 @@ set(PROTO_FILES
command_deck_del_dir.proto
command_deck_download.proto
command_deck_download_public.proto
command_deck_history_list.proto
command_deck_list.proto
command_deck_list_other_user.proto
command_deck_new_dir.proto
@ -147,6 +148,7 @@ set(PROTO_FILES
response_ban_history.proto
response_card_art_rule_entry.proto
response_deck_download.proto
response_deck_history_list.proto
response_deck_list.proto
response_deck_share_create.proto
response_deck_share_download.proto

View file

@ -0,0 +1,12 @@
syntax = "proto2";
import "session_commands.proto";
message Command_DeckHistoryList {
extend SessionCommand {
optional Command_DeckHistoryList ext = 1035;
}
optional sint32 deck_id = 1 [default = -1];
// Maximum versions to return, newest first. Capped server-side by
// deck_sync/max_versions.
optional uint32 limit = 2 [default = 20];
}

View file

@ -86,6 +86,7 @@ message Response {
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
DECK_HISTORY_LIST = 1108; // Response listing deck versions
CARD_ART_RULE_LIST = 1200; // Response containing a list of card art rules
}

View file

@ -0,0 +1,19 @@
syntax = "proto2";
import "response.proto";
message DeckVersionInfo {
optional uint32 version_no = 1;
optional uint64 created_at = 2;
optional string created_by_clientid = 3;
optional string hash = 4;
// Full deck content in native format, so the client can diff and
// restore without further round trips.
optional string content = 5;
}
message Response_DeckHistoryList {
extend Response {
optional Response_DeckHistoryList ext = 1108;
}
repeated DeckVersionInfo versions = 1;
}

View file

@ -38,6 +38,7 @@ message SessionCommand {
DECK_SHARE_REMOVE = 1033;
SUBMIT_PASSWORD_VERIFIER = 1034;
DECK_SYNC_CHECK = 1035;
DECK_HISTORY_LIST = 1036;
REPLAY_LIST = 1100;
REPLAY_DOWNLOAD = 1101;
REPLAY_MODIFY_MATCH = 1102;