1.4.2: проверка версии игры и хранилище, которое не стирается

Повод: 1.4.1 на игре 3.3.0 experimental не смогла прочитать Пространственное
хранилище (Bag переписан) и при сохранении записала пустой маркер - вещи
пропали навсегда.

GameVersionGuard: версия из Constants.cVersionInformation (не из const
cVersionMinor - та вшивается в DLL), поддерживается Major 3 и Minor/10 == 2,
то есть любая 3.2.x. На другой версии в главном меню окно «мод несовместим,
обновите» с единственной кнопкой «Выйти из игры» (решение пользователя), а
вместо PatchAll ставятся по отдельности только окно и четыре патча
сохранения хранилища. Всё, чем пользуется защита, сверено с декомпиляцией 3.3.

Хранилище: непрочитанные байты (чужая версия или упавший разбор) проходят
Read -> ToPlayer -> FromPlayer -> Write нетронутыми, ключ - entityId, сброс
при открытии главного меню (последнее сохранение игрока делается раньше,
внутри SaveAndCleanupWorld - проверено по коду игры). Пока байты не
прочитаны, хранилище не открывается и не пополняется, с подсказкой.

Проверено в игре на 3.2 через отладочные файлы FORCE_VAULT_UNREAD и
FORCE_VERSION_GUARD (в .gitignore, в архив не попадают): 603 байта
хранилища прошли сохранение и прочитались обратно совпадающими с исходными
(26 ячеек, 24 предмета); окно появляется, Esc его не закрывает, кнопка
закрывает игру. На настоящей 3.3 не проверено.

Localization: 4 новых ключа на 13 языках, всего 165; README - статус и
число ключей (было 149).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
AlexCube
2026-09-25 00:09:01 +03:00
co-authored by Claude Opus 5.5
parent 77b56be9ae
commit f4470b784f
13 changed files with 296 additions and 6 deletions
+4
View File
@@ -0,0 +1,4 @@
NEW: the mod now checks the game version at start. This build is for 7 Days to Die 3.2.x; on any other version (3.3 experimental included) the main menu shows a window saying the mod is incompatible and asking you to update it, with a single Quit game button. This is to stop what happened with 1.4.1 on 3.3: the Spatial Vault could not be read there and was saved empty, so its items were lost.
NEW: the Spatial Vault can no longer be wiped by a version it cannot read. If its saved contents cannot be read, they are kept untouched and written back byte for byte on every save, and the vault stays closed with a message instead of opening empty. Installing the right build of the mod brings the items back.
The new window and the vault message are translated into all 13 languages of the mod.
Drop-in over 1.4.1, saves carry over. For game version 3.2 only; a 3.3 version will come separately. Single-player. The mod ships Harmony libraries, so EasyAntiCheat must be off.