Skip to content

Commit

Permalink
Merge pull request #3006 from decentraland/release/release-13-12-2024
Browse files Browse the repository at this point in the history
release: 13-12-2024
  • Loading branch information
m3taphysics authored Dec 13, 2024
2 parents e38cdfc + aea01e8 commit 7d06c47
Show file tree
Hide file tree
Showing 185 changed files with 16,486 additions and 1,563 deletions.
8 changes: 7 additions & 1 deletion Explorer/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,10 @@ sysinfo.txt
crashlytics-build.properties

# Sentry
.sentryconfig.json
.sentryconfig.json

# Addressables
Assets/AddressableAssetData/OSX/
Assets/AddressableAssetData/OSX/.meta
Assets/AddressableAssetData/Windows/
Assets/AddressableAssetData/Windows.meta
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ MonoBehaviour:
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 183d02953ce77467786739e7cfb2d766
m_Address: Assets/DCL/InWorldCamera/PhotoDetail/Assets/PhotoDetailUI.prefab
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 19373184c73f36042a55739551bb8298
m_Address: Avatar_CelShading
m_ReadOnly: 0
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,36 +1,26 @@
using Arch.Core;
using CommunicationData.URLHelpers;
using Cysharp.Threading.Tasks;
using DCL.AvatarRendering.Loading.Components;
using DCL.AvatarRendering.Wearables.Components;
using DCL.AvatarRendering.Wearables.Helpers;
using ECS.Prioritization.Components;
using ECS.StreamableLoading.Common;
using Global.AppArgs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using WearablePromise = ECS.StreamableLoading.Common.AssetPromise<DCL.AvatarRendering.Wearables.Components.WearablesResolution,
DCL.AvatarRendering.Wearables.Components.Intentions.GetWearablesByPointersIntention>;

namespace DCL.AvatarRendering.Wearables
{
public class ApplicationParametersWearablesProvider : IWearablesProvider
{
private readonly IAppArgs appArgs;
private readonly IWearablesProvider source;
private readonly World world;
private readonly string[] allWearableCategories = WearablesConstants.CATEGORIES_PRIORITY.ToArray();
private readonly List<IWearable> resultWearablesBuffer = new ();

public ApplicationParametersWearablesProvider(IAppArgs appArgs,
IWearablesProvider source,
World world)
IWearablesProvider source)
{
this.appArgs = appArgs;
this.source = source;
this.world = world;
}

public async UniTask<(IReadOnlyList<IWearable> results, int totalAmount)> GetAsync(int pageSize, int pageNumber, CancellationToken ct,
Expand Down Expand Up @@ -70,26 +60,10 @@ await UniTask.WhenAll(RequestPointersAsync(pointers, BodyShape.MALE, ct),
}
}

private async UniTask<IReadOnlyCollection<IWearable>?> RequestPointersAsync(IReadOnlyCollection<URN> pointers,
public async UniTask<IReadOnlyCollection<IWearable>?> RequestPointersAsync(IReadOnlyCollection<URN> pointers,
BodyShape bodyShape,
CancellationToken ct)
{
var promise = WearablePromise.Create(world,

// We pass all categories as force renderer to force the download of all of them
// Otherwise they will be skipped if any wearable is hiding the category
WearableComponentsUtils.CreateGetWearablesByPointersIntention(bodyShape, pointers, allWearableCategories),
PartitionComponent.TOP_PRIORITY);

promise = await promise.ToUniTaskAsync(world, cancellationToken: ct);
CancellationToken ct) =>
await source.RequestPointersAsync(pointers, bodyShape, ct);

if (!promise.TryGetResult(world, out var result))
return null;

if (!result.Succeeded)
return null;

return result.Asset.Wearables;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
using Arch.Core;
using CommunicationData.URLHelpers;
using Cysharp.Threading.Tasks;
using DCL.AvatarRendering.Loading.Components;
using DCL.AvatarRendering.Wearables.Components;
using DCL.AvatarRendering.Wearables.Components.Intentions;
using DCL.AvatarRendering.Wearables.Helpers;
using DCL.Web3.Identities;
using ECS.Prioritization.Components;
using ECS.StreamableLoading.Common;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using ParamPromise = ECS.StreamableLoading.Common.AssetPromise<DCL.AvatarRendering.Wearables.Helpers.WearablesResponse, DCL.AvatarRendering.Wearables.Components.Intentions.GetWearableByParamIntention>;
using WearablePromise = ECS.StreamableLoading.Common.AssetPromise<DCL.AvatarRendering.Wearables.Components.WearablesResolution,
DCL.AvatarRendering.Wearables.Components.Intentions.GetWearablesByPointersIntention>;

namespace DCL.AvatarRendering.Wearables
{
Expand All @@ -26,6 +32,7 @@ public class ECSWearablesProvider : IWearablesProvider
private const string THIRD_PARTY_COLLECTION_TYPE = "third-party";
private const string BASE_WEARABLE_COLLECTION_TYPE = "base-wearable";

private readonly string[] allWearableCategories = WearablesConstants.CATEGORIES_PRIORITY.ToArray();
private readonly IWeb3IdentityCache web3IdentityCache;
private readonly List<(string, string)> requestParameters = new ();
private readonly World world;
Expand Down Expand Up @@ -84,6 +91,28 @@ public ECSWearablesProvider(
wearablesPromise.Result.Value.Asset.TotalAmount);
}

public async UniTask<IReadOnlyCollection<IWearable>?> RequestPointersAsync(IReadOnlyCollection<URN> pointers,
BodyShape bodyShape,
CancellationToken ct)
{
var promise = WearablePromise.Create(world,

// We pass all categories as force renderer to force the download of all of them
// Otherwise they will be skipped if any wearable is hiding the category
WearableComponentsUtils.CreateGetWearablesByPointersIntention(bodyShape, pointers, allWearableCategories),
PartitionComponent.TOP_PRIORITY);

promise = await promise.ToUniTaskAsync(world, cancellationToken: ct);

if (!promise.TryGetResult(world, out var result))
return null;

if (!result.Succeeded)
return null;

return result.Asset.Wearables;
}

private static string GetDirectionParamValue(IWearablesProvider.OrderBy orderBy)
{
switch (orderBy)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using CommunicationData.URLHelpers;
using Cysharp.Threading.Tasks;
using DCL.AvatarRendering.Loading.Components;
using DCL.AvatarRendering.Wearables.Components;
using System;
using System.Collections.Generic;
Expand All @@ -14,6 +16,10 @@ public interface IWearablesProvider
string? name = null,
List<IWearable>? results = null);

UniTask<IReadOnlyCollection<IWearable>?> RequestPointersAsync(IReadOnlyCollection<URN> pointers,
BodyShape bodyShape,
CancellationToken ct);

public enum SortingField
{
Date,
Expand Down
18 changes: 7 additions & 11 deletions Explorer/Assets/DCL/Chat/ChatCommandsHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,22 @@ public class ChatCommandsHandler
{
private const string CHAT_COMMAND_CHAR = "/";

private readonly Dictionary<Regex, IChatCommand> commandsCache = new ();
private readonly IReadOnlyDictionary<Regex, Func<IChatCommand>> commandsFactory;
private readonly IReadOnlyList<IChatCommand> commands;

public ChatCommandsHandler(IReadOnlyDictionary<Regex, Func<IChatCommand>> commandsFactory)
public ChatCommandsHandler(IReadOnlyList<IChatCommand> commands)
{
this.commandsFactory = commandsFactory;
this.commands = commands;
}

public bool TryGetChatCommand(in string message, ref (IChatCommand command, Match match) commandTuple)
{
foreach (Regex? commandRegex in commandsFactory.Keys)
foreach (IChatCommand cmd in commands)
{
commandTuple.match = commandRegex.Match(message);
commandTuple.match = cmd.Regex.Match(message);

if (!commandTuple.match.Success) continue;

if (!commandsCache.TryGetValue(commandRegex, out commandTuple.command))
{
commandTuple.command = commandsFactory[commandRegex]();
commandsCache[commandRegex] = commandTuple.command;
}
commandTuple.command = cmd;

return true;
}
Expand Down
7 changes: 5 additions & 2 deletions Explorer/Assets/DCL/Chat/ChatController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ protected override void OnViewInstantiated()
viewInstance.ChatBubblesToggle.Toggle.SetIsOnWithoutNotify(nametagsData.showChatBubbles);
OnToggleChatBubblesValueChanged(nametagsData.showChatBubbles);
OnFocus();

// Intro message
chatHistory.AddMessage(ChatMessage.NewFromSystem("Type /help for available commands."));
}

protected override void OnViewShow()
Expand Down Expand Up @@ -265,13 +268,13 @@ private void ToggleEmojiPanel()
private void DisableUnwantedInputs()
{
world.AddOrGet(cameraEntity, new CameraBlockerComponent());
inputBlock.Disable(InputMapComponent.Kind.CAMERA , InputMapComponent.Kind.SHORTCUTS , InputMapComponent.Kind.PLAYER);
inputBlock.Disable(InputMapComponent.BLOCK_USER_INPUT);
}

private void EnableUnwantedInputs()
{
world.TryRemove<CameraBlockerComponent>(cameraEntity);
inputBlock.Enable(InputMapComponent.Kind.CAMERA , InputMapComponent.Kind.SHORTCUTS , InputMapComponent.Kind.PLAYER);
inputBlock.Enable(InputMapComponent.BLOCK_USER_INPUT);
}

private void OnSubmitAction(InputAction.CallbackContext obj)
Expand Down
2 changes: 2 additions & 0 deletions Explorer/Assets/DCL/Chat/Commands/IChatCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ namespace DCL.Chat.Commands
{
public interface IChatCommand
{
Regex Regex { get; }

string Description { get; }

UniTask<string> ExecuteAsync(Match match, CancellationToken ct);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ public class CommandsHandleChatMessageBus : IChatMessagesBus

public event Action<ChatMessage>? MessageAdded;

public CommandsHandleChatMessageBus(IChatMessagesBus origin, IReadOnlyDictionary<Regex, Func<IChatCommand>> commandsFactory)
public CommandsHandleChatMessageBus(IChatMessagesBus origin, IReadOnlyList<IChatCommand> commands)
{
this.origin = origin;
this.chatCommandsHandler = new ChatCommandsHandler(commandsFactory);
this.chatCommandsHandler = new ChatCommandsHandler(commands);
origin.MessageAdded += OriginOnOnMessageAdded;
}

Expand Down
4 changes: 2 additions & 2 deletions Explorer/Assets/DCL/Chat/MessageBus/IChatMessagesBus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ void CreateTestChatEntry()
return messagesBus;
}

public static IChatMessagesBus WithCommands(this IChatMessagesBus messagesBus, IReadOnlyDictionary<Regex, Func<IChatCommand>> commandsFactory) =>
new CommandsHandleChatMessageBus(messagesBus, commandsFactory);
public static IChatMessagesBus WithCommands(this IChatMessagesBus messagesBus, IReadOnlyList<IChatCommand> commands) =>
new CommandsHandleChatMessageBus(messagesBus, commands);

public static IChatMessagesBus WithIgnoreSymbols(this IChatMessagesBus messagesBus) =>
new IgnoreWithSymbolsChatMessageBus(messagesBus);
Expand Down
1 change: 1 addition & 0 deletions Explorer/Assets/DCL/Editor/DCL.Editor.asmdef
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"GUID:fa7b3fdbb04d67549916da7bd2af58ab",
"GUID:d28a7e4beeca475418c15757abf1b6f1",
"GUID:286980af24684da6acc1caa413039811",
"GUID:1d2c76eb8b48e0b40940e8b31a679ce1",
"GUID:fc37ca6521833154cab08ec51af097d9"
],
"includePlatforms": [
Expand Down
Loading

0 comments on commit 7d06c47

Please sign in to comment.