Sfoglia il codice sorgente

Enable activity SDK generation when older settings omit its configuration

Settings files written by 0.3.2 predate core.activity_sdk_generation, and the
C++ default was false even though the bundled settings enable it. Without the
generated SDK the activity host cannot construct its roster, so upgraded
installations were stuck loading activities. Default the setting to true so an
omitted block generates the required metadata.

Files stamped with layout version 13 by the builds that shipped the block with
enabled false are corrected too: the layout version rises to 14 and the upgrade
replaces the whole activity_sdk_generation block with the bundled one. The block
is replaced rather than its enabled member because that member name is not
unique in the document, and the block replacement also covers the
lua_declarations default that version 13 turned on.
chnsw 3 giorni fa
parent
commit
5f0bac12eb

+ 1 - 1
Sunrise/resources/default_settings.json

@@ -1,5 +1,5 @@
 {
-  "version": 15,
+  "version": 16,
   "core": {
     "logging": {
       "debugger_sink": true,

+ 1 - 1
Sunrise/src/client/content/activity/activity_sdk_generation_worker.h

@@ -62,7 +62,7 @@ struct OfflineBuildResult final {
                                                void* progressContext,
                                                OfflineBuildResult& output) noexcept;
 
-/** Immutable boot policy for the live generator. Each output nothing reads is opt-in. */
+/** Immutable boot policy for the live generator. Its pack backs host roster mission seeds. */
 struct Policy final {
     bool enabled{};
     /** Writes the sdk/lua declaration tree, which no runtime loads. */

+ 4 - 4
Sunrise/src/core/settings/settings.h

@@ -13,10 +13,10 @@
 
 namespace sunrise::core::settings {
 
-/** Boot policy for the optional full-estate activity SDK generator. */
+/** Boot policy for generating the activity SDK required by host roster construction. */
 struct ActivitySdkGenerationSettings final {
-    /** Allows generation work to be requested. Off unless the settings file opts in. */
-    bool enabled{false};
+    /** On by default like the bundled file, so a file without this block still generates. */
+    bool enabled{true};
     /** Writes the sdk/lua declaration tree. On by default, and only runs when generation does. */
     bool luaDeclarations{true};
 };
@@ -26,7 +26,7 @@ struct ActivitySdkGenerationSettings final {
  * Raise it when a key is renamed, removed, changes meaning, or must take a new default. Adding a
  * key needs no raise, because a missing key already takes its default.
  */
-inline constexpr std::uint32_t kSettingsVersion = 15;
+inline constexpr std::uint32_t kSettingsVersion = 16;
 
 /** Parsed read-only process settings. */
 struct Settings {

+ 1 - 1
Sunrise/src/core/settings/settings_parser.cpp

@@ -111,7 +111,7 @@ bool Parser::core(Settings& output) noexcept {
     }
 }
 
-/** Parses the Core-owned, fail-closed activity SDK generation gate. */
+/** Parses the Core-owned activity SDK generation gate. Omitted members keep their defaults. */
 bool Parser::activity_sdk_generation_settings(ActivitySdkGenerationSettings& output) noexcept {
     if (!consume('{')) {
         return false;

+ 4 - 2
Sunrise/src/core/settings/settings_upgrade.cpp

@@ -39,14 +39,16 @@ constexpr std::array<ReplacedMember, 11> kReplacedMembers{{
     // Version 8 turned the flat payout list into rows filtered by rarity, gear class and
     // masterwork state.
     {"\"dismantle_rewards\"", 8},
-    // Version 13 turned these three on. A file that never carried them takes the new default; one
+    // Version 13 turned these two on. A file that never carried them takes the new default; one
     // that carried the old value is corrected here.
-    {"\"lua_declarations\"", 13},
     {"\"suppress_peer_relay\"", 13},
     {"\"activity_public_membership\"", 13},
     // Version 15 seeded the lore book unlock slots, so both banks take the new default.
     {"\"character_flags\"", 15},
     {"\"objective_values\"", 15},
+    // Version 16 turned generation on. The whole block is replaced, because "enabled" is not
+    // unique in the document. The block also carries the lua_declarations default of version 13.
+    {"\"activity_sdk_generation\"", 16},
 }};
 
 /** One renamed member, and the layout version that renamed it. */