Skip to content

Commit

Permalink
Merge pull request #2848 from decentraland/release/release-21-11-2024
Browse files Browse the repository at this point in the history
release: 21-11-2024
  • Loading branch information
m3taphysics authored Nov 21, 2024
2 parents b12b09d + 65013f6 commit 94d6dc5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ protected override void Update(float t)
private void CompleteWearableABThumbnailDownload(Entity entity, ref IAvatarAttachment wearable, ref AssetBundlePromise promise)
{
if (promise.TryForgetWithEntityIfCancelled(entity, World!))
{
wearable.ThumbnailAssetResult = null;
return;
}


if (promise.TryConsume(World, out var result))
{
Expand All @@ -45,12 +49,14 @@ private void CompleteWearableABThumbnailDownload(Entity entity, ref IAvatarAttac
private void CompleteWearableThumbnailDownload(Entity entity, ref IAvatarAttachment wearable, ref Promise promise)
{
if (promise.TryForgetWithEntityIfCancelled(entity, World!))
{
wearable.ThumbnailAssetResult = null;
return;
}

if (promise.TryConsume(World, out StreamableLoadingResult<Texture2DData> result))
{
wearable.ThumbnailAssetResult = result.ToFullRectSpriteData(LoadThumbnailsUtils.DEFAULT_THUMBNAIL);

World.Destroy(entity);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public class ECSPortableExperiencesController : IPortableExperiencesController
private readonly IScenesCache scenesCache;
private readonly World globalWorld;
private readonly List<IPortableExperiencesController.SpawnResponse> spawnResponsesList = new ();
private readonly ServerAbout serverAbout = new ();
private readonly FeatureFlagsCache featureFlagsCache;
public Dictionary<ENS, Entity> PortableExperienceEntities { get; } = new ();

Expand Down Expand Up @@ -61,17 +60,20 @@ public ECSPortableExperiencesController(
}
}

if (PortableExperienceEntities.ContainsKey(ens)) throw new Exception($"ENS {ens} is already loaded");

string worldUrl = string.Empty;

if (ens.IsValid) { worldUrl = ens.ConvertEnsToWorldUrl(); }

if (!worldUrl.IsValidUrl()) throw new ArgumentException("Invalid Spawn params. Provide a valid ENS name");
if (!worldUrl.IsValidUrl()) throw new ArgumentException($"Invalid Spawn params. Provide a valid ENS name {ens}");

var portableExperiencePath = URLDomain.FromString(worldUrl);
URLAddress url = portableExperiencePath.Append(new URLPath("/about"));

GenericDownloadHandlerUtils.Adapter<GenericGetRequest, GenericGetArguments> genericGetRequest = webRequestController.GetAsync(new CommonArguments(url), ct, ReportCategory.REALM);

ServerAbout serverAbout = new ServerAbout();
ServerAbout result = await genericGetRequest.OverwriteFromJsonAsync(serverAbout, WRJsonParser.Unity);

if (result.configurations.scenesUrn.Count == 0)
Expand All @@ -90,9 +92,11 @@ public ECSPortableExperiencesController(
portableExperiencePath.Value
);


ISceneFacade parentScene = scenesCache.Scenes.FirstOrDefault(s => s.SceneStateProvider.IsCurrent);
string parentSceneName = parentScene != null ? parentScene.Info.Name : "main";
Entity portableExperienceEntity = globalWorld.Create(new PortableExperienceRealmComponent(realmData, parentSceneName, isGlobalPortableExperience), new PortableExperienceComponent(ens));

PortableExperienceEntities.Add(ens, portableExperienceEntity);

return new IPortableExperiencesController.SpawnResponse
Expand Down

0 comments on commit 94d6dc5

Please sign in to comment.