Skip to content

Commit 085da37

Browse files
authored
fix multipalyer clone issue at runtime (#1039)
* fix multipalyer clone issue at runtime * update asset-packs
1 parent 10d594b commit 085da37

File tree

4 files changed

+11
-22
lines changed

4 files changed

+11
-22
lines changed

packages/@dcl/inspector/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@dcl/inspector/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@dcl/inspector",
33
"version": "0.1.0",
44
"dependencies": {
5-
"@dcl/asset-packs": "^2.0.0",
5+
"@dcl/asset-packs": "^2.1.1",
66
"ts-deepmerge": "^7.0.0"
77
},
88
"devDependencies": {

packages/@dcl/sdk-commands/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@dcl/sdk-commands/src/logic/bundle.ts

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,24 +63,14 @@ import { compositeFromLoader } from '~sdk/all-composites'
6363
${
6464
isEditorScene &&
6565
`
66-
import { initAssetPacks } from '@dcl/asset-packs/dist/scene-entrypoint'
67-
initAssetPacks(engine)
66+
import { syncEntity } from '@dcl/sdk/network'
67+
import { initAssetPacks, setSyncEntity } from '@dcl/asset-packs/dist/scene-entrypoint'
68+
initAssetPacks(engine, { syncEntity })
6869
6970
// TODO: do we need to do this on runtime ?
7071
// I think we have that information at build-time and we avoid to do evaluate this on the worker.
7172
// Read composite.json or main.crdt => If that file has a NetowrkEntity import '@dcl/@sdk/network'
72-
73-
// conditionally load networking code if the NetworkEntity component is being used...
74-
for (const path in compositeFromLoader) {
75-
const composite = compositeProvider.getCompositeOrNull(path)
76-
if (composite) {
77-
const { components } = composite.composite
78-
const hasNetworkEntity = components.find(($) => $.name === NetworkEntity.componentName)
79-
if (hasNetworkEntity) {
80-
import('@dcl/sdk/network')
81-
}
82-
}
83-
}`
73+
`
8474
}
8575
8676
if ((entrypoint as any).main !== undefined) {
@@ -106,7 +96,6 @@ export * from '${unixEntrypointPath}'
10696

10797
export async function bundleProject(components: BundleComponents, options: CompileOptions, sceneJson: Scene) {
10898
const tsconfig = path.join(options.workingDirectory, 'tsconfig.json')
109-
11099
/* istanbul ignore if */
111100
if (!options.single && !sceneJson.main) {
112101
throw new CliError('scene.json .main must be present')

0 commit comments

Comments
 (0)