Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release: 20240618 #6218

Merged
merged 9 commits into from
Jun 19, 2024
2 changes: 1 addition & 1 deletion browser-interface/packages/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export namespace ethereumConfigurations {
wss: 'wss://rpc.decentraland.org/mainnet',
http: 'https://rpc.decentraland.org/mainnet',
etherscan: 'https://etherscan.io',
names: 'https://api.thegraph.com/subgraphs/name/decentraland/marketplace',
names: 'https://subgraph.decentraland.org/marketplace',

// contracts
LANDProxy: assertValue(contractInfo.mainnet.LANDProxy),
Expand Down
14 changes: 7 additions & 7 deletions scripts/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"typescript": "^4.2.3"
},
"dependencies": {
"@dcl/protocol": "^1.0.0-9115457439.commit-926ebd1",
"@dcl/protocol": "1.0.0-9466805132.commit-365e0bb",
"@protobuf-ts/protoc": "^2.8.2",
"@types/fs-extra": "^11.0.1",
"@types/glob": "^8.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ public void OnComponentRemoved(IParcelScene scene, IDCLEntity entity)
public void OnComponentModelUpdated(IParcelScene scene, IDCLEntity entity, PBUiText model)
{
uiElement.text = model.Value;

var wrapMode = WhiteSpace.Normal; // Default mode is Wrap enabled
if (model.HasTextWrap && model.TextWrap == TextWrap.TwNoWrap)
wrapMode = WhiteSpace.NoWrap;

uiElement.style.whiteSpace = wrapMode;
uiElement.style.color = model.GetColor().ToUnityColor();
uiElement.style.fontSize = model.GetFontSize();
uiElement.style.unityTextAlign = model.GetTextAlign().ToUnityTextAlign();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,19 @@ private class EmoteCollectionResponse
public EmoteEntityDto[] entities;
}

internal readonly Dictionary<string, WearableItem> emotes = new ();
internal readonly Dictionary<string, HashSet<Promise<WearableItem>>> promises = new ();
internal readonly Dictionary<string, int> emotesOnUse = new ();
internal readonly Dictionary<string, HashSet<Promise<IReadOnlyList<WearableItem>>>> ownedEmotesPromisesByUser = new ();
internal readonly Dictionary<string, WearableItem> emotes = new (new Dictionary<string, WearableItem>(), StringIgnoreCaseEqualityComparer.Default);
internal readonly Dictionary<string, HashSet<Promise<WearableItem>>> promises = new (new Dictionary<string, HashSet<Promise<WearableItem>>>(),
StringIgnoreCaseEqualityComparer.Default);
internal readonly Dictionary<string, int> emotesOnUse = new (new Dictionary<string, int>(), StringIgnoreCaseEqualityComparer.Default);
internal readonly Dictionary<string, HashSet<Promise<IReadOnlyList<WearableItem>>>> ownedEmotesPromisesByUser = new (
new Dictionary<string, HashSet<Promise<IReadOnlyList<WearableItem>>>>(), StringIgnoreCaseEqualityComparer.Default);

private readonly IEmotesRequestSource emoteSource;
private readonly IAddressableResourceProvider addressableResourceProvider;
private readonly ICatalyst catalyst;
private readonly ILambdasService lambdasService;
private readonly DataStore dataStore;
private readonly Dictionary<string, string> ownedUrns = new ();
private readonly Dictionary<string, string> ownedUrns = new (new Dictionary<string, string>(), StringIgnoreCaseEqualityComparer.Default);

private EmbeddedEmotesSO embeddedEmotesSo;
private CancellationTokenSource addressableCts;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public WearableCollectionResponse(EntityDto[] entities)
private const int MAX_WEARABLES_PER_REQUEST = 200;

private readonly ILambdasService lambdasService;
private readonly Dictionary<string, int> wearablesInUseCounters = new ();
private readonly Dictionary<string, int> wearablesInUseCounters = new (new Dictionary<string, int>(), StringIgnoreCaseEqualityComparer.Default);
private readonly Dictionary<(string userId, int pageSize), LambdaResponsePagePointer<WearableWithDefinitionResponse>> ownerWearablesPagePointers = new ();
private readonly Dictionary<(string userId, string collectionId, int pageSize), LambdaResponsePagePointer<WearableWithDefinitionResponse>> thirdPartyCollectionPagePointers = new ();
private readonly List<string> pendingWearablesToRequest = new ();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ var IntercomWindow = {
const windowHeight = window.innerHeight
const windowWidth = window.innerWidth
const popupHeight = Math.min(700, windowHeight)
const popupWidth = Math.min(400, windowWidth)
const popupWidth = Math.min(450, windowWidth)
const top = Math.max(windowHeight - popupHeight, 0)
const left = Math.max(windowWidth - popupWidth - 20, 0)

window.open('https://intercom.decentraland.org', 'intercom', `popup,top=${top},left=${left},width=${popupWidth},height=${popupHeight}`)
window.open('https://decentraland.org/help', 'intercom', `popup,top=${top},left=${left},width=${popupWidth},height=${popupHeight}`)
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class WearableGridController
private readonly AvatarSlotsHUDController avatarSlotsHUDController;
private readonly IBackpackAnalyticsService backpackAnalyticsService;
private readonly ICustomNftCollectionService customNftCollectionService;
private readonly List<WearableItem> customWearablesBuffer = new ();

private Dictionary<string, WearableGridItemModel> currentWearables = new ();
private CancellationTokenSource requestWearablesCancellationToken = new ();
Expand Down Expand Up @@ -265,18 +266,31 @@ private async UniTask<int> RequestWearablesAndShowThem(int page, CancellationTok

try
{
int customWearablesCount = wearables.Count;
int ownedWearablesCount = wearables.Count;
int ownedWearablesTotalAmount = totalAmount;

await UniTask.WhenAll(FetchCustomWearableCollections(wearables, cancellationToken),
FetchCustomWearableItems(wearables, cancellationToken));
customWearablesBuffer.Clear();

customWearablesCount = wearables.Count - customWearablesCount;
await UniTask.WhenAll(FetchCustomWearableCollections(customWearablesBuffer, cancellationToken),
FetchCustomWearableItems(customWearablesBuffer, cancellationToken));

int customWearablesCount = customWearablesBuffer.Count;
totalAmount += customWearablesCount;

// clamp wearables size to page size
// TODO: remove wearables that dont applies to the current filters
for (int i = wearables.Count - 1; i >= PAGE_SIZE; i--)
wearables.RemoveAt(i);
if (ownedWearablesCount < PAGE_SIZE && customWearablesCount > 0)
{
int ownedWearablesStartingPage = (ownedWearablesTotalAmount / PAGE_SIZE) + 1;
int customWearablesOffsetPage = page - ownedWearablesStartingPage;
int skip = customWearablesOffsetPage * PAGE_SIZE;
// Fill the page considering the existing owned wearables
int count = PAGE_SIZE - ownedWearablesCount;
int until = skip + count;

for (int i = skip; i < customWearablesBuffer.Count && i < until; i++)
wearables.Add(customWearablesBuffer[i]);
}

customWearablesBuffer.Clear();
}
catch (Exception e) when (e is not OperationCanceledException) { Debug.LogError(e); }

Expand All @@ -285,7 +299,7 @@ await UniTask.WhenAll(FetchCustomWearableCollections(wearables, cancellationToke
currentWearables = wearables.Select(ToWearableGridModel)
.ToDictionary(item => ExtendedUrnParser.GetShortenedUrn(item.WearableId), model => model);

view.SetWearablePages(page, (totalAmount + PAGE_SIZE - 1) / PAGE_SIZE);
view.SetWearablePages(page, Mathf.CeilToInt((float) totalAmount / PAGE_SIZE));

// TODO: mark the wearables to be disposed if no references left
view.ClearWearables();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace DCL.HelpAndSupportHUD
{
public class HelpAndSupportHUDController : IHUD
{
internal const string CONTACT_SUPPORT_URL = "https://intercom.decentraland.org";
internal const string CONTACT_SUPPORT_URL = "https://decentraland.org/help";
internal const string JOIN_DISCORD_URL = "https://dcl.gg/discord";
internal const string FAQ_URL = "https://docs.decentraland.org/decentraland/faq/";
public IHelpAndSupportHUDView view { get; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

public class TaskbarHUDController : IHUD
{
private const string INTERCOM_URL = "https://intercom.decentraland.org/";
private const string INTERCOM_URL = "https://decentraland.org/help/";

private readonly IChatController chatController;
private readonly IFriendsController friendsController;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ public class DataStore_Common
{
public readonly BaseVariable<bool> isSignUpFlow = new ();
public readonly BaseVariable<bool> isApplicationQuitting = new ();
public readonly BaseDictionary<string, WearableItem> wearables = new ();
public readonly BaseDictionary<string, WearableItem> wearables = new (StringIgnoreCaseEqualityComparer.Default);
public readonly BaseVariable<bool> isPlayerRendererLoaded = new ();
public readonly BaseVariable<AppMode> appMode = new ();
public readonly BaseVariable<NFTPromptModel> onOpenNFTPrompt = new ();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;

namespace DCL
{
public class StringIgnoreCaseEqualityComparer : IEqualityComparer<string>
{
public static StringIgnoreCaseEqualityComparer Default { get; } = new ();

public bool Equals(string x, string y) =>
string.Equals(x, y, StringComparison.OrdinalIgnoreCase);

public int GetHashCode(string obj) =>
StringComparer.OrdinalIgnoreCase.GetHashCode(obj);
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,19 @@ public class BaseDictionary<TKey, TValue> : IBaseDictionary<TKey, TValue>, IEnum
public event Action<TKey, TValue> OnAdded;
public event Action<TKey, TValue> OnRemoved;

internal readonly Dictionary<TKey, TValue> dictionary = new Dictionary<TKey, TValue>();
internal readonly Dictionary<TKey, TValue> dictionary;

public TValue this[TKey key] { get => dictionary[key]; set => dictionary[key] = value; }

public BaseDictionary() { }
public BaseDictionary()
{
dictionary = new Dictionary<TKey, TValue>();
}

public BaseDictionary(IEqualityComparer<TKey> comparer)
{
dictionary = new Dictionary<TKey, TValue>(new Dictionary<TKey, TValue>(), comparer);
}

public BaseDictionary(IEnumerable<(TKey, TValue)> elements)
{
Expand Down
Loading
Loading