From bb9fa9f170c30538396854f309febeedca78d34e Mon Sep 17 00:00:00 2001 From: user Date: Tue, 4 Jun 2024 12:17:08 +0200 Subject: [PATCH] Plan out further migration steps --- backend/src/api/handler.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/backend/src/api/handler.rs b/backend/src/api/handler.rs index 22ab7b5..e1e155a 100644 --- a/backend/src/api/handler.rs +++ b/backend/src/api/handler.rs @@ -505,6 +505,15 @@ impl ApiMessageHandler { false } ApiMessage::LoadSettings(id, name, variant_id, variant_name) => { + /* Migration steps: + 1. Modify to the frontend to send the game ID in this message (`id` here is the app + ID). + 2. Change game ID to app ID. + 3. (Create and) call function to merge OldSettingsJson with existing FileJson, or + use existing `From for FileJson` if this game doesn't have a + save in the new format yet. + 4. Let the rest of the code below work its magic. + */ let path = format!("{}.ron", id); if let Err(e) = settings.on_unload() { print_errors("LoadSettings on_unload()", e);