Replays from older builds cause crash #532

Closed
opened 2025-01-15 15:27:45 +00:00 by NQNStudios · 3 comments
NQNStudios commented 2025-01-15 15:27:45 +00:00 (Migrated from github.com)

34dd31cf51 removed 3 preferences. Replays created with builds prior to 34dd31cf51 have 3 extra preferences in their recorded load_prefs, and these cause a crash in new builds.

The quick-and-dirty solution to make those replays work, is to delete those 3 lines in the action log xml, as I have done for #479.

But it would be more preferable if the replay system could skip obsolete preferences in a load_prefs, and vice-versa, I should make sure that new preferences can be missing from a load_prefs element without causing a crash. (They'd be treated as the default in that case.)

34dd31cf51f5307025c9e08074483fdc038c7040 removed 3 preferences. Replays created with builds prior to 34dd31cf51f5307025c9e08074483fdc038c7040 have 3 extra preferences in their recorded `load_prefs`, and these cause a crash in new builds. The quick-and-dirty solution to make those replays work, is to delete those 3 lines in the action log xml, as I have done for #479. But it would be more preferable if the replay system could skip obsolete preferences in a `load_prefs`, and vice-versa, I should make sure that *new* preferences can be missing from a `load_prefs` element without causing a crash. (They'd be treated as the default in that case.)
CelticMinstrel commented 2025-01-16 03:40:58 +00:00 (Migrated from github.com)

load_prefs() should just ignore any preferences it doesn't recognize, optionally logging a warning. I don't think there's any need to preserve the unknown preferences either.

I assume this only affects Windows and Linux, right? Since Mac uses the defaults system for its preferences, and the plist already contains preferences that the game doesn't directly recognize (for example, I believe the file dialogs automatically store the last visited directory in the same plist).

`load_prefs()` should just ignore any preferences it doesn't recognize, optionally logging a warning. I don't think there's any need to preserve the unknown preferences either. I assume this only affects Windows and Linux, right? Since Mac uses the defaults system for its preferences, and the plist _already_ contains preferences that the game doesn't directly recognize (for example, I believe the file dialogs automatically store the last visited directory in the same plist).
NQNStudios commented 2025-01-16 17:35:10 +00:00 (Migrated from github.com)

It affects Mac too because it's indexing prefsToRecord for nonexistent type parsing hints which lead to a bad_lexical_cast, but I have this fixed in a dev branch.

It affects Mac too because it's indexing prefsToRecord for nonexistent type parsing hints which lead to a `bad_lexical_cast`, but I have this fixed in a dev branch.
NQNStudios commented 2025-01-16 17:54:39 +00:00 (Migrated from github.com)

In fact, this was mac-specific.

In fact, this was mac-specific.
Sign in to join this conversation.
No description provided.