Skip to content

Commit

Permalink
Merge pull request #2996 from decentraland/release/release-12-12-2024
Browse files Browse the repository at this point in the history
release: 12-12-2024
  • Loading branch information
m3taphysics authored Dec 12, 2024
2 parents 5b58adb + eb04fb6 commit e38cdfc
Show file tree
Hide file tree
Showing 76 changed files with 5,368 additions and 4,418 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/on-delete-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: On Delete Latest Release

on:
release:
types:
- deleted

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 Deleted and Update Latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
id: check_latest
run: |
DELETED_RELEASE_TAG=$(jq -r .release.tag_name "$GITHUB_EVENT_PATH")
echo "Deleted Release Tag: $DELETED_RELEASE_TAG"
# Fetch the current latest release from the API
LATEST_RELEASE=$(curl -H "Authorization: Bearer $GITHUB_TOKEN" -s "https://api.github.com/repos/${{ github.repository }}/releases/latest" | jq -r .tag_name)
echo "Latest Release Tag: $LATEST_RELEASE"
echo "latest_release=$LATEST_RELEASE" >> $GITHUB_OUTPUT
- name: Run actions if release is the latest
if: ${{ steps.check_latest.outputs.latest_release != '' }}
env:
AWS_MAX_ATTEMPTS: 3
AWS_RETRY_MODE: standard
AWS_ACCESS_KEY_ID: ${{ secrets.EXPLORER_TEAM_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.EXPLORER_TEAM_AWS_SECRET_ACCESS_KEY }}
EXPLORER_TEAM_S3_BUCKET: ${{ secrets.EXPLORER_TEAM_S3_BUCKET }}
RELEASES_PATH: ${{ format('@dcl/{0}/releases', github.event.repository.name) }}
LATEST_RELEASE: ${{ steps.check_latest.outputs.latest_release }}
run: |
echo '{
"version": "${{ env.LATEST_RELEASE }}",
"timestamp": "'$(date -u +"%Y-%m-%dT%H:%M:%SZ")'"
}' > latest.json
aws s3 cp latest.json s3://$EXPLORER_TEAM_S3_BUCKET/$RELEASES_PATH/latest.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public JustTeleported(int expireFrame)
}
}

public static readonly TimeSpan TIMEOUT = TimeSpan.FromSeconds(30);
public static readonly TimeSpan TIMEOUT = TimeSpan.FromMinutes(2);

public readonly Vector2Int Parcel;
public readonly Vector3 Position;
Expand Down
4 changes: 2 additions & 2 deletions Explorer/Assets/DCL/ExplorePanel/ExplorePanelController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ private void RegisterHotkeys()
dclInput.Shortcuts.Map.performed += OnMapHotkeyPressed;
dclInput.Shortcuts.Settings.performed += OnSettingsHotkeyPressed;
dclInput.Shortcuts.Backpack.performed += OnBackpackHotkeyPressed;
dclInput.Shortcuts.CameraReel.performed += OnCameraReelHotkeyPressed;
dclInput.InWorldCamera.CameraReel.performed += OnCameraReelHotkeyPressed;
}

private void OnCameraReelHotkeyPressed(InputAction.CallbackContext ctx)
Expand Down Expand Up @@ -263,7 +263,7 @@ private void UnRegisterHotkeys()
dclInput.Shortcuts.Map.performed -= OnMapHotkeyPressed;
dclInput.Shortcuts.Settings.performed -= OnSettingsHotkeyPressed;
dclInput.Shortcuts.Backpack.performed -= OnBackpackHotkeyPressed;
dclInput.Shortcuts.CameraReel.performed -= OnCameraReelHotkeyPressed;
dclInput.InWorldCamera.CameraReel.performed -= OnCameraReelHotkeyPressed;
}

private void BlockUnwantedInputs()
Expand Down
4 changes: 2 additions & 2 deletions Explorer/Assets/DCL/ExplorePanel/ExplorePanelInputHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private void RegisterHotkeys()
dclInput.Shortcuts.Map.performed += OnMapHotkeyPressed;
dclInput.Shortcuts.Settings.performed += OnSettingsHotkeyPressed;
dclInput.Shortcuts.Backpack.performed += OnBackpackHotkeyPressed;
dclInput.Shortcuts.CameraReel.performed += OnCameraReelHotkeyPressed;
dclInput.InWorldCamera.CameraReel.performed += OnCameraReelHotkeyPressed;
}

private void UnregisterHotkeys()
Expand All @@ -64,7 +64,7 @@ private void UnregisterHotkeys()
dclInput.Shortcuts.Map.performed -= OnMapHotkeyPressed;
dclInput.Shortcuts.Settings.performed -= OnSettingsHotkeyPressed;
dclInput.Shortcuts.Backpack.performed -= OnBackpackHotkeyPressed;
dclInput.Shortcuts.CameraReel.performed -= OnCameraReelHotkeyPressed;
dclInput.InWorldCamera.CameraReel.performed -= OnCameraReelHotkeyPressed;

foreach (var escapeAction in escapeActions)
dclInput.UI.Close.performed -= escapeAction;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public class ScreenshotMetadata
public string userName;
public string userAddress;
public string dateTime;
public string placeId;
public string realm;
public Scene scene;
public VisiblePerson[] visiblePeople;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public async UniTask CaptureMetadata()
Profile profile = await CreateProfile().ProfileAsync(default(CancellationToken));

var builder = new ScreenshotMetadataBuilder(null, null, null, null);
builder.FillMetadata(profile, null, Vector2Int.one, "Test Playground", Array.Empty<VisiblePerson>());
builder.FillMetadata(profile, null, Vector2Int.one, "Test Playground", "Test place id", Array.Empty<VisiblePerson>());
metadata = builder.GetMetadataAndReset();
hud.Metadata = metadata;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
using System;

namespace DCL.InWorldCamera.Systems
{
public sealed class ScreenshotLimitReachedException : Exception { }
}

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 @@ -69,21 +69,21 @@ public void AddProfile(Profile profile, Collider avatarCollider)

public async UniTask BuildAsync(CancellationToken ct)
{
string? sceneName = await GetSceneNameAsync(sceneParcel, ct);
(string sceneName, string placeId) = await GetSceneInfoAsync(sceneParcel, ct);

FillMetadata(selfProfile.OwnProfile, realmData, sceneParcel, sceneName, visiblePeople.ToArray());
FillMetadata(selfProfile.OwnProfile, realmData, sceneParcel, sceneName, placeId, visiblePeople.ToArray());

MetadataIsReady = true;
}

private async UniTask<string> GetSceneNameAsync(Vector2Int at, CancellationToken ct)
private async UniTask<(string, string)> GetSceneInfoAsync(Vector2Int at, CancellationToken ct)
{
if (realmData.ScenesAreFixed)
return realmData.RealmName.Replace(".dcl.eth", string.Empty);
return (realmData.RealmName.Replace(".dcl.eth", string.Empty), "not applicable");

PlacesData.PlaceInfo? placeInfo = await placesAPIService.GetPlaceAsync(at, ct);

return placeInfo?.title ?? "Unknown place";
return (placeInfo?.title ?? "Unknown place", placeInfo.id);
}

private static string[] FilterNonBaseWearables(IReadOnlyCollection<URN> avatarWearables)
Expand All @@ -97,7 +97,8 @@ private static string[] FilterNonBaseWearables(IReadOnlyCollection<URN> avatarWe
return wearables.ToArray();
}

internal void FillMetadata(Profile profile, RealmData realm, Vector2Int playerPosition, string sceneName, VisiblePerson[] visiblePeople)
internal void FillMetadata(Profile profile, RealmData realm, Vector2Int playerPosition,
string sceneName, string placeId, VisiblePerson[] visiblePeople)
{
if (metadata == null)
metadata = new ScreenshotMetadata
Expand All @@ -106,6 +107,7 @@ internal void FillMetadata(Profile profile, RealmData realm, Vector2Int playerPo
userAddress = profile.UserId,
dateTime = DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString(),
realm = realm?.RealmName,
placeId = placeId,
scene = new Scene
{
name = sceneName,
Expand All @@ -119,6 +121,7 @@ internal void FillMetadata(Profile profile, RealmData realm, Vector2Int playerPo
metadata.userAddress = profile.UserId;
metadata.dateTime = DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString();
metadata.realm = realm?.RealmName;
metadata.placeId = placeId;
metadata.scene.name = sceneName;
metadata.scene.location = new Location(playerPosition);
metadata.visiblePeople = visiblePeople;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using DCL.Multiplayer.Profiles.Entities;
using DCL.Profiles;
using ECS.Abstract;
using System;
using System.Threading;
using UnityEngine;
using Utility;
Expand Down Expand Up @@ -71,7 +72,7 @@ public override void Dispose()

protected override void Update(float t)
{
if (recorder.State == RecordingState.CAPTURING)
if (recorder.State == RecordingState.CAPTURING || hudController.IsVfxInProgress)
return;

if (recorder.State == RecordingState.SCREENSHOT_READY && metadataBuilder.MetadataIsReady)
Expand All @@ -93,11 +94,23 @@ private void ProcessCapturedScreenshot()
screenshot = recorder.GetScreenshotAndReset();
metadata = metadataBuilder.GetMetadataAndReset();

cameraReelStorageService.UploadScreenshotAsync(screenshot, metadata, ctx.Token).Forget();
try
{
cameraReelStorageService.UploadScreenshotAsync(screenshot, metadata, ctx.Token).Forget();

hudController.Show();
hudController.PlayScreenshotFX(screenshot, SPLASH_FX_DURATION, MIDDLE_PAUSE_FX_DURATION, IMAGE_TRANSITION_FX_DURATION);
hudController.DebugCapture(screenshot, metadata);
hudController.Show();
hudController.PlayScreenshotFX(screenshot, SPLASH_FX_DURATION, MIDDLE_PAUSE_FX_DURATION, IMAGE_TRANSITION_FX_DURATION);
hudController.DebugCapture(screenshot, metadata);
}
catch (OperationCanceledException) { }
catch (ScreenshotLimitReachedException)
{
hudController.Show();
}
catch (Exception e)
{
ReportHub.LogException(e, ReportCategory.CAMERA_REEL);
}
}

private bool ScreenshotIsRequested()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using DCL.Diagnostics;
using ECS.Abstract;
using UnityEngine;
using UnityEngine.InputSystem;

namespace DCL.InWorldCamera.Systems
{
Expand All @@ -14,14 +13,12 @@ namespace DCL.InWorldCamera.Systems
public partial class EmitInWorldCameraInputSystem : BaseUnityLoopSystem
{
private readonly DCLInput.InWorldCameraActions inputSchema;
private readonly InputAction toggleInWorldCameraShortcut;

private SingleInstanceEntity camera;

public EmitInWorldCameraInputSystem(World world, DCLInput.InWorldCameraActions inputSchema, InputAction toggleInWorldCameraShortcut) : base(world)
public EmitInWorldCameraInputSystem(World world, DCLInput.InWorldCameraActions inputSchema) : base(world)
{
this.inputSchema = inputSchema;
this.toggleInWorldCameraShortcut = toggleInWorldCameraShortcut;
}

public override void Initialize()
Expand All @@ -31,9 +28,12 @@ public override void Initialize()

protected override void Update(float t)
{
if (toggleInWorldCameraShortcut.triggered)
if (inputSchema.ToggleInWorldCamera.triggered)
World.Add(camera, new ToggleInWorldCameraRequest { IsEnable = !World.Has<InWorldCameraComponent>(camera) });

if (inputSchema.CameraReel.triggered)
World.Add(camera, new ToggleInWorldCameraRequest { IsEnable = false });

ref InWorldCameraInput input = ref World.TryGetRef<InWorldCameraInput>(camera, out bool exists);

if (exists)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@
using DCL.CharacterCamera;
using DCL.CharacterCamera.Components;
using DCL.CharacterCamera.Systems;
using DCL.DebugUtilities;
using DCL.Diagnostics;
using DCL.Input;
using DCL.Input.Component;
using DCL.InWorldCamera.Settings;
using DCL.InWorldCamera.UI;
using ECS.Abstract;
using MVC;
using System;
using UnityEngine;
using UnityEngine.InputSystem;
using static DCL.Input.Component.InputMapComponent;

namespace DCL.InWorldCamera.Systems
Expand All @@ -31,28 +32,34 @@ public partial class ToggleInWorldCameraActivitySystem : BaseUnityLoopSystem
private readonly InWorldCameraController hudController;
private readonly GameObject hud;
private readonly CharacterController followTarget;
private readonly IDebugContainerBuilder debugContainerBuilder;
private readonly ICursor cursor;
private readonly IMVCManager mvcManager;
private readonly DCLInput.InWorldCameraActions inputSchema;

private SingleInstanceEntity camera;
private SingleInstanceEntity inputMap;

private ICinemachinePreset cinemachinePreset;
private CinemachineVirtualCamera inWorldVirtualCamera;
private bool wasDebugVisible;

public ToggleInWorldCameraActivitySystem(
World world,
InWorldCameraTransitionSettings settings,
InWorldCameraController hudController,
CharacterController followTarget,
IDebugContainerBuilder debugContainerBuilder,
ICursor cursor,
IMVCManager mvcManager) : base(world)
IMVCManager mvcManager, DCLInput.InWorldCameraActions inputSchema) : base(world)
{
this.settings = settings;
this.hudController = hudController;
this.followTarget = followTarget;
this.debugContainerBuilder = debugContainerBuilder;
this.cursor = cursor;
this.mvcManager = mvcManager;
this.inputSchema = inputSchema;

behindUpOffset = Vector3.up * settings.BehindUpOffset;
}
Expand All @@ -70,17 +77,20 @@ public override void Initialize()

protected override void Update(float t)
{
if (World.Has<InWorldCameraComponent>(camera) && BlendingHasFinished())
SetFollowTarget();
if (World.Has<InWorldCameraComponent>(camera) && !cinemachinePreset.Brain.IsBlending)
{
if (!followTarget.enabled)
SetFollowTarget();

if (inputSchema.ShowHide.triggered)
hudController.ToggleVisibility();
}

if (World.TryGet(camera, out ToggleInWorldCameraRequest request))
{
ToggleCamera(request.IsEnable);
World.Remove<ToggleInWorldCameraRequest>(camera);
}

bool BlendingHasFinished() =>
!followTarget.enabled && !cinemachinePreset.Brain.IsBlending;
}

private void ToggleCamera(bool enable)
Expand Down Expand Up @@ -112,13 +122,16 @@ private void SetFollowTarget()

private void DisableCamera()
{
if (debugContainerBuilder?.Container != null)
debugContainerBuilder.IsVisible = wasDebugVisible;

hudController.Hide();
mvcManager.SetAllViewsCanvasActiveExcept<InWorldCameraController>(true);
mvcManager.SetAllViewsCanvasActive(except: hudController, true);

SwitchToThirdPersonCamera();

cursor.Unlock();
ref var cursorComponent = ref World.Get<CursorComponent>(camera);
ref CursorComponent cursorComponent = ref World.Get<CursorComponent>(camera);
cursorComponent.CursorState = CursorState.Free;

SwitchCameraInput(to: Kind.PLAYER);
Expand All @@ -128,13 +141,19 @@ private void DisableCamera()

private void EnableCamera()
{
if (debugContainerBuilder?.Container != null)
{
wasDebugVisible = debugContainerBuilder.IsVisible;
debugContainerBuilder.IsVisible = false;
}

hudController.Show();
mvcManager.SetAllViewsCanvasActiveExcept<InWorldCameraController>(false);
mvcManager.SetAllViewsCanvasActive(except: hudController, false);

SwitchToInWorldCamera();

cursor.Lock();
ref var cursorComponent = ref World.Get<CursorComponent>(camera);
ref CursorComponent cursorComponent = ref World.Get<CursorComponent>(camera);
cursorComponent.CursorState = CursorState.Locked;

SwitchCameraInput(to: Kind.IN_WORLD_CAMERA);
Expand Down Expand Up @@ -214,9 +233,11 @@ private void SwitchCameraInput(Kind to)
case Kind.IN_WORLD_CAMERA:
inputMapComponent.UnblockInput(Kind.IN_WORLD_CAMERA);
inputMapComponent.BlockInput(Kind.PLAYER);
inputMapComponent.BlockInput(Kind.SHORTCUTS);
break;
case Kind.PLAYER:
inputMapComponent.UnblockInput(Kind.PLAYER);
inputMapComponent.UnblockInput(Kind.SHORTCUTS);
inputMapComponent.BlockInput(Kind.IN_WORLD_CAMERA);
break;
}
Expand Down
Loading

0 comments on commit e38cdfc

Please sign in to comment.