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: 21-10-24 (v38) #2522

Merged
merged 16 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build-release-main-page.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: 'main'

- name: Get version
id: get_version
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/pr-comment-artifact-url.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ jobs:
if [[ $GITHUB_REF == refs/tags/v* ]]; then
ARTIFACT_S3_DESTINATION_PATH="@dcl/$REPO/releases/$GITHUB_REF_NAME"
else
ARTIFACT_S3_DESTINATION_PATH="@dcl/$REPO/branch/${GITHUB_HEAD_REF:-$GITHUB_REF_NAME}"
HEAD_BRANCH=$(jq -r '.pull_requests[0].head.ref' \
<<< "$WORKFLOW_RUN_EVENT_OBJ")
ARTIFACT_S3_DESTINATION_PATH="@dcl/$REPO/branch/$HEAD_BRANCH"
fi

echo "Artifact S3 Destination Path: $ARTIFACT_S3_DESTINATION_PATH"
Expand Down Expand Up @@ -90,9 +92,9 @@ jobs:
env:
JOB_PATH: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ env.PREVIOUS_JOB_ID }}"
WINDOWS_ARTIFACT_URL: "${{ github.server_url }}/${{ github.repository }}/suites/${{ env.SUITE_ID }}/artifacts/${{ env.WINDOWS_ARTIFACT_ID }}"
WINDOWS_ARTIFACT_S3_URL: "${{ format('https://{0}.s3.amazonaws.com/{1}/Decentraland_windows64.zip', secrets.EXPLORER_TEAM_S3_BUCKET, env.ARTIFACT_S3_DESTINATION_PATH) }}"
WINDOWS_ARTIFACT_S3_URL: "${{ format('{0}/{1}/Decentraland_windows64.zip', vars.EXPLORER_TEAM_S3_BUCKET_PUBLIC_URL, env.ARTIFACT_S3_DESTINATION_PATH) }}"
MAC_ARTIFACT_URL: "${{ github.server_url }}/${{ github.repository }}/suites/${{ env.SUITE_ID }}/artifacts/${{ env.MAC_ARTIFACT_ID }}"
MAC_ARTIFACT_S3_URL: "${{ format('https://{0}.s3.amazonaws.com/{1}/Decentraland_macos.zip', secrets.EXPLORER_TEAM_S3_BUCKET, env.ARTIFACT_S3_DESTINATION_PATH) }}"
MAC_ARTIFACT_S3_URL: "${{ format('{0}/{1}/Decentraland_macos.zip', vars.EXPLORER_TEAM_S3_BUCKET_PUBLIC_URL, env.ARTIFACT_S3_DESTINATION_PATH) }}"
HEAD_SHA: "${{ env.HEAD_SHA }}"
uses: peter-evans/create-or-update-comment@v3
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ private void CompleteWearableABThumbnailDownload(Entity entity, ref IAvatarAttac
if (promise.TryConsume(World, out var 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 @@ -50,7 +50,7 @@ private async UniTaskVoid SendSelfAsync(string message)

if (identity == null)
{
ReportHub.LogWarning(ReportCategory.ARCHIPELAGO_REQUEST, "SelfResendChatMessageBus.Send: Identity is null, can't send message");
ReportHub.LogWarning(ReportCategory.COMMS_SCENE_HANDLER, "SelfResendChatMessageBus.Send: Identity is null, can't send message");
return;
}

Expand Down
14 changes: 0 additions & 14 deletions Explorer/Assets/DCL/CommunicationData/URLHelpers/URLAddress.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,11 @@ namespace CommunicationData.URLHelpers
public readonly struct URLAddress : IEquatable<URLAddress>, IEquatable<string>
{
public static readonly URLAddress EMPTY = new (string.Empty);

public readonly string Value;
private readonly string CacheableURL;

private static readonly string HTTP_STARTER = "https";
private static readonly string VALIDATION_PATTERN = "/v[0-9]+/";

internal URLAddress(string value)
{
Value = value;

if (!string.IsNullOrEmpty(Value) && Value.StartsWith(HTTP_STARTER))
CacheableURL = Regex.Replace(Value, VALIDATION_PATTERN, "/");
else
CacheableURL = Value;
}

public static implicit operator string(in URLAddress address) =>
Expand Down Expand Up @@ -56,9 +46,5 @@ public override int GetHashCode() =>
public override string ToString() =>
Value;

public string GetCacheableURL()
{
return CacheableURL;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ static GlobalDeferredLoadingSystem()
CreateQuery<GetWearableAssetBundleManifestIntention, SceneAssetBundleManifest>(),
CreateQuery<GetAssetBundleIntention, AssetBundleData>(),
CreateQuery<GetGLTFIntention, GLTFData>(),
CreateQuery<GetProfileIntention, Profile>(),
CreateQuery<GetTextureIntention, Texture2D>(),
CreateQuery<GetNFTShapeIntention, Texture2D>(),
CreateQuery<GetProfileIntention, ProfileData>(),
CreateQuery<GetTextureIntention, Texture2DData>(),
CreateQuery<GetNFTShapeIntention, Texture2DData>(),
CreateQuery<GetEmotesByPointersFromRealmIntention, EmotesDTOList>(),
CreateQuery<GetOwnedEmotesFromRealmIntention, EmotesResolution>(),
CreateQuery<GetAudioClipIntention, AudioClip>(),
CreateQuery<GetAudioClipIntention, AudioClipData>(),
};
}

Expand Down
3 changes: 1 addition & 2 deletions Explorer/Assets/DCL/Landscape/TerrainGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
using Unity.Jobs;
using Unity.Mathematics;
using UnityEngine;
using UnityEngine.Profiling;
using Utility;
using JobHandle = Unity.Jobs.JobHandle;

Expand All @@ -28,7 +27,7 @@ public class TerrainGenerator : IDisposable, IContainParcel
private const float ROOT_VERTICAL_SHIFT = -0.01f; // fix for not clipping with scene (potential) floor

// increment this number if we want to force the users to generate a new terrain cache
private const int CACHE_VERSION = 7;
private const int CACHE_VERSION = 8;

private const float PROGRESS_COUNTER_EMPTY_PARCEL_DATA = 0.1f;
private const float PROGRESS_COUNTER_TERRAIN_DATA = 0.3f;
Expand Down
2 changes: 1 addition & 1 deletion Explorer/Assets/DCL/MapPins/Systems/MapPinLoaderSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ private bool TryCreateGetTexturePromise(in TextureComponent? textureComponent, r

DereferenceTexture(ref promise);

promise = Promise.Create(World, new GetTextureIntention(textureComponentValue.Src, textureComponentValue.WrapMode, textureComponentValue.FilterMode, attemptsCount: ATTEMPTS_COUNT), partitionComponent);
promise = Promise.Create(World, new GetTextureIntention(textureComponentValue.Src, textureComponentValue.FileHash, textureComponentValue.WrapMode, textureComponentValue.FilterMode, attemptsCount: ATTEMPTS_COUNT), partitionComponent);
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class AutoReconnectLiveConnection : IArchipelagoLiveConnection

public AutoReconnectLiveConnection(IArchipelagoLiveConnection origin) : this(
origin,
m => ReportHub.Log(ReportCategory.ARCHIPELAGO_REQUEST, m)
m => ReportHub.Log(ReportCategory.COMMS_SCENE_HANDLER, m)
) { }

public AutoReconnectLiveConnection(IArchipelagoLiveConnection origin, Action<string> log)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public bool IsConnected
if (previousConnected != result)
{
ReportHub
.WithReport(ReportCategory.ARCHIPELAGO_REQUEST)
.WithReport(ReportCategory.COMMS_SCENE_HANDLER)
.Log($"ArchipelagoLiveConnection connected: {result}");
previousConnected = result;
}
Expand All @@ -40,46 +40,46 @@ public LogArchipelagoLiveConnection(IArchipelagoLiveConnection origin)
public async UniTask<Result> ConnectAsync(string adapterUrl, CancellationToken token)
{
ReportHub
.WithReport(ReportCategory.ARCHIPELAGO_REQUEST)
.WithReport(ReportCategory.COMMS_SCENE_HANDLER)
.Log($"ArchipelagoLiveConnection ConnectAsync start to: {adapterUrl}");
var result = await origin.ConnectAsync(adapterUrl, token);
ReportHub
.WithReport(ReportCategory.ARCHIPELAGO_REQUEST)
.WithReport(ReportCategory.COMMS_SCENE_HANDLER)
.Log($"ArchipelagoLiveConnection ConnectAsync finished to: {adapterUrl} with result: {result.Success}");
return result;
}

public async UniTask DisconnectAsync(CancellationToken token)
{
ReportHub
.WithReport(ReportCategory.ARCHIPELAGO_REQUEST)
.WithReport(ReportCategory.COMMS_SCENE_HANDLER)
.Log("ArchipelagoLiveConnection DisconnectAsync start");
await origin.DisconnectAsync(token);
ReportHub
.WithReport(ReportCategory.ARCHIPELAGO_REQUEST)
.WithReport(ReportCategory.COMMS_SCENE_HANDLER)
.Log("ArchipelagoLiveConnection DisconnectAsync finished");
}

public async UniTask<EnumResult<IArchipelagoLiveConnection.ResponseError>> SendAsync(MemoryWrap data, CancellationToken token)
{
ReportHub
.WithReport(ReportCategory.ARCHIPELAGO_REQUEST)
.WithReport(ReportCategory.COMMS_SCENE_HANDLER)
.Log($"ArchipelagoLiveConnection SendAsync start with size: {data.Length} and content: {data.HexReadableString()}");
var result = await origin.SendAsync(data, token);
ReportHub
.WithReport(ReportCategory.ARCHIPELAGO_REQUEST)
.WithReport(ReportCategory.COMMS_SCENE_HANDLER)
.Log($"ArchipelagoLiveConnection SendAsync finished with size: {data.Length} and content: {data.HexReadableString()}");
return result;
}

public async UniTask<EnumResult<MemoryWrap, IArchipelagoLiveConnection.ResponseError>> ReceiveAsync(CancellationToken token)
{
ReportHub
.WithReport(ReportCategory.ARCHIPELAGO_REQUEST)
.WithReport(ReportCategory.COMMS_SCENE_HANDLER)
.Log("ArchipelagoLiveConnection ReceiveAsync start");
var result = await origin.ReceiveAsync(token);
ReportHub
.WithReport(ReportCategory.ARCHIPELAGO_REQUEST)
.WithReport(ReportCategory.COMMS_SCENE_HANDLER)
.Log($"ArchipelagoLiveConnection ReceiveAsync finished with error: {result.Error?.Message ?? "no error"}, size: {(result.Success ? result.Value.Length : 0)}");
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,14 @@ private async UniTask SendHeartbeatAsync(ConnectToRoomAsyncDelegate connectDeleg
var result = await signFlow.SendHeartbeatAsync(position, token);

if (result.Success == false)
ReportHub.LogWarning(ReportCategory.ARCHIPELAGO_REQUEST, $"Cannot send heartbeat, connection is closed: {result.ErrorMessage}");
ReportHub.LogWarning(ReportCategory.COMMS_SCENE_HANDLER, $"Cannot send heartbeat, connection is closed: {result.ErrorMessage}");
}

private void OnNewConnectionString(string connectionString, CancellationToken token)
{
if (CurrentState() is IConnectiveRoom.State.Stopped) throw new InvalidOperationException("Room is not running");
connectToRoomAsyncDelegate.EnsureNotNull("Connection delegate is not passed yet");
connectToRoomAsyncDelegate!(connectionString, token).Forget();
connectToRoomAsyncDelegate!(connectionString, static () => RoomSelection.NEW, token).Forget();
}

private async UniTask ConnectToArchipelagoAsync(CancellationToken token)
Expand All @@ -127,12 +127,12 @@ private async UniTask<LightResult<string>> WelcomePeerIdAsync(string adapterUrl,
if (messageForSignResult.Success == false ||
!HandshakePayloadIsValid(messageForSignResult.Result))
{
ReportHub.LogError(ReportCategory.ARCHIPELAGO_REQUEST, $"Cannot obtain a message to sign a welcome peer");
ReportHub.LogError(ReportCategory.COMMS_SCENE_HANDLER, "Cannot obtain a message to sign a welcome peer");
return LightResult<string>.FAILURE;
}

string signedMessage = identity.Sign(messageForSignResult.Result).ToJson();
ReportHub.Log(ReportCategory.ARCHIPELAGO_REQUEST, $"Signed message: {signedMessage}");
ReportHub.Log(ReportCategory.COMMS_SCENE_HANDLER, $"Signed message: {signedMessage}");
return await signFlow.WelcomePeerIdAsync(signedMessage, token);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private async UniTask RunConnectCycleStepAsync(ConnectToRoomAsyncDelegate connec
if (connectiveRoom.CurrentState() is not IConnectiveRoom.State.Running)
{
string connectionString = await ConnectionStringAsync(token);
await connectToRoomAsyncDelegate(connectionString, token);
await connectToRoomAsyncDelegate(connectionString, static () => RoomSelection.NEW, token);
}
}

Expand All @@ -56,7 +56,7 @@ private async UniTask<string> ConnectionStringAsync(CancellationToken token)
var result = webRequests.SignedFetchPostAsync(adapterUrl, metadata, token);
AdapterResponse response = await result.CreateFromJson<AdapterResponse>(WRJsonParser.Unity);
string connectionString = response.fixedAdapter;
ReportHub.WithReport(ReportCategory.ARCHIPELAGO_REQUEST).Log($"String is: {connectionString}");
ReportHub.WithReport(ReportCategory.COMMS_SCENE_HANDLER).Log($"String is: {connectionString}");
return connectionString;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class LogArchipelagoSignFlow : IArchipelagoSignFlow

public LogArchipelagoSignFlow(IArchipelagoSignFlow origin) : this(
origin,
m => ReportHub.Log(ReportCategory.ARCHIPELAGO_REQUEST, m)
m => ReportHub.Log(ReportCategory.COMMS_SCENE_HANDLER, m)
) { }

public LogArchipelagoSignFlow(IArchipelagoSignFlow origin, Action<string> log)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ public interface ISceneRoomMetaDataSource
/// </summary>
bool ScenesCommunicationIsIsolated { get; }

UniTask<MetaData> MetaDataAsync(CancellationToken token);
MetaData.Input GetMetadataInput();

UniTask WaitForMetaDataIsDirtyAsync(CancellationToken token);
UniTask<MetaData> MetaDataAsync(MetaData.Input input, CancellationToken token);

bool MetadataIsDirty { get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,49 @@ namespace DCL.Multiplayer.Connections.GateKeeper.Meta
[SuppressMessage("ReSharper", "NotAccessedField.Local")]
public struct MetaData : IEquatable<MetaData>
{
public readonly struct Input : IEquatable<Input>
{
public readonly string RealmName;
public readonly Vector2Int Parcel;

public Input(string realmName, Vector2Int parcel)
{
RealmName = realmName;
Parcel = parcel;
}

public bool Equals(Input other) =>
RealmName == other.RealmName && Parcel.Equals(other.Parcel);

public override bool Equals(object? obj) =>
obj is Input other && Equals(other);

public override int GetHashCode() =>
HashCode.Combine(RealmName, Parcel);

public override string ToString() =>
$"Realm: {RealmName}, Parcel: {Parcel}";
}

public string realmName;
public string? sceneId;

[NonSerialized]
public readonly Vector2Int Parcel;

public MetaData(string realmName, string? sceneId, Vector2Int parcel)
public MetaData(string? sceneId, Input input)
{
this.realmName = realmName;
realmName = input.RealmName;
Parcel = input.Parcel;
this.sceneId = sceneId;
Parcel = parcel;
}

public string ToJson() =>
JsonUtility.ToJson(this)!;

public override string ToString() =>
$"Realm: {realmName}, Scene: {sceneId}, Parcel: {Parcel}";

public bool Equals(MetaData other) =>
realmName == other.realmName && sceneId == other.sceneId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ public class SceneRoomLogMetaDataSource : ISceneRoomMetaDataSource
private const string PREFIX = "MetaDataSource:";

private readonly ISceneRoomMetaDataSource origin;
private readonly Action<string> log;

public SceneRoomLogMetaDataSource(ISceneRoomMetaDataSource origin)
{
Expand All @@ -19,19 +18,21 @@ public SceneRoomLogMetaDataSource(ISceneRoomMetaDataSource origin)

public bool ScenesCommunicationIsIsolated => origin.ScenesCommunicationIsIsolated;

public async UniTask<MetaData> MetaDataAsync(CancellationToken token)
public MetaData.Input GetMetadataInput()
{
ReportHub.WithReport(ReportCategory.LIVEKIT).Log($"{PREFIX} MetaDataAsync start");
MetaData result = await origin.MetaDataAsync(token);
ReportHub.WithReport(ReportCategory.LIVEKIT).Log($"{PREFIX} MetaDataAsync finish {result.realmName} {result.sceneId}");
ReportHub.WithReport(ReportCategory.LIVEKIT).Log($"{PREFIX} {nameof(GetMetadataInput)}");
MetaData.Input result = origin.GetMetadataInput();
return result;
}

public async UniTask WaitForMetaDataIsDirtyAsync(CancellationToken token)
public async UniTask<MetaData> MetaDataAsync(MetaData.Input input, CancellationToken token)
{
ReportHub.WithReport(ReportCategory.LIVEKIT).Log($"{PREFIX} WaitForMetaDataIsDirtyAsync start");
await origin.WaitForMetaDataIsDirtyAsync(token);
ReportHub.WithReport(ReportCategory.LIVEKIT).Log($"{PREFIX} WaitForMetaDataIsDirtyAsync finish");
ReportHub.WithReport(ReportCategory.LIVEKIT).Log($"{PREFIX} {nameof(MetaDataAsync)} start: {input}");
MetaData result = await origin.MetaDataAsync(input, token);
ReportHub.WithReport(ReportCategory.LIVEKIT).Log($"{PREFIX} {nameof(MetaDataAsync)} finish {result.realmName} {result.sceneId}");
return result;
}

public bool MetadataIsDirty => origin.MetadataIsDirty;
}
}
Loading
Loading