From 0575843bcfa81a4c80c36630dc54ffb47fc169d9 Mon Sep 17 00:00:00 2001 From: Fran Colarich <56565104+fcolarich@users.noreply.github.com> Date: Tue, 19 Nov 2024 11:33:35 +0100 Subject: [PATCH 1/5] Added force realm change (#2809) --- .../DCL.UserInAppInitializationFlow.asmdef | 3 ++- .../RealUserInAppInitializationFlow.cs | 4 ++-- .../Scripts/ECS/SceneLifeCycle/Realm/IRealmNavigator.cs | 2 +- Explorer/Assets/Scripts/Global/Dynamic/RealmNavigator.cs | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Explorer/Assets/DCL/UserInAppInitializationFlow/DCL.UserInAppInitializationFlow.asmdef b/Explorer/Assets/DCL/UserInAppInitializationFlow/DCL.UserInAppInitializationFlow.asmdef index 02bc206c29..6270b68ac6 100644 --- a/Explorer/Assets/DCL/UserInAppInitializationFlow/DCL.UserInAppInitializationFlow.asmdef +++ b/Explorer/Assets/DCL/UserInAppInitializationFlow/DCL.UserInAppInitializationFlow.asmdef @@ -33,7 +33,8 @@ "GUID:3640f3c0b42946b0b8794a1ed8e06ca5", "GUID:f1eaef1b40a68e74cb90cbedebf57bbf", "GUID:8c4c611b27046bc4a848721d1fdd4a9f", - "GUID:4725c02394ab4ce19f889e4e8001f989" + "GUID:4725c02394ab4ce19f889e4e8001f989", + "GUID:e25ef972de004615a22937e739de2def" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/Explorer/Assets/DCL/UserInAppInitializationFlow/RealUserInAppInitializationFlow.cs b/Explorer/Assets/DCL/UserInAppInitializationFlow/RealUserInAppInitializationFlow.cs index bcf2fd234c..2ddc1d10be 100644 --- a/Explorer/Assets/DCL/UserInAppInitializationFlow/RealUserInAppInitializationFlow.cs +++ b/Explorer/Assets/DCL/UserInAppInitializationFlow/RealUserInAppInitializationFlow.cs @@ -119,8 +119,8 @@ public async UniTask ExecuteAsync(UserInAppInitializationFlowParameters paramete if (parameters.FromLogout) { - // If we are coming from a logout, we teleport the user to Genesis Plaza - var teleportResult = await realmNavigator.TryInitializeTeleportToParcelAsync(Vector2Int.zero, ct); + // If we are coming from a logout, we teleport the user to Genesis Plaza and force realm change to reset the scene properly + var teleportResult = await realmNavigator.TryInitializeTeleportToParcelAsync(Vector2Int.zero, ct, forceChangeRealm: true); // Restart livekit connection await roomHub.StartAsync().Timeout(TimeSpan.FromSeconds(10)); result = teleportResult.Success ? teleportResult : Result.ErrorResult(teleportResult.ErrorMessage); diff --git a/Explorer/Assets/Scripts/ECS/SceneLifeCycle/Realm/IRealmNavigator.cs b/Explorer/Assets/Scripts/ECS/SceneLifeCycle/Realm/IRealmNavigator.cs index c8e3b28c73..bc12ef63bb 100644 --- a/Explorer/Assets/Scripts/ECS/SceneLifeCycle/Realm/IRealmNavigator.cs +++ b/Explorer/Assets/Scripts/ECS/SceneLifeCycle/Realm/IRealmNavigator.cs @@ -28,7 +28,7 @@ UniTask TryChangeRealmAsync(URLDomain realm, CancellationToken ct, UniTask CheckRealmIsReacheableAsync(URLDomain realm, CancellationToken ct); UniTask TryInitializeTeleportToParcelAsync(Vector2Int parcel, CancellationToken ct, - bool isLocal = false); + bool isLocal = false, bool forceChangeRealm = false); UniTask InitializeTeleportToSpawnPointAsync(AsyncLoadProcessReport teleportLoadReport, CancellationToken ct, Vector2Int parcelToTeleport = default); diff --git a/Explorer/Assets/Scripts/Global/Dynamic/RealmNavigator.cs b/Explorer/Assets/Scripts/Global/Dynamic/RealmNavigator.cs index 8fc6a72ba5..9327f47010 100644 --- a/Explorer/Assets/Scripts/Global/Dynamic/RealmNavigator.cs +++ b/Explorer/Assets/Scripts/Global/Dynamic/RealmNavigator.cs @@ -278,7 +278,7 @@ private Result IsParcelInsideTerrain(Vector2Int parcel, bool isLocal, bool isGen } public async UniTask TryInitializeTeleportToParcelAsync(Vector2Int parcel, CancellationToken ct, - bool isLocal = false) + bool isLocal = false, bool forceChangeRealm = false) { ct.ThrowIfCancellationRequested(); @@ -286,7 +286,7 @@ public async UniTask TryInitializeTeleportToParcelAsync(Vector2Int parce if (!parcelCheckResult.Success) return parcelCheckResult; - if (!isLocal && !IsGenesisRealm()) + if (forceChangeRealm || (!isLocal && !IsGenesisRealm())) { var url = URLDomain.FromString(decentralandUrlsSource.Url(DecentralandUrl.Genesis)); return await TryChangeRealmAsync(url, ct, parcel); From 6025938f2d1e08222c745a99429d3415f8da1e59 Mon Sep 17 00:00:00 2001 From: Ashley Canning Date: Tue, 19 Nov 2024 10:35:11 +0000 Subject: [PATCH 2/5] chore: add realm info to diagnostics (#2823) * Add realm info to sentry diagnostics * Move to RealUserInAppInitializationFlow.csn --- .../Sentry/SentryReportHandler.cs | 7 ++++ .../RealUserInAppInitializationFlow.cs | 7 ++-- .../SentryDiagnosticStartupOperation.cs | 35 +++++++++++++++++++ .../SentryDiagnosticStartupOperation.cs.meta | 3 ++ .../Global/Dynamic/DynamicWorldContainer.cs | 3 +- 5 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 Explorer/Assets/DCL/UserInAppInitializationFlow/StartupOperations/SentryDiagnosticStartupOperation.cs create mode 100644 Explorer/Assets/DCL/UserInAppInitializationFlow/StartupOperations/SentryDiagnosticStartupOperation.cs.meta diff --git a/Explorer/Assets/DCL/PerformanceAndDiagnostics/Diagnostics/ReportsHandling/Sentry/SentryReportHandler.cs b/Explorer/Assets/DCL/PerformanceAndDiagnostics/Diagnostics/ReportsHandling/Sentry/SentryReportHandler.cs index 65234766a4..c85fa07eb0 100644 --- a/Explorer/Assets/DCL/PerformanceAndDiagnostics/Diagnostics/ReportsHandling/Sentry/SentryReportHandler.cs +++ b/Explorer/Assets/DCL/PerformanceAndDiagnostics/Diagnostics/ReportsHandling/Sentry/SentryReportHandler.cs @@ -52,6 +52,13 @@ public void AddCurrentSceneToScope(Scope scope, SceneShortInfo sceneInfo) scope.SetTag("current_scene.name", sceneInfo.Name); } + public void AddRealmInfoToScope(Scope scope, string baseCatalystUrl, string baseContentUrl, string baseLambdaUrl) + { + scope.SetTag("base_catalyst_url", baseCatalystUrl); + scope.SetTag("base_content_url", baseContentUrl); + scope.SetTag("base_lambda_url", baseLambdaUrl); + } + public void AddScopeConfigurator(ConfigureScope configureScope) { scopeConfigurators.Add(configureScope); diff --git a/Explorer/Assets/DCL/UserInAppInitializationFlow/RealUserInAppInitializationFlow.cs b/Explorer/Assets/DCL/UserInAppInitializationFlow/RealUserInAppInitializationFlow.cs index 2ddc1d10be..c7bed243fc 100644 --- a/Explorer/Assets/DCL/UserInAppInitializationFlow/RealUserInAppInitializationFlow.cs +++ b/Explorer/Assets/DCL/UserInAppInitializationFlow/RealUserInAppInitializationFlow.cs @@ -58,7 +58,8 @@ public RealUserInAppInitializationFlow( IAppArgs appParameters, IDebugSettings debugSettings, IPortableExperiencesController portableExperiencesController, - IRoomHub roomHub + IRoomHub roomHub, + DiagnosticsContainer diagnosticsContainer ) { this.loadingStatus = loadingStatus; @@ -78,6 +79,7 @@ IRoomHub roomHub restartRealmStartupOperation = new RestartRealmStartupOperation(loadingStatus, realmController); var teleportStartupOperation = new TeleportStartupOperation(loadingStatus, realmNavigator, startParcel); var loadGlobalPxOperation = new LoadGlobalPortableExperiencesStartupOperation(loadingStatus, selfProfile, featureFlagsCache, debugSettings, portableExperiencesController); + var sentryDiagnostics = new SentryDiagnosticStartupOperation(realmController, diagnosticsContainer); startupOperation = new SequentialStartupOperation( loadingStatus, @@ -90,7 +92,8 @@ IRoomHub roomHub checkOnboardingStartupOperation, restartRealmStartupOperation, teleportStartupOperation, - loadGlobalPxOperation + loadGlobalPxOperation, + sentryDiagnostics ).WithHandleExceptions(); } diff --git a/Explorer/Assets/DCL/UserInAppInitializationFlow/StartupOperations/SentryDiagnosticStartupOperation.cs b/Explorer/Assets/DCL/UserInAppInitializationFlow/StartupOperations/SentryDiagnosticStartupOperation.cs new file mode 100644 index 0000000000..670997092a --- /dev/null +++ b/Explorer/Assets/DCL/UserInAppInitializationFlow/StartupOperations/SentryDiagnosticStartupOperation.cs @@ -0,0 +1,35 @@ +using Cysharp.Threading.Tasks; +using DCL.AsyncLoadReporting; +using DCL.Diagnostics; +using ECS.SceneLifeCycle.Realm; +using System; +using System.Threading; +using Utility.Types; + +namespace DCL.UserInAppInitializationFlow.StartupOperations +{ + public class SentryDiagnosticStartupOperation : IStartupOperation + { + private readonly IRealmController realmController; + private readonly DiagnosticsContainer diagnosticsContainer; + + public SentryDiagnosticStartupOperation( + IRealmController realmController, DiagnosticsContainer diagnosticsContainer) + { + this.realmController = realmController; + this.diagnosticsContainer = diagnosticsContainer; + } + + public async UniTask ExecuteAsync(AsyncLoadProcessReport report, CancellationToken ct) + { + diagnosticsContainer.AddSentryScopeConfigurator((scope) => + { + diagnosticsContainer.Sentry?.AddRealmInfoToScope(scope, + realmController.RealmData.Ipfs.CatalystBaseUrl.Value, + realmController.RealmData.Ipfs.ContentBaseUrl.Value, + realmController.RealmData.Ipfs.LambdasBaseUrl.Value); + }); + return Result.SuccessResult(); + } + } +} diff --git a/Explorer/Assets/DCL/UserInAppInitializationFlow/StartupOperations/SentryDiagnosticStartupOperation.cs.meta b/Explorer/Assets/DCL/UserInAppInitializationFlow/StartupOperations/SentryDiagnosticStartupOperation.cs.meta new file mode 100644 index 0000000000..35f9340595 --- /dev/null +++ b/Explorer/Assets/DCL/UserInAppInitializationFlow/StartupOperations/SentryDiagnosticStartupOperation.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: fec913ca7d32401f87374a978275eed5 +timeCreated: 1731947350 \ No newline at end of file diff --git a/Explorer/Assets/Scripts/Global/Dynamic/DynamicWorldContainer.cs b/Explorer/Assets/Scripts/Global/Dynamic/DynamicWorldContainer.cs index d269e61f8a..df9aaaad86 100644 --- a/Explorer/Assets/Scripts/Global/Dynamic/DynamicWorldContainer.cs +++ b/Explorer/Assets/Scripts/Global/Dynamic/DynamicWorldContainer.cs @@ -391,7 +391,8 @@ IMultiPool MultiPoolFactory() => dynamicWorldParams.AppParameters, bootstrapContainer.DebugSettings, staticContainer.PortableExperiencesController, - container.RoomHub + container.RoomHub, + bootstrapContainer.DiagnosticsContainer ); var worldInfoHub = new LocationBasedWorldInfoHub( From 2db184c79f6033eaa94ff095350699fcc8859f5c Mon Sep 17 00:00:00 2001 From: Vitaly Popuzin <35366872+popuz@users.noreply.github.com> Date: Tue, 19 Nov 2024 12:51:18 +0200 Subject: [PATCH 3/5] Chore: centralized app args flags #2817 ## What does this PR change? CLI app args flags were scattered through the code and sometime presented as "magic strings". Sometimes it leadedeven to duplication. I extracted it into one static class, so it is easier to see which params we have already and what can be used. ## How to test the changes? 1. Launch the explorer with some command line arguments and verify it works as previously Examples: "`--debug`", "`--versionControl`" and "`--simulateVersion`" --- .../ApplicationVersionGuard.cs | 3 -- .../Helpers/ApplicationParamsEmoteProvider.cs | 2 +- .../ApplicationParametersWearablesProvider.cs | 2 +- .../FeatureFlagsProviderExtensions.cs | 7 +--- .../Analytics/StaticCommonTraitsPlugin.cs | 5 +-- .../Global/MultiplayerMovementPlugin.cs | 3 +- .../CheckOnboardingStartupOperation.cs | 6 +-- .../Scripts/Global/AppArgs/AppArgsFlags.cs | 41 +++++++++++++++++++ .../Global/AppArgs/AppArgsFlags.cs.meta | 3 ++ .../AppArgs/ApplicationParametersParser.cs | 2 +- .../Assets/Scripts/Global/AppArgs/IAppArgs.cs | 4 +- .../Global/Dynamic/BootstrapContainer.cs | 6 +-- .../Dynamic/DynamicSceneLoaderSettings.cs | 4 +- .../Global/Dynamic/DynamicWorldContainer.cs | 6 +-- .../Scripts/Global/Dynamic/MainSceneLoader.cs | 4 +- .../Global/Dynamic/RealmLaunchSettings.cs | 10 ++--- 16 files changed, 66 insertions(+), 42 deletions(-) create mode 100644 Explorer/Assets/Scripts/Global/AppArgs/AppArgsFlags.cs create mode 100644 Explorer/Assets/Scripts/Global/AppArgs/AppArgsFlags.cs.meta diff --git a/Explorer/Assets/DCL/ApplicationVersionGuard/ApplicationVersionGuard.cs b/Explorer/Assets/DCL/ApplicationVersionGuard/ApplicationVersionGuard.cs index dce30305b3..b99c12b47a 100644 --- a/Explorer/Assets/DCL/ApplicationVersionGuard/ApplicationVersionGuard.cs +++ b/Explorer/Assets/DCL/ApplicationVersionGuard/ApplicationVersionGuard.cs @@ -19,9 +19,6 @@ namespace DCL.ApplicationVersionGuard { public class ApplicationVersionGuard { - public const string ENABLE_VERSION_CONTROL_CLI_ARG = "versionControl"; - public const string SIMULATE_VERSION_CLI_ARG = "simulateVersion"; - private const string LAUNCHER_EXECUTABLE_NAME = "Decentraland Launcher"; private const string LAUNCHER_PATH_MAC = "/Applications/" + LAUNCHER_EXECUTABLE_NAME + ".app"; private const string LAUNCHER_PATH_WIN_MAIN = @"C:\Program Files\Decentraland Launcher\" + LAUNCHER_EXECUTABLE_NAME + ".exe"; diff --git a/Explorer/Assets/DCL/AvatarRendering/Emotes/Helpers/ApplicationParamsEmoteProvider.cs b/Explorer/Assets/DCL/AvatarRendering/Emotes/Helpers/ApplicationParamsEmoteProvider.cs index 4aaf789597..07bcd59f0a 100644 --- a/Explorer/Assets/DCL/AvatarRendering/Emotes/Helpers/ApplicationParamsEmoteProvider.cs +++ b/Explorer/Assets/DCL/AvatarRendering/Emotes/Helpers/ApplicationParamsEmoteProvider.cs @@ -26,7 +26,7 @@ public async UniTask GetOwnedEmotesAsync(Web3Address userId, CancellationTo IEmoteProvider.OwnedEmotesRequestOptions requestOptions, List output) { - if (!appArgs.TryGetValue("self-preview-emotes", out string? emotesCsv)) + if (!appArgs.TryGetValue(AppArgsFlags.SELF_PREVIEW_EMOTES, out string? emotesCsv)) return await source.GetOwnedEmotesAsync(userId, ct, requestOptions, output); URN[] pointers = emotesCsv!.Split(',', StringSplitOptions.RemoveEmptyEntries) diff --git a/Explorer/Assets/DCL/AvatarRendering/Wearables/ApplicationParametersWearablesProvider.cs b/Explorer/Assets/DCL/AvatarRendering/Wearables/ApplicationParametersWearablesProvider.cs index 124ce5a38f..7b00d19e54 100644 --- a/Explorer/Assets/DCL/AvatarRendering/Wearables/ApplicationParametersWearablesProvider.cs +++ b/Explorer/Assets/DCL/AvatarRendering/Wearables/ApplicationParametersWearablesProvider.cs @@ -41,7 +41,7 @@ public ApplicationParametersWearablesProvider(IAppArgs appArgs, string? name = null, List? results = null) { - if (!appArgs.TryGetValue("self-preview-wearables", out string? wearablesCsv)) + if (!appArgs.TryGetValue(AppArgsFlags.SELF_PREVIEW_WEARABLES, out string? wearablesCsv)) return await source.GetAsync(pageSize, pageNumber, ct, sortingField, orderBy, category, collectionType, name, results); URN[] pointers = wearablesCsv!.Split(',', StringSplitOptions.RemoveEmptyEntries) diff --git a/Explorer/Assets/DCL/FeatureFlags/FeatureFlagsProviderExtensions.cs b/Explorer/Assets/DCL/FeatureFlags/FeatureFlagsProviderExtensions.cs index d3ba655366..5f88e27558 100644 --- a/Explorer/Assets/DCL/FeatureFlags/FeatureFlagsProviderExtensions.cs +++ b/Explorer/Assets/DCL/FeatureFlags/FeatureFlagsProviderExtensions.cs @@ -9,9 +9,6 @@ namespace DCL.FeatureFlags { public static class FeatureFlagsProviderExtensions { - private const string ARG_URL = "feature-flags-url"; - private const string ARG_HOSTNAME = "feature-flags-hostname"; - public static async UniTask InitializeAsync( this IFeatureFlagsProvider featureFlagsProvider, IDecentralandUrlsSource decentralandUrlsSource, @@ -25,10 +22,10 @@ public static async UniTask InitializeAsync( // #!/bin/bash // ./Decentraland.app --feature-flags-url https://feature-flags.decentraland.zone --feature-flags-hostname localhost - if(appParameters.TryGetValue(ARG_URL, out string featureFlagsUrl)) + if(appParameters.TryGetValue(AppArgsFlags.FeatureFlags.URL, out string featureFlagsUrl)) options.URL = URLDomain.FromString(featureFlagsUrl); - if(appParameters.TryGetValue(ARG_HOSTNAME, out string hostName)) + if(appParameters.TryGetValue(AppArgsFlags.FeatureFlags.HOSTNAME, out string hostName)) options.Hostname = hostName; options.UserId = userAddress; diff --git a/Explorer/Assets/DCL/PerformanceAndDiagnostics/Analytics/StaticCommonTraitsPlugin.cs b/Explorer/Assets/DCL/PerformanceAndDiagnostics/Analytics/StaticCommonTraitsPlugin.cs index 1cacc31654..1b103a40e7 100644 --- a/Explorer/Assets/DCL/PerformanceAndDiagnostics/Analytics/StaticCommonTraitsPlugin.cs +++ b/Explorer/Assets/DCL/PerformanceAndDiagnostics/Analytics/StaticCommonTraitsPlugin.cs @@ -8,7 +8,6 @@ namespace DCL.PerformanceAndDiagnostics.Analytics { public class StaticCommonTraitsPlugin : EventPlugin { - private const string DCL_EDITOR = "dcl-editor"; private const string UNITY_EDITOR = "unity-editor"; private const string DEBUG = "debug"; private const string RELEASE = "release"; @@ -37,8 +36,8 @@ private static string ChooseRuntime(IAppArgs appArgs) if (Application.isEditor) return UNITY_EDITOR; - if (appArgs.HasFlag(DCL_EDITOR)) - return DCL_EDITOR; + if (appArgs.HasFlag(AppArgsFlags.DCL_EDITOR)) + return AppArgsFlags.DCL_EDITOR; if (Debug.isDebugBuild || appArgs.HasDebugFlag()) return DEBUG; diff --git a/Explorer/Assets/DCL/PluginSystem/Global/MultiplayerMovementPlugin.cs b/Explorer/Assets/DCL/PluginSystem/Global/MultiplayerMovementPlugin.cs index 46ebab15aa..169f257763 100644 --- a/Explorer/Assets/DCL/PluginSystem/Global/MultiplayerMovementPlugin.cs +++ b/Explorer/Assets/DCL/PluginSystem/Global/MultiplayerMovementPlugin.cs @@ -21,7 +21,6 @@ namespace DCL.PluginSystem.Global { public class MultiplayerMovementPlugin : IDCLGlobalPlugin { - private const string COMPRESSION_ARG_FLAG = "compression"; private readonly IAssetsProvisioner assetsProvisioner; private readonly MultiplayerMovementMessageBus messageBus; private readonly IDebugContainerBuilder debugBuilder; @@ -72,7 +71,7 @@ public async UniTask InitializeAsync(MultiplayerCommunicationSettings settings, private void ConfigureCompressionUsage() { - if (appArgs.TryGetValue(COMPRESSION_ARG_FLAG, out string? compression)) + if (appArgs.TryGetValue(AppArgsFlags.Multiplayer.COMPRESSION, out string? compression)) { this.settings.Value.UseCompression = compression == "true"; return; diff --git a/Explorer/Assets/DCL/UserInAppInitializationFlow/StartupOperations/CheckOnboardingStartupOperation.cs b/Explorer/Assets/DCL/UserInAppInitializationFlow/StartupOperations/CheckOnboardingStartupOperation.cs index 5197e48b1b..5389fefbe8 100644 --- a/Explorer/Assets/DCL/UserInAppInitializationFlow/StartupOperations/CheckOnboardingStartupOperation.cs +++ b/Explorer/Assets/DCL/UserInAppInitializationFlow/StartupOperations/CheckOnboardingStartupOperation.cs @@ -18,9 +18,7 @@ namespace DCL.UserInAppInitializationFlow.StartupOperations public class CheckOnboardingStartupOperation : IStartupOperation { private const int TUTORIAL_STEP_DONE_MARK = 256; - private const string APP_PARAMETER_REALM = "realm"; - private const string APP_PARAMETER_LOCAL_SCENE = "local-scene"; - private const string APP_PARAMETER_POSITION = "position"; + private readonly ILoadingStatus loadingStatus; private readonly ISelfProfile selfProfile; @@ -59,7 +57,7 @@ public async UniTask ExecuteAsync(AsyncLoadProcessReport report, Cancell private async UniTask CheckOnboardingAsync(CancellationToken ct) { // It the app is open from any external way, we will ignore the onboarding flow - if (appParameters.HasFlag(APP_PARAMETER_REALM) || appParameters.HasFlag(APP_PARAMETER_POSITION) || appParameters.HasFlag(APP_PARAMETER_LOCAL_SCENE)) + if (appParameters.HasFlag(AppArgsFlags.REALM) || appParameters.HasFlag(AppArgsFlags.POSITION) || appParameters.HasFlag(AppArgsFlags.LOCAL_SCENE)) return; isProfilePendingToBeUpdated = false; diff --git a/Explorer/Assets/Scripts/Global/AppArgs/AppArgsFlags.cs b/Explorer/Assets/Scripts/Global/AppArgs/AppArgsFlags.cs new file mode 100644 index 0000000000..4b9d0433f4 --- /dev/null +++ b/Explorer/Assets/Scripts/Global/AppArgs/AppArgsFlags.cs @@ -0,0 +1,41 @@ +namespace Global.AppArgs +{ + public static class AppArgsFlags + { + public const string DEBUG = "debug"; + public const string DCL_EDITOR = "dcl-editor"; + + public const string ENABLE_VERSION_CONTROL = "versionControl"; + public const string SIMULATE_VERSION = "simulateVersion"; + + public const string SCENE_CONSOLE = "scene-console"; + + public const string ENVIRONMENT = "dclenv"; + public const string REALM = "realm"; + public const string LOCAL_SCENE = "local-scene"; + public const string POSITION = "position"; + + public const string FORCED_EMOTES = "self-force-emotes"; + public const string SELF_PREVIEW_EMOTES = "self-preview-emotes"; + public const string SELF_PREVIEW_WEARABLES = "self-preview-wearables"; + + public const string CAMERA_REEL = "camera-reel"; + + public static class Multiplayer + { + public const string COMPRESSION = "compression"; + } + + public static class FeatureFlags + { + public const string URL = "feature-flags-url"; + public const string HOSTNAME = "feature-flags-hostname"; + } + + public static class Analytics + { + public const string SESSION_ID = "session_id"; + public const string LAUNCHER_ID = "launcher_anonymous_id"; + } + } +} diff --git a/Explorer/Assets/Scripts/Global/AppArgs/AppArgsFlags.cs.meta b/Explorer/Assets/Scripts/Global/AppArgs/AppArgsFlags.cs.meta new file mode 100644 index 0000000000..48c1d0b537 --- /dev/null +++ b/Explorer/Assets/Scripts/Global/AppArgs/AppArgsFlags.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 52f824711e444b9890881c0fbe309ef3 +timeCreated: 1731926863 \ No newline at end of file diff --git a/Explorer/Assets/Scripts/Global/AppArgs/ApplicationParametersParser.cs b/Explorer/Assets/Scripts/Global/AppArgs/ApplicationParametersParser.cs index 049b1a2644..c898cc8108 100644 --- a/Explorer/Assets/Scripts/Global/AppArgs/ApplicationParametersParser.cs +++ b/Explorer/Assets/Scripts/Global/AppArgs/ApplicationParametersParser.cs @@ -14,7 +14,7 @@ public class ApplicationParametersParser : IAppArgs private static readonly IReadOnlyDictionary ALWAYS_IN_EDITOR = new Dictionary { - [IAppArgs.DEBUG_FLAG] = string.Empty, + [AppArgsFlags.DEBUG] = string.Empty, }; public ApplicationParametersParser() : this(Environment.GetCommandLineArgs()) { } diff --git a/Explorer/Assets/Scripts/Global/AppArgs/IAppArgs.cs b/Explorer/Assets/Scripts/Global/AppArgs/IAppArgs.cs index 99a6f1f2fd..a1699c2c7d 100644 --- a/Explorer/Assets/Scripts/Global/AppArgs/IAppArgs.cs +++ b/Explorer/Assets/Scripts/Global/AppArgs/IAppArgs.cs @@ -4,8 +4,6 @@ namespace Global.AppArgs { public interface IAppArgs { - public const string DEBUG_FLAG = "debug"; - bool HasFlag(string flagName); bool TryGetValue(string flagName, out string? value); @@ -16,6 +14,6 @@ public interface IAppArgs public static class AppArgsExtensions { public static bool HasDebugFlag(this IAppArgs args) => - args.HasFlag(IAppArgs.DEBUG_FLAG); + args.HasFlag(AppArgsFlags.DEBUG); } } diff --git a/Explorer/Assets/Scripts/Global/Dynamic/BootstrapContainer.cs b/Explorer/Assets/Scripts/Global/Dynamic/BootstrapContainer.cs index 180bde1f3a..11dccfecf6 100644 --- a/Explorer/Assets/Scripts/Global/Dynamic/BootstrapContainer.cs +++ b/Explorer/Assets/Scripts/Global/Dynamic/BootstrapContainer.cs @@ -96,7 +96,7 @@ await bootstrapContainer.InitializeContainerAsync Realms { get; private set; } [field: SerializeField] public List Web3WhitelistMethods { get; private set; } public void ApplyConfig(IAppArgs applicationParametersParser) { - if (applicationParametersParser.TryGetValue(ENV_PARAM, out string? environment)) + if (applicationParametersParser.TryGetValue(AppArgsFlags.ENVIRONMENT, out string? environment)) ParseEnvironment(environment!); } diff --git a/Explorer/Assets/Scripts/Global/Dynamic/DynamicWorldContainer.cs b/Explorer/Assets/Scripts/Global/Dynamic/DynamicWorldContainer.cs index df9aaaad86..3011e0e6a9 100644 --- a/Explorer/Assets/Scripts/Global/Dynamic/DynamicWorldContainer.cs +++ b/Explorer/Assets/Scripts/Global/Dynamic/DynamicWorldContainer.cs @@ -97,8 +97,6 @@ namespace Global.Dynamic { public class DynamicWorldContainer : DCLWorldContainer { - private const string PARAMS_FORCED_EMOTES_FLAG = "self-force-emotes"; - private ECSReloadScene? reloadSceneController; private LocalSceneDevelopmentController? localSceneDevelopmentController; private IWearablesProvider? wearablesProvider; @@ -639,7 +637,7 @@ IMultiPool MultiPoolFactory() => globalPlugins.AddRange(staticContainer.SharedPlugins); - if (appArgs.HasFlag("camera-reel")) + if (appArgs.HasFlag(AppArgsFlags.CAMERA_REEL)) globalPlugins.Add(new InWorldCameraPlugin(dclInput, assetsProvisioner, selfProfile, staticContainer.RealmData, playerEntity, placesAPIService, staticContainer.CharacterContainer.CharacterObject, coroutineRunner, staticContainer.WebRequestsContainer.WebRequestController, bootstrapContainer.DecentralandUrlsSource)); if (dynamicWorldParams.EnableAnalytics) @@ -686,7 +684,7 @@ private static void ParseDebugForcedEmotes(IReadOnlyList? debugEmotes, r private static void ParseParamsForcedEmotes(IAppArgs appParams, ref List parsedEmotes) { - if (appParams.TryGetValue(PARAMS_FORCED_EMOTES_FLAG, out string? csv) && !string.IsNullOrEmpty(csv)) + if (appParams.TryGetValue(AppArgsFlags.FORCED_EMOTES, out string? csv) && !string.IsNullOrEmpty(csv)) parsedEmotes.AddRange(csv.Split(',', StringSplitOptions.RemoveEmptyEntries).Select(emote => new URN(emote))); } } diff --git a/Explorer/Assets/Scripts/Global/Dynamic/MainSceneLoader.cs b/Explorer/Assets/Scripts/Global/Dynamic/MainSceneLoader.cs index 25176d4509..043f9b4f04 100644 --- a/Explorer/Assets/Scripts/Global/Dynamic/MainSceneLoader.cs +++ b/Explorer/Assets/Scripts/Global/Dynamic/MainSceneLoader.cs @@ -182,13 +182,13 @@ private async UniTask InitializeFlowAsync(CancellationToken ct) private async UniTask DoesApplicationRequireVersionUpdateAsync(IAppArgs applicationParametersParser, SplashScreen splashScreen, CancellationToken ct) { - applicationParametersParser.TryGetValue(ApplicationVersionGuard.SIMULATE_VERSION_CLI_ARG, out string? version); + applicationParametersParser.TryGetValue(AppArgsFlags.SIMULATE_VERSION, out string? version); string? currentVersion = version ?? Application.version; bool runVersionControl = debugSettings.EnableVersionUpdateGuard; if (applicationParametersParser.HasDebugFlag() && !Application.isEditor) - runVersionControl = applicationParametersParser.TryGetValue(ApplicationVersionGuard.ENABLE_VERSION_CONTROL_CLI_ARG, out string? enforceDebugMode) && enforceDebugMode == "true"; + runVersionControl = applicationParametersParser.TryGetValue(AppArgsFlags.ENABLE_VERSION_CONTROL, out string? enforceDebugMode) && enforceDebugMode == "true"; if (!runVersionControl) return false; diff --git a/Explorer/Assets/Scripts/Global/Dynamic/RealmLaunchSettings.cs b/Explorer/Assets/Scripts/Global/Dynamic/RealmLaunchSettings.cs index 9f7e3204be..12f5d012c6 100644 --- a/Explorer/Assets/Scripts/Global/Dynamic/RealmLaunchSettings.cs +++ b/Explorer/Assets/Scripts/Global/Dynamic/RealmLaunchSettings.cs @@ -15,10 +15,6 @@ namespace Global.Dynamic [Serializable] public class RealmLaunchSettings { - private const string APP_PARAMETER_REALM = "realm"; - private const string APP_PARAMETER_LOCAL_SCENE = "local-scene"; - private const string APP_PARAMETER_POSITION = "position"; - [Serializable] public struct PredefinedScenes { @@ -91,10 +87,10 @@ public string GetStartingRealm(IDecentralandUrlsSource decentralandUrlsSource) public void ApplyConfig(IAppArgs applicationParameters) { - if (applicationParameters.TryGetValue(APP_PARAMETER_REALM, out string? realm)) + if (applicationParameters.TryGetValue(AppArgsFlags.REALM, out string? realm)) ParseRealmAppParameter(applicationParameters, realm); - if (applicationParameters.TryGetValue(APP_PARAMETER_POSITION, out string? position)) + if (applicationParameters.TryGetValue(AppArgsFlags.POSITION, out string? position)) ParsePositionAppParameter(position); } @@ -102,7 +98,7 @@ private void ParseRealmAppParameter(IAppArgs appParameters, string realmParamVal { if (string.IsNullOrEmpty(realmParamValue)) return; - bool isLocalSceneDevelopment = appParameters.TryGetValue(APP_PARAMETER_LOCAL_SCENE, out string localSceneParamValue) + bool isLocalSceneDevelopment = appParameters.TryGetValue(AppArgsFlags.LOCAL_SCENE, out string localSceneParamValue) && ParseLocalSceneParameter(localSceneParamValue) && IsRealmAValidUrl(realmParamValue); From ff7e9a00e1d7a6da0ddca247300fc426496a81fc Mon Sep 17 00:00:00 2001 From: Charly <85914018+charly-bg@users.noreply.github.com> Date: Tue, 19 Nov 2024 12:34:40 -0300 Subject: [PATCH 4/5] fix: correct image for s3 latest release workflow (#2832) --- .github/workflows/s3-latest-release.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/s3-latest-release.yml b/.github/workflows/s3-latest-release.yml index 7d6e279ded..edfda06566 100644 --- a/.github/workflows/s3-latest-release.yml +++ b/.github/workflows/s3-latest-release.yml @@ -9,7 +9,13 @@ on: jobs: check-latest-release: runs-on: ubuntu-latest + container: + image: amazon/aws-cli:latest steps: + - name: Install jq and curl + run: | + yum update -y + yum install -y jq curl - name: Check if current release is the latest release id: check_latest run: | @@ -43,6 +49,4 @@ jobs: "version": "${{ env.latest_release }}", "timestamp": "'$(date -u +"%Y-%m-%dT%H:%M:%SZ")'" }' > latest.json - cat latest.json - aws s3 ls s3://$EXPLORER_TEAM_S3_BUCKET/ - aws s3 cp latest.json s3://$EXPLORER_TEAM_S3_BUCKET/$RELEASES_PATH/latest.json --debug + aws s3 cp latest.json s3://$EXPLORER_TEAM_S3_BUCKET/$RELEASES_PATH/latest.json From 1f75eff4886d93bef25ee0da4389fc3e2af784f2 Mon Sep 17 00:00:00 2001 From: Fran Colarich <56565104+fcolarich@users.noreply.github.com> Date: Tue, 19 Nov 2024 16:58:53 +0100 Subject: [PATCH 5/5] fix: Unknown camera mode Enum breaks scenes (#2830) * Update CameraMode.cs * Changed default camera to third person --- .../DCL/Character/CharacterCamera/CameraMode.cs | 11 +++++------ .../Character/CharacterCamera/Character Camera.prefab | 6 +----- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/Explorer/Assets/DCL/Character/CharacterCamera/CameraMode.cs b/Explorer/Assets/DCL/Character/CharacterCamera/CameraMode.cs index 6c0111100f..06c97455b5 100644 --- a/Explorer/Assets/DCL/Character/CharacterCamera/CameraMode.cs +++ b/Explorer/Assets/DCL/Character/CharacterCamera/CameraMode.cs @@ -2,15 +2,14 @@ { public enum CameraMode : byte { - Unknown = 0, - FirstPerson = 1, - ThirdPerson = 2, - DroneView = 3, - SDKCamera = 4, + FirstPerson = 0, + ThirdPerson = 1, + DroneView = 2, + SDKCamera = 3, /// /// Free-fly, does not follow character, intercepts controls designated for character movement /// - Free = 5, + Free = 4, } } diff --git a/Explorer/Assets/DCL/Character/CharacterCamera/Character Camera.prefab b/Explorer/Assets/DCL/Character/CharacterCamera/Character Camera.prefab index 7f533f8e33..5c37be0d1b 100644 --- a/Explorer/Assets/DCL/Character/CharacterCamera/Character Camera.prefab +++ b/Explorer/Assets/DCL/Character/CharacterCamera/Character Camera.prefab @@ -453,12 +453,8 @@ MonoBehaviour: k__BackingField: {fileID: 4997933640858091397} k__BackingField: 10 k__BackingField: {x: 0, y: 25, z: 0} - inWorldCameraData: - k__BackingField: {fileID: 8825178219543001937} - k__BackingField: 5 - k__BackingField: {x: 0, y: 10, z: 0} shoulderChangeSpeed: 4 - k__BackingField: 2 + k__BackingField: 1 k__BackingField: {fileID: 1924827267997815873} --- !u!1 &2902897560403827600 GameObject: