From 32040ca966301973cf6dfda772a85de5749905be Mon Sep 17 00:00:00 2001 From: Gonzalo DCL Date: Mon, 25 Nov 2024 11:14:51 -0300 Subject: [PATCH] fix multipalyer clone issue at runtime --- packages/@dcl/inspector/package-lock.json | 9 +++++---- packages/@dcl/inspector/package.json | 2 +- packages/@dcl/sdk-commands/src/logic/bundle.ts | 18 ++++-------------- 3 files changed, 10 insertions(+), 19 deletions(-) diff --git a/packages/@dcl/inspector/package-lock.json b/packages/@dcl/inspector/package-lock.json index bce6ee3da..43b1f95cf 100644 --- a/packages/@dcl/inspector/package-lock.json +++ b/packages/@dcl/inspector/package-lock.json @@ -8,7 +8,7 @@ "name": "@dcl/inspector", "version": "0.1.0", "dependencies": { - "@dcl/asset-packs": "1.20.2", + "@dcl/asset-packs": "https://sdk-team-cdn.decentraland.org/@dcl/asset-packs/branch/fix/multiplayer-clone/dcl-asset-packs-1.20.3-12011748069.commit-d2ec1e6.tgz", "ts-deepmerge": "^7.0.0" }, "devDependencies": { @@ -294,9 +294,10 @@ "integrity": "sha512-IOur6rSK5vN/oUpfawW6ax6vXPeADPCB44WNudeIYEYER7kwT2akNKUCLLjR19cLo006i/dkdt6UsTQ677uMxA==" }, "node_modules/@dcl/asset-packs": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/@dcl/asset-packs/-/asset-packs-1.20.2.tgz", - "integrity": "sha512-mYnRMzrFDzQZb+72uZYnvTVM6WOa3gS9OnAsnemRECM8x2NuM+0XIuAQ8fYT02lQPmi6Jq+zCqHCo60tr/wL0A==", + "version": "1.20.3-12011748069.commit-d2ec1e6", + "resolved": "https://sdk-team-cdn.decentraland.org/@dcl/asset-packs/branch/fix/multiplayer-clone/dcl-asset-packs-1.20.3-12011748069.commit-d2ec1e6.tgz", + "integrity": "sha512-UvQHRuyDNSvCrTL8y54t3+xxn+1hcxqz9ftGhDJJA3gC88lzGeCs++ye7qHDo1eoknTWs8ve6trMZa2L3ZA7/g==", + "license": "ISC", "dependencies": { "@dcl-sdk/utils": "^1.2.8", "@dcl/js-runtime": "7.5.2", diff --git a/packages/@dcl/inspector/package.json b/packages/@dcl/inspector/package.json index 9184d5a29..196154f5f 100644 --- a/packages/@dcl/inspector/package.json +++ b/packages/@dcl/inspector/package.json @@ -2,7 +2,7 @@ "name": "@dcl/inspector", "version": "0.1.0", "dependencies": { - "@dcl/asset-packs": "1.20.2", + "@dcl/asset-packs": "https://sdk-team-cdn.decentraland.org/@dcl/asset-packs/branch/fix/multiplayer-clone/dcl-asset-packs-1.20.3-12011748069.commit-d2ec1e6.tgz", "ts-deepmerge": "^7.0.0" }, "devDependencies": { diff --git a/packages/@dcl/sdk-commands/src/logic/bundle.ts b/packages/@dcl/sdk-commands/src/logic/bundle.ts index f5e6a023b..f8931b2d2 100644 --- a/packages/@dcl/sdk-commands/src/logic/bundle.ts +++ b/packages/@dcl/sdk-commands/src/logic/bundle.ts @@ -63,24 +63,14 @@ import { compositeFromLoader } from '~sdk/all-composites' ${ isEditorScene && ` -import { initAssetPacks } from '@dcl/asset-packs/dist/scene-entrypoint' -initAssetPacks(engine) +import { syncEntity } from '@dcl/sdk/network' +import { initAssetPacks, setSyncEntity } from '@dcl/asset-packs/dist/scene-entrypoint' +initAssetPacks(engine, { syncEntity }) // TODO: do we need to do this on runtime ? // I think we have that information at build-time and we avoid to do evaluate this on the worker. // Read composite.json or main.crdt => If that file has a NetowrkEntity import '@dcl/@sdk/network' - -// conditionally load networking code if the NetworkEntity component is being used... -for (const path in compositeFromLoader) { - const composite = compositeProvider.getCompositeOrNull(path) - if (composite) { - const { components } = composite.composite - const hasNetworkEntity = components.find(($) => $.name === NetworkEntity.componentName) - if (hasNetworkEntity) { - import('@dcl/sdk/network') - } - } -}` +` } if ((entrypoint as any).main !== undefined) {