Skip to content

Commit

Permalink
Merge branch 'dev' into chore/remove-signed-fetch-origin-referer
Browse files Browse the repository at this point in the history
  • Loading branch information
m3taphysics authored Nov 28, 2024
2 parents 6135f5c + cb4611b commit fce7a4d
Show file tree
Hide file tree
Showing 70 changed files with 1,105 additions and 198 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ MonoBehaviour:
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 12f48d0297bd3f746b92a97878478086
m_Address: VideoPrioritizationSettings
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 134b7bf082a11ae499e9e62958051ca7
m_Address: AnalyticsConfiguration
m_ReadOnly: 0
Expand Down
26 changes: 13 additions & 13 deletions Explorer/Assets/DCL/Audio/Prefabs/MediaPlayer.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -250,31 +250,31 @@ AudioSource:
MinDistance: 40
MaxDistance: 60
Pan2D: 0
rolloffMode: 1
rolloffMode: 2
BypassEffects: 0
BypassListenerEffects: 0
BypassReverbZones: 0
rolloffCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
time: 0.16666667
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
inSlope: -1.6265876
outSlope: 0.01024792
tangentMode: 1
weightedMode: 3
inWeight: 0
outWeight: 0.29192546
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
inSlope: 0.013024294
outSlope: 0.013024294
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
inWeight: 0.28074533
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
Expand All @@ -283,7 +283,7 @@ AudioSource:
m_Curve:
- serializedVersion: 3
time: 0
value: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@ private void UpdateAvatarFromSDKComponent(ref PBAvatarShape pbAvatarShape, ref A
avatarShapeComponent.WearablePromise.ForgetLoading(World);

WearablePromise newPromise = CreateWearablePromise(pbAvatarShape, partition);
avatarShapeComponent.ID = pbAvatarShape.Id;
avatarShapeComponent.Name = pbAvatarShape.Name;
avatarShapeComponent.WearablePromise = newPromise;

avatarShapeComponent.BodyShape = pbAvatarShape;
avatarShapeComponent.HairColor = pbAvatarShape.GetHairColor().ToUnityColor();
avatarShapeComponent.SkinColor = pbAvatarShape.GetSkinColor().ToUnityColor();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,20 @@ public JustTeleported(int expireFrame)
public readonly CancellationToken CancellationToken;

/// <summary>
/// Strictly it's the same report added to "SceneReadinessReportQueue"
/// Strictly it's the same report added to "SceneReadinessReportQueue" <br />
/// Teleport operation will wait for this report to be resolved before finishing the teleport operation <br />
/// Otherwise the teleport operation will be executed immediately
/// </summary>
public readonly AsyncLoadProcessReport? LoadReport;
public readonly AsyncLoadProcessReport? AssetsResolution;

public readonly float CreationTime;

public PlayerTeleportIntent(Vector3 position, Vector2Int parcel, CancellationToken cancellationToken, AsyncLoadProcessReport? loadReport = null)
public PlayerTeleportIntent(Vector3 position, Vector2Int parcel, CancellationToken cancellationToken, AsyncLoadProcessReport? assetsResolution = null)
{
Position = position;
Parcel = parcel;
CancellationToken = cancellationToken;
LoadReport = loadReport;
AssetsResolution = assetsResolution;
CreationTime = Time.realtimeSinceStartup;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using DCL.CharacterMotion.Platforms;
using DCL.CharacterMotion.Settings;
using DCL.Diagnostics;
using DCL.ECSComponents;
using ECS.Abstract;
using ECS.Unity.Transforms.Components;
using UnityEngine;
Expand All @@ -32,7 +33,7 @@ protected override void Update(float t)
}

[Query]
[None(typeof(PlayerLookAtIntent))]
[None(typeof(PlayerLookAtIntent), typeof(PBAvatarShape))]
private void LerpRotation(
[Data] float dt,
ref ICharacterControllerSettings settings,
Expand All @@ -55,6 +56,7 @@ private void LerpRotation(
}

[Query]
[None(typeof(PBAvatarShape))]
private void ForceLookAt(in Entity entity, ref CharacterRigidTransform rigidTransform, ref CharacterTransform transform, in PlayerLookAtIntent lookAtIntent)
{
// Rotate player to look at camera target
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,12 @@ protected override void Update(float t)
[Query]
private void TeleportPlayer(Entity entity, CharacterController controller, ref CharacterPlatformComponent platformComponent, in PlayerTeleportIntent teleportIntent)
{
AsyncLoadProcessReport? loadReport = teleportIntent.LoadReport;
AsyncLoadProcessReport? loadReport = teleportIntent.AssetsResolution;

if (loadReport != null)
if (loadReport == null)
// If there are no assets to wait for, teleport immediately
ResolveAsSuccess(entity, in teleportIntent, controller, ref platformComponent);
else
{
AsyncLoadProcessReport.Status status = loadReport.GetStatus();

Expand All @@ -58,22 +61,22 @@ private void TeleportPlayer(Entity entity, CharacterController controller, ref C
ResolveAsFailure(entity, in teleportIntent, status.Exception!);
return;
}
}

// pending cases left
// pending cases left

if (teleportIntent.TimedOut)
{
var exception = new TimeoutException("Teleport timed out");
loadReport?.SetException(exception);
ResolveAsFailure(entity, in teleportIntent, exception);
return;
}
if (teleportIntent.TimedOut)
{
var exception = new TimeoutException("Teleport timed out");
loadReport?.SetException(exception);
ResolveAsFailure(entity, in teleportIntent, exception);
return;
}

if (teleportIntent.CancellationToken.IsCancellationRequested)
{
loadReport?.SetCancelled();
ResolveAsCancelled(entity, in teleportIntent);
if (teleportIntent.CancellationToken.IsCancellationRequested)
{
loadReport?.SetCancelled();
ResolveAsCancelled(entity, in teleportIntent);
}
}
}

Expand All @@ -91,7 +94,7 @@ private void FinalizeQueuedLoadReport(in PlayerTeleportIntent intent, Action<Asy
{
AsyncLoadProcessReport report = loadReport[i];

if (report == intent.LoadReport) // it's the same report, it was already finalized
if (report == intent.AssetsResolution) // it's the same report, it was already finalized
continue;

setState(report);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@ public void CleanUp()
UnityObjectUtils.SafeDestroyGameObject(characterController);
}

[Test]
public void ResolveTeleportImmediatelyWithoutAssetsToWait()
{
Entity e = world.Create(characterController, new CharacterPlatformComponent(), new PlayerTeleportIntent(new Vector3(100, 100, 100), new Vector2Int(22, 22), CancellationToken.None));

system!.Update(0);

Assert.That(world.Has<PlayerTeleportIntent>(e), Is.False);
Assert.That(characterController.transform.position, Is.EqualTo(new Vector3(100, 100, 100)));
}

[Test]
public async Task RestoreCameraDataOnFailureAsync([Values(UniTaskStatus.Faulted, UniTaskStatus.Canceled)] UniTaskStatus status)
{
Expand Down
3 changes: 2 additions & 1 deletion Explorer/Assets/DCL/Editor/DCL.Editor.asmdef
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"GUID:166b65e6dfc848bb9fb075f53c293a38",
"GUID:fa7b3fdbb04d67549916da7bd2af58ab",
"GUID:d28a7e4beeca475418c15757abf1b6f1",
"GUID:286980af24684da6acc1caa413039811"
"GUID:286980af24684da6acc1caa413039811",
"GUID:fc37ca6521833154cab08ec51af097d9"
],
"includePlatforms": [
"Editor"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Arch.SystemGroups.DefaultSystemGroups;
using Cysharp.Threading.Tasks;
using DCL.Character.Components;
using DCL.ECSComponents;
using DCL.MapRenderer.CoordsUtils;
using DCL.MapRenderer.Culling;
using MVC;
Expand Down Expand Up @@ -54,8 +55,9 @@ public void CreateSystems(ref ArchSystemsWorldBuilder<World> builder)
system.Activate();
}

[All(typeof(PlayerComponent))]
[Query]
[All(typeof(PlayerComponent))]
[None(typeof(PBAvatarShape))]
private void SetPlayerTransform(in CharacterTransform transformComponent)
{
SetPosition(transformComponent.Transform.position);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using DCL.AvatarRendering.AvatarShape.Components;
using DCL.Character.Components;
using DCL.CharacterPreview.Components;
using DCL.ECSComponents;
using DCL.MapRenderer.CoordsUtils;
using DCL.MapRenderer.Culling;
using DCL.MapRenderer.MapLayers.UsersMarker;
Expand Down Expand Up @@ -59,7 +60,7 @@ public void CreateSystems(ref ArchSystemsWorldBuilder<World> builder)
}

[Query]
[None(typeof(PlayerComponent), typeof(CharacterPreviewComponent), typeof(DeleteEntityIntention))]
[None(typeof(PlayerComponent), typeof(CharacterPreviewComponent), typeof(PBAvatarShape), typeof(DeleteEntityIntention))]
private void SetPlayerMarker(in CharacterTransform transformComponent, in AvatarShapeComponent avatarShape)
{
if (!isEnabled)
Expand Down
3 changes: 2 additions & 1 deletion Explorer/Assets/DCL/Minimap/Minimap.asmdef
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"GUID:766b242fb43af451aaa331f39872177d",
"GUID:d832748739a186646b8656bdbd447ad0",
"GUID:286980af24684da6acc1caa413039811",
"GUID:1300820cd310d4584b09afde765bdd16"
"GUID:1300820cd310d4584b09afde765bdd16",
"GUID:3c7b57a14671040bd8c549056adc04f5"
],
"includePlatforms": [],
"excludePlatforms": [],
Expand Down
4 changes: 3 additions & 1 deletion Explorer/Assets/DCL/Minimap/MinimapController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using DCL.Chat.Commands;
using DCL.Chat.MessageBus;
using DCL.Diagnostics;
using DCL.ECSComponents;
using DCL.ExplorePanel;
using DCL.MapRenderer;
using DCL.MapRenderer.CommonBehavior;
Expand Down Expand Up @@ -155,8 +156,9 @@ private void HidePinInMinimapEdge()
}


[All(typeof(PlayerComponent))]
[Query]
[All(typeof(PlayerComponent))]
[None(typeof(PBAvatarShape))]
private void QueryPlayerPosition(in CharacterTransform transformComponent)
{
Vector3 position = transformComponent.Position;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using DCL.CharacterMotion.Settings;
using DCL.CharacterMotion.Utils;
using DCL.Diagnostics;
using DCL.ECSComponents;
using DCL.Multiplayer.Movement.Settings;
using ECS.Abstract;
using ECS.LifeCycle.Components;
Expand Down Expand Up @@ -47,7 +48,7 @@ private void HandleFirstMessage(ref CharacterTransform transComp, in NetworkMove
}

[Query]
[None(typeof(PlayerComponent), typeof(DeleteEntityIntention))]
[None(typeof(PlayerComponent), typeof(PBAvatarShape), typeof(DeleteEntityIntention))]
private void UpdateRemotePlayersMovement([Data] float deltaTime, ref CharacterTransform transComp,
ref RemotePlayerMovementComponent remotePlayerMovement, ref InterpolationComponent intComp, ref ExtrapolationComponent extComp)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using CrdtEcsBridge.Components;
using DCL.Character.Components;
using DCL.Diagnostics;
using DCL.ECSComponents;
using DCL.Multiplayer.Profiles.Systems;
using DCL.Multiplayer.SDK.Components;
using DCL.Profiles;
Expand Down Expand Up @@ -46,7 +47,7 @@ protected override void Update(float t)

[Query]
[All(typeof(Profile))]
[None(typeof(PlayerCRDTEntity), typeof(DeleteEntityIntention))]
[None(typeof(PlayerCRDTEntity), typeof(PBAvatarShape), typeof(DeleteEntityIntention))]
private void AddPlayerCRDTEntity(Entity entity, in CharacterTransform characterTransform)
{
// Reserve entity straight-away, numeration will be preserved across all scenes
Expand All @@ -63,7 +64,7 @@ private void AddPlayerCRDTEntity(Entity entity, in CharacterTransform characterT
}

[Query]
[None(typeof(DeleteEntityIntention))]
[None(typeof(DeleteEntityIntention), typeof(PBAvatarShape))]
private void ModifyPlayerScene(in CharacterTransform characterTransform, ref PlayerCRDTEntity playerCRDTEntity)
{
ResolvePlayerCRDTScene(characterTransform, ref playerCRDTEntity, playerCRDTEntity.CRDTEntity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@
using DCL.Multiplayer.SDK.Components;
using DCL.Optimization.Pools;
using ECS.Abstract;
using ECS.Groups;
using ECS.LifeCycle.Components;
using Utility;
using Quaternion = UnityEngine.Quaternion;
using Vector3 = UnityEngine.Vector3;

namespace DCL.Multiplayer.SDK.Systems.GlobalWorld
{
Expand Down
8 changes: 4 additions & 4 deletions Explorer/Assets/DCL/NameTags/NametagView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,27 +87,27 @@ public void InjectConfiguration(ChatBubbleConfigurationSO chatBubbleConfiguratio
messageContentAnchoredPosition = new (0, chatBubbleConfiguration.bubbleMarginOffsetHeight / 3);
}

public void SetUsername(string username, string walletId, bool hasClaimedName)
public void SetUsername(string username, string walletId, bool hasClaimedName, bool useVerifiedIcon)
{
ResetElement();

cts.SafeCancelAndDispose();
cts = new CancellationTokenSource();

isClaimedName = hasClaimedName;
VerifiedIcon.gameObject.SetActive(hasClaimedName);
VerifiedIcon.gameObject.SetActive(hasClaimedName && useVerifiedIcon);
Username.text = hasClaimedName ? username : $"{username}<color=#FFFFFF66><font=\"LiberationSans SDF\">#{walletId}</font></color>";
Username.rectTransform.sizeDelta = new Vector2(Username.preferredWidth, DEFAULT_HEIGHT);
MessageContent.color = startingTextColor;

float nametagMarginOffsetHeight = chatBubbleConfiguration?.nametagMarginOffsetHeight ?? DEFAULT_MARGIN_OFFSET_HEIGHT;
float nametagMarginOffsetWidth = chatBubbleConfiguration?.nametagMarginOffsetWidth ?? DEFAULT_MARGIN_OFFSET_WIDTH;

if (hasClaimedName)
if (hasClaimedName && useVerifiedIcon)
{
usernamePos.x = Username.rectTransform.anchoredPosition.x;
verifiedIconInitialPosition = new Vector2(Username.rectTransform.anchoredPosition.x + (Username.preferredWidth / 2) + (VerifiedIcon.sizeDelta.x / 2) - (nametagMarginOffsetHeight / 2), 0);
VerifiedIcon.anchoredPosition = verifiedIconInitialPosition;
usernamePos.x = Username.rectTransform.anchoredPosition.x;
usernamePos.x -= VerifiedIcon.sizeDelta.x / 2;
Username.rectTransform.anchoredPosition = usernamePos;
Background.size = new Vector2(Username.preferredWidth + nametagMarginOffsetWidth + VerifiedIcon.sizeDelta.x, Username.preferredHeight + nametagMarginOffsetHeight);
Expand Down
Loading

0 comments on commit fce7a4d

Please sign in to comment.