Repository navigation
0.6.0: обновление игры со страницы игры, с сохранением сейвов, настроек и ярлыка Steam - #11
Merged
Merged
Conversation
…hortcut A new "Update the game" card takes a link (direct, Mega file, Yandex Disk, Google Drive) or a file from the device. The download or upload is an ordinary job marked as an update: finish() hands it to gameupdate.stage_update, which unpacks it (remembered passwords and the job's password prompt work as for any archive) into <folder above the game>/.deckdrop-updates/stage-<token> instead of making a new game, and the job ends as "update_ready". The game page then shows what applying would do before anything changes: new and replaced files, which exe Steam will start, save files the new version ships that stay the user's, settings files that differ, old files the new version lacks. The archive is lined up with the game by the path of the exe Steam starts, so an extra folder level lands right. Applying keeps the game folder, so the shortcut and its app id stay and with them the Proton prefix (where most games keep saves and settings), name, Proton, artwork and layout. A renamed exe gets the same shortcut (SetShortcutExe live, or a pending "exe" op until Steam control is on) and DeckDrop's record follows it. Inside the game, files in save folders are never replaced, settings files (*.ini, *.cfg, config.json, ...) are kept unless unticked, and old-only files stay unless "clear" is ticked (saves and kept settings stay even then). Everything replaced or cleared is moved into .deckdrop-updates/<game>/ with a manifest, so the last update can be rolled back; "delete the old files" frees it. Nothing is applied while a process runs inside the game folder. Unapplied stages are removed at start; deleting a game removes its update leftovers too. tests/test_game_update.py runs the server on a throwaway game added to Steam: saves and settings survive, settings are replaced when asked, cleanup moves old files aside but not saves, a renamed exe keeps the app id and Proton, a deeper archive lines up, nothing happens while the game runs or after discarding, an update by link works, and rollback restores the old files while keeping saves made since. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0117oG9pVCiLVdgdzWJT9nJH
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Что сделано
На странице игры появилась карточка «Обновление игры»: ссылка на новую версию (прямая, файл Mega, Яндекс.Диск, Google Drive) или файл с телефона/ПК.
<папка над игрой>/.deckdrop-updates/stage-<token>. Запомненные пароли и запрос пароля работают как для любого архива. Задача заканчивается статусом «новая версия распакована» с кнопкой «открыть игру».Обновляется всё содержимое новой версии (данные, ресурсы, библиотеки, exe), поверх старой.
Почему сейвы и настройки не ломаются
Game-1.2.exe→Game-1.3.exe), тот же ярлык переключается на новый (SetShortcutExeсразу или отложенная операцияexe, пока нет управления Steam); запись DeckDrop переезжает вместе с ним.saves,savedata,Saved…) никогда не заменяются.*.ini,*.cfg,config.json…) по умолчанию остаются пользовательскими.Game-1.3-pc/…) ложится правильно..deckdrop-updates/<игра>/сmanifest.json, поэтому последнее обновление откатывается одной кнопкой; сейвы, сделанные после него, остаются. «Удалить старые файлы» освобождает место.Изменения в коде
src/deckdrop/gameupdate.py.archives.finishпередаёт задачи-обновления вstage_update;Jobполучил полеupdate;start_downloadпринимаетupdateиroot(загрузка идёт на диск игры).POST /api/game/update/link,PUT /api/game/update/upload,GET /api/game/update,POST /api/game/update/{apply,discard,rollback,drop_backup}.exeвsteam/shortcuts.py.Ограничения
Extras/рядом) не копируются, превью об этом не предупреждает.Проверка
tests/test_game_update.py(10 сценариев): сейвы и настройки сохраняются; настройки заменяются, если снять галочку; «убрать» не трогает сейвы; переименованный exe сохраняет AppID и Proton; архив с лишней папкой ложится правильно; при запущенной игре и после отмены ничего не меняется; обновление по ссылке; откат возвращает старые файлы, сохраняя новые сейвы.tools/changelog.py --check, сборка, все юнит-тесты (включаяtest_user_data.py), smoke из исходников и собранного файла,tests/ui_check.pyна обоих языках.🤖 Generated with Claude Code
https://claude.ai/code/session_0117oG9pVCiLVdgdzWJT9nJH
Generated by Claude Code