Sfoglia il codice sorgente

Adding back the "game" specialization tag to the SettingsRegistryBuilder (#16191)

Also adding a "launcher" specialization tag to the Settings Registry
Builder.

The tags are used to merge *.setreg and *.setregpatch files that
contains a sequence of `*.<tag-name>.*` as part of the filename.

This will fix the issue with the streamer.game.setreg files not being
merged into the aggregate `bootstrap.<launcher>.<config>.setreg` files.

Signed-off-by: lumberyard-employee-dm <[email protected]>
lumberyard-employee-dm 2 anni fa
parent
commit
5f9a5f98ab

+ 3 - 0
Code/LauncherUnified/Launcher.cpp

@@ -129,6 +129,7 @@ namespace
 namespace O3DELauncher
 {
     inline constexpr AZStd::string_view LauncherTypeTag = "/O3DE/Runtime/LauncherType";
+    inline constexpr AZStd::string_view LauncherFilenameTag = "launcher";
 
     AZ_CVAR(bool, bg_ConnectToAssetProcessor, true, nullptr, AZ::ConsoleFunctorFlags::DontReplicate, "If true, the process will launch and connect to the asset processor");
 
@@ -418,6 +419,8 @@ namespace O3DELauncher
         settingsRegistry->Set(LauncherTypeTag, launcherType);
         // Also add the launcher type as a specialization as well
         AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddSpecialization(*settingsRegistry, launcherType);
+        // Finally add the "launcher" specialization tag into the Settings Registry
+        AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddSpecialization(*settingsRegistry, LauncherFilenameTag);
 
         AZ_TracePrintf("Launcher", R"(Running project "%.*s")" "\n"
             R"(The project name has been successfully set in the Settings Registry at key "%s/project_name")"

+ 11 - 0
Code/Tools/AssetProcessor/native/InternalBuilders/SettingsRegistryBuilder.cpp

@@ -162,6 +162,17 @@ namespace AssetProcessor
         constexpr size_t LauncherTypeIndex = 0;
         constexpr size_t BuildConfigIndex = 1;
 
+        // Append the specialization filename tag of "launcher" get all the `<filename>.*.launcher.*.setreg` files
+        // to be merged into the aggregate Settings Registry
+        constexpr AZStd::string_view LauncherFilenameTag = "launcher";
+        for (AZ::SettingsRegistryInterface::FilenameTags& specialization : specializations)
+        {
+            specialization.Append(LauncherFilenameTag);
+            // Also add the "game" tag for backwards compatibility with any existing
+            // `<filename>.*.game.*.setreg` files
+            specialization.Append("game");
+        }
+
         // Add the project specific specializations
         auto projectName = AZ::Utils::GetProjectName();
         if (!projectName.empty())

+ 0 - 0
Registry/Platform/Windows/streamer.game.debug.setreg → Registry/Platform/Windows/streamer.launcher.debug.setreg


+ 0 - 0
Registry/Platform/Windows/streamer.game.profile.setreg → Registry/Platform/Windows/streamer.launcher.profile.setreg


+ 0 - 0
Registry/Platform/Windows/streamer.game.setreg → Registry/Platform/Windows/streamer.launcher.setreg


+ 0 - 0
Registry/streamer.game.debug.setreg → Registry/streamer.launcher.debug.setreg


+ 0 - 0
Registry/streamer.game.profile.setreg → Registry/streamer.launcher.profile.setreg


+ 0 - 0
Registry/streamer.game.setreg → Registry/streamer.launcher.setreg