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: 20231113 #5917

Merged
merged 19 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
b0014b6
fix: fix typos in settings and adult content warning (#5896)
aixaCode Nov 5, 2023
74646c7
fix: content moderation visual fixes (#5898)
sandrade-dcl Nov 6, 2023
6436733
Merge pull request #5899 from decentraland/chore/sync
anicalbano Nov 6, 2023
b0a3fcc
Chore: Unity 2022.3.12f1 (#5893)
mikhail-dcl Nov 7, 2023
419dbc7
style: re assign missing textures (#5903)
RominaMarchetti Nov 8, 2023
5cae16b
fix: streaming volume (#5904)
lorux0 Nov 8, 2023
f399142
Merge branch 'dev' into chore/sync
lorux0 Nov 8, 2023
dc124b2
Merge pull request #5908 from decentraland/chore/sync
lorux0 Nov 8, 2023
f86b9e0
Merge pull request #5909 from decentraland/chore/sync
lorux0 Nov 8, 2023
6635746
fix: crossplatform profile (#5910)
lorux0 Nov 9, 2023
3332fd9
fix: hide pending status warning for email subscriptions (#5911)
sandrade-dcl Nov 10, 2023
2dfb07c
fix: backpack width is being cut in some resolutions (#5894)
sandrade-dcl Nov 10, 2023
d4e84f4
Revert "fix: crossplatform profile (#5910)"
lorux0 Nov 10, 2023
78997c0
fix: emote and movement replication (#5906)
Kinerius Nov 10, 2023
6f3f57b
fix: profile crossplatform & guest flow (#5921)
lorux0 Nov 10, 2023
c75745b
hotfix: if the profile doesn't come from the catalyst, use the local …
sandrade-dcl Nov 13, 2023
0f6399d
chore: downgrade unity to fix shader issue (#5924)
Kinerius Nov 13, 2023
65b108b
Revert "chore: downgrade unity to fix shader issue (#5924)"
Kinerius Nov 14, 2023
34769ed
Revert "Chore: Unity 2022.3.12f1 (#5893)"
Kinerius Nov 14, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,30 @@ import type { ProfileStatus } from '../../types'
import { fetchPeerProfile } from '../comms'
import { fetchCatalystProfile } from '../content'

export function* fetchProfileFromCatalyst(userId: string, version: number) {
try {
const profile = yield call(fetchFromCatalyst, userId, version)

const avatar: Avatar = ensureAvatarCompatibilityFormat(profile)
avatar.userId = userId

if (yield select(isCurrentUserId, userId)) {
avatar.hasConnectedWeb3 = true
}

yield put(profileSuccess(avatar))
return avatar
} catch (error: any) {
debugger
trackEvent('error', {
context: 'kernel#saga',
message: `Error requesting profile for ${userId}: ${error}`,
stack: error.stack || ''
})
yield put(profileFailure(userId, `${error}`))
}
}

export function* fetchProfile(action: ProfileRequestAction): any {
const { userId, minimumVersion } = action.payload
const {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,41 @@
import type { Avatar } from '@dcl/schemas'
import { ethereumConfigurations, ETHEREUM_NETWORK, RESET_TUTORIAL } from 'config'
import type {Avatar} from '@dcl/schemas'
import {ETHEREUM_NETWORK, ethereumConfigurations, RESET_TUTORIAL} from 'config'
import defaultLogger from 'lib/logger'
import { call, put, select } from 'redux-saga/effects'
import { BringDownClientAndReportFatalError, ErrorContext } from 'shared/loading/ReportFatalError'
import { getCurrentIdentity, getCurrentNetwork } from 'shared/session/selectors'
import type { ExplorerIdentity } from 'shared/session/types'
import { fetchOwnedENS } from 'lib/web3/fetchOwnedENS'
import { profileRequest, profileSuccess, saveProfileDelta } from '../actions'
import { fetchProfile } from './fetchProfile'
import { fetchLocalProfile } from './local/index'
import { getFeatureFlagEnabled } from 'shared/meta/selectors'
import {call, put, select} from 'redux-saga/effects'
import {BringDownClientAndReportFatalError, ErrorContext} from 'shared/loading/ReportFatalError'
import {getCurrentIdentity, getCurrentNetwork, isGuestLogin} from 'shared/session/selectors'
import type {ExplorerIdentity} from 'shared/session/types'
import {fetchOwnedENS} from 'lib/web3/fetchOwnedENS'
import {profileSuccess, saveProfileDelta} from '../actions'
import {fetchProfileFromCatalyst} from './fetchProfile'
import {fetchLocalProfile} from './local/index'
import {getFeatureFlagEnabled} from 'shared/meta/selectors'
import {generateRandomUserProfile} from "../../../lib/decentraland/profiles";
import {ensureAvatarCompatibilityFormat} from "../../../lib/decentraland/profiles/transformations";

export function* initialRemoteProfileLoad() {
// initialize profile
const identity: ExplorerIdentity = yield select(getCurrentIdentity)
const userId = identity.address

let profile: Avatar | null = yield call(fetchLocalProfile)
const isGuest = yield select(isGuestLogin)
let profile: Avatar | null = yield call(fetchLocalProfile, isGuest)
try {
profile = yield call(
fetchProfile,
profileRequest(userId, profile && profile.userId === userId ? profile.version : 0)
)
if (!isGuest) {
const profileFromCatalyst = yield call(
fetchProfileFromCatalyst,
userId,
profile && profile.userId === userId ? profile.version : 0
)

if (profileFromCatalyst) {
profile = profileFromCatalyst;
}
}

if (!profile) {
profile = ensureAvatarCompatibilityFormat(generateRandomUserProfile(userId))
}
} catch (e: any) {
BringDownClientAndReportFatalError(e, ErrorContext.KERNEL_INIT, { userId })
throw e
Expand Down
13 changes: 8 additions & 5 deletions browser-interface/packages/shared/profiles/sagas/local/index.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
import type { Avatar } from '@dcl/schemas'
import type { ETHEREUM_NETWORK } from 'config'
import type { ExplorerIdentity } from 'shared/session/types'
import { apply, put, select } from 'redux-saga/effects'
import {apply, put, select} from 'redux-saga/effects'
import { ensureAvatarCompatibilityFormat } from 'lib/decentraland/profiles/transformations/profileToServerFormat'
import { localProfilesRepo } from './localProfilesRepo'
import { getCurrentIdentity, getCurrentNetwork } from 'shared/session/selectors'
import defaultLogger from 'lib/logger'
import { profileSuccess } from 'shared/profiles/actions'
import {profileSuccess} from "../../actions";

export function* fetchLocalProfile() {
export function* fetchLocalProfile(submit: boolean = false) {
const network: ETHEREUM_NETWORK = yield select(getCurrentNetwork)
const identity: ExplorerIdentity = yield select(getCurrentIdentity)
const profile = (yield apply(localProfilesRepo, localProfilesRepo.get, [identity.address, network])) as Avatar | null
if (profile && profile.userId === identity.address) {
try {
const finalProfile = ensureAvatarCompatibilityFormat(profile)
yield put(profileSuccess(finalProfile))
const avatar = ensureAvatarCompatibilityFormat(profile);
if (submit) {
yield put(profileSuccess(avatar))
}
return avatar
} catch (error) {
defaultLogger.log(`Invalid profile stored: ${JSON.stringify(profile, null, 2)}`)
return null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
using DCL.Components;
using DCL.Configuration;
using DCL.Controllers;
using DCL.Emotes;
using DCL.Helpers;
using DCL.Interface;
using DCL.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.ExceptionServices;
using System.Threading;
using UnityEngine;
using LOD = AvatarSystem.LOD;
Expand Down Expand Up @@ -87,6 +87,8 @@ public class AvatarShape : MonoBehaviour, IHideAvatarAreaHandler, IPoolableObjec

private Service<IAvatarFactory> avatarFactory;
private Service<IEmotesCatalogService> emotesCatalog;
private IAvatarEmotesController emotesController;
private AvatarSceneEmoteHandler sceneEmoteHandler;
public IAvatar internalAvatar => avatar;

private void Awake()
Expand All @@ -104,11 +106,19 @@ private void Awake()
LOD avatarLOD = new LOD(avatarContainer, visibility, avatarMovementController);
AvatarAnimatorLegacy animator = GetComponentInChildren<AvatarAnimatorLegacy>();


//Ensure base avatar references
var baseAvatarReferences = baseAvatarContainer.GetComponentInChildren<IBaseAvatarReferences>() ?? Instantiate(baseAvatarReferencesPrefab, baseAvatarContainer);

avatar = avatarFactory.Ref.CreateAvatarWithHologram(avatarContainer, new BaseAvatar(baseAvatarReferences), animator, avatarLOD, visibility);

emotesController = avatar.GetEmotesController();

sceneEmoteHandler = new AvatarSceneEmoteHandler(
emotesController,
Environment.i.serviceLocator.Get<IEmotesService>(),
new UserProfileWebInterfaceBridge());

avatarReporterController ??= new AvatarReporterController(Environment.i.world.state);

onPointerDown.OnPointerDownReport += PlayerClicked;
Expand Down Expand Up @@ -202,8 +212,11 @@ public async void ApplyModel(IParcelScene scene, IDCLEntity entity, PBAvatarShap
}
}

// If the model contains a value for expressionTriggerId then we try it, if value doesn't exist, we skip
if(model.HasExpressionTriggerId)
if (sceneEmoteHandler.IsSceneEmote(model.ExpressionTriggerId))
sceneEmoteHandler
.LoadAndPlayEmote(model.BodyShape, model.ExpressionTriggerId)
.Forget();
else
avatar.GetEmotesController().PlayEmote(model.ExpressionTriggerId, model.GetExpressionTriggerTimestamp());

UpdatePlayerStatus(entity, model);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
"GUID:6c1761dc8f737004198eb333521bd665",
"GUID:c8ea72e806cd2ab47b539b37895b86b7",
"GUID:9cccce9925d3495d8a5e4fa5b25f54a5",
"GUID:2d39cc535b437e749965d4a8258f0c13"
"GUID:2d39cc535b437e749965d4a8258f0c13",
"GUID:0c0c18c12967b3944b844b79c47c2320"
],
"includePlatforms": [],
"excludePlatforms": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class VideoPlayerHandler : IECSComponentHandler<PBVideoPlayer>
private readonly ISettingsRepository<AudioSettings> audioSettings;
private readonly DataStore_VirtualAudioMixer audioMixerDataStore;
private readonly IntVariable currentPlayerSceneNumber;

internal PBVideoPlayer lastModel = null;
internal WebVideoPlayer videoPlayer;

Expand Down Expand Up @@ -118,6 +119,7 @@ public void OnComponentModelUpdated(IParcelScene scene, IDCLEntity entity, PBVid
videoPlayer.SetTime(model.GetPosition());

UpdateVolume(model, audioSettings.Data, audioMixerDataStore.sceneSFXVolume.Get(), currentPlayerSceneNumber);

videoPlayer.SetPlaybackRate(model.GetPlaybackRate());
videoPlayer.SetLoop(model.GetLoop());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public VideoPlayerRegister(int componentId, ECSComponentsFactory factory, IECSCo
Settings.i.audioSettings,
DataStore.i.virtualAudioMixer,
CommonScriptableObjects.sceneNumber));

componentWriter.AddOrReplaceComponentSerializer<PBVideoPlayer>(componentId, ProtoSerialization.Serialize);

this.factory = factory;
Expand Down
Loading