Skip to content

Commit

Permalink
fix multipalyer clone issue at runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
gonpombo8 committed Nov 25, 2024
1 parent 2c002ca commit 32040ca
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 19 deletions.
9 changes: 5 additions & 4 deletions packages/@dcl/inspector/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/@dcl/inspector/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
18 changes: 4 additions & 14 deletions packages/@dcl/sdk-commands/src/logic/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 32040ca

Please sign in to comment.