diff --git a/packages/@dcl/ecs/src/systems/crdt/index.ts b/packages/@dcl/ecs/src/systems/crdt/index.ts index cb8afb32e..9640b573f 100644 --- a/packages/@dcl/ecs/src/systems/crdt/index.ts +++ b/packages/@dcl/ecs/src/systems/crdt/index.ts @@ -216,15 +216,14 @@ export function crdtSceneSystem(engine: PreEngine, onProcessEntityComponentChang ...message, messageBuffer: buffer.buffer().subarray(offset, buffer.currentWriteOffset()) }) + } + if (onProcessEntityComponentChange) { + const rawValue = + message.type === CrdtMessageType.PUT_COMPONENT || message.type === CrdtMessageType.APPEND_VALUE + ? component.get(message.entityId) + : undefined - if (onProcessEntityComponentChange) { - const rawValue = - message.type === CrdtMessageType.PUT_COMPONENT || message.type === CrdtMessageType.APPEND_VALUE - ? component.get(message.entityId) - : undefined - - onProcessEntityComponentChange(message.entityId, message.type, component, rawValue) - } + onProcessEntityComponentChange(message.entityId, message.type, component, rawValue) } } } diff --git a/packages/@dcl/sdk-commands/src/commands/start/explorer-alpha.ts b/packages/@dcl/sdk-commands/src/commands/start/explorer-alpha.ts index 10e19a39c..ba899df8d 100644 --- a/packages/@dcl/sdk-commands/src/commands/start/explorer-alpha.ts +++ b/packages/@dcl/sdk-commands/src/commands/start/explorer-alpha.ts @@ -1,14 +1,22 @@ +import { Result } from 'arg' +import { args as startArgs } from '.' import { CliComponents } from '../../components' const isWindows = /^win/.test(process.platform) export async function runExplorerAlpha( components: CliComponents, - opts: { cwd: string; realm: string; baseCoords: { x: number; y: number }; isHub: boolean } + opts: { + cwd: string + realm: string + baseCoords: { x: number; y: number } + isHub: boolean + args: Result + } ) { const { cwd, realm, baseCoords, isHub } = opts - if (await runApp(components, { cwd, realm, baseCoords, isHub })) { + if (await runApp(components, { cwd, realm, baseCoords, isHub, args: opts.args })) { return } @@ -19,14 +27,27 @@ async function runApp( components: CliComponents, { cwd, - realm, + realm: realmValue, baseCoords, - isHub - }: { cwd: string; realm: string; baseCoords: { x: number; y: number }; isHub: boolean } + isHub, + args + }: { + cwd: string + realm: string + baseCoords: { x: number; y: number } + isHub: boolean + args: Result + } ) { const cmd = isWindows ? 'start' : 'open' + const position = args['--position'] ?? `${baseCoords.x},${baseCoords.y}` + const realm = args['--realm'] ?? realmValue + const localScene = args['--local-scene'] ?? true + const debug = args['--debug'] ?? true + const dclenv = args['--dclenv'] ?? 'org' + try { - const params = `realm=${realm}&position=${baseCoords.x},${baseCoords.y}&local-scene=true&debug=true&hub=${isHub}` + const params = `realm=${realm}&position=${position}&local-scene=${localScene}&debug=${debug}&hub=${isHub}&dclenv=${dclenv}` const app = `decentraland://"${params}"` await components.spawner.exec(cwd, cmd, [app], { silent: true }) components.logger.info(`Desktop client: decentraland://${params}\n`) diff --git a/packages/@dcl/sdk-commands/src/commands/start/index.ts b/packages/@dcl/sdk-commands/src/commands/start/index.ts index ab5b3dbd8..b2286b0bb 100644 --- a/packages/@dcl/sdk-commands/src/commands/start/index.ts +++ b/packages/@dcl/sdk-commands/src/commands/start/index.ts @@ -52,7 +52,13 @@ export const args = declareArgs({ '--desktop-client': Boolean, '--data-layer': Boolean, '--explorer-alpha': Boolean, - '--hub': Boolean + '--hub': Boolean, + // Params related to the explorer-alpha + '--debug': Boolean, + '--dclenv': String, + '--realm': String, + '--local-scene': String, + '--position': String }) export async function help(options: Options) { @@ -70,6 +76,12 @@ export async function help(options: Options) { --web3 Connects preview to browser wallet to use the associated avatar and account --skip-build Skip build and only serve the files in preview mode --desktop-client Show URL to launch preview in the desktop client (BETA) + --debug Enables Debug panel mode inside DCL Explorer (default=true) + --dclenv Decentraland Environment. Which environment to use for the content. This determines the catalyst server used, asset-bundles, etc. Possible values: org, zone, today. (default=org) + --realm Realm used to serve the content. (default=Localhost) + --local-scene Enable local scene development. + --position Initial Position to start the explorer. (default=position defined at scene.json) + Examples: @@ -97,7 +109,6 @@ export async function main(options: Options) { const isHub = !!options.args['--hub'] let hasSmartWearable = false - const workspace = await getValidWorkspace(options.components, workingDirectory) /* istanbul ignore if */ @@ -232,7 +243,7 @@ export async function main(options: Options) { if (explorerAlpha) { const realm = new URL(sortedURLs[0]).origin - await runExplorerAlpha(components, { cwd: workingDirectory, realm, baseCoords, isHub }) + await runExplorerAlpha(components, { cwd: workingDirectory, realm, baseCoords, isHub, args: options.args }) } // Open preferably localhost/127.0.0.1 diff --git a/test/snapshots/development-bundles/static-scene.test.ts.crdt b/test/snapshots/development-bundles/static-scene.test.ts.crdt index 6c76e3741..381bd87ac 100644 --- a/test/snapshots/development-bundles/static-scene.test.ts.crdt +++ b/test/snapshots/development-bundles/static-scene.test.ts.crdt @@ -56,4 +56,4 @@ CALL onUpdate(0.1) OPCODES ~= 3k MALLOC_COUNT = -5 ALIVE_OBJS_DELTA ~= 0.00k - MEMORY_USAGE_COUNT ~= 1194.79k bytes \ No newline at end of file + MEMORY_USAGE_COUNT ~= 1194.77k bytes \ No newline at end of file diff --git a/test/snapshots/development-bundles/testing-fw.test.ts.crdt b/test/snapshots/development-bundles/testing-fw.test.ts.crdt index 95791a98d..42f208b91 100644 --- a/test/snapshots/development-bundles/testing-fw.test.ts.crdt +++ b/test/snapshots/development-bundles/testing-fw.test.ts.crdt @@ -1,4 +1,4 @@ -SCENE_COMPILED_JS_SIZE_PROD=454k bytes +SCENE_COMPILED_JS_SIZE_PROD=453.9k bytes THE BUNDLE HAS SOURCEMAPS (start empty vm 0.21.0-3680274614.commit-1808aa1) OPCODES ~= 0k @@ -64,4 +64,4 @@ CALL onUpdate(0.1) OPCODES ~= 5k MALLOC_COUNT = -40 ALIVE_OBJS_DELTA ~= -0.01k - MEMORY_USAGE_COUNT ~= 1203.40k bytes \ No newline at end of file + MEMORY_USAGE_COUNT ~= 1203.39k bytes \ No newline at end of file diff --git a/test/snapshots/development-bundles/two-way-crdt.test.ts.crdt b/test/snapshots/development-bundles/two-way-crdt.test.ts.crdt index c8d7770eb..c41b78d2d 100644 --- a/test/snapshots/development-bundles/two-way-crdt.test.ts.crdt +++ b/test/snapshots/development-bundles/two-way-crdt.test.ts.crdt @@ -64,4 +64,4 @@ CALL onUpdate(0.1) OPCODES ~= 5k MALLOC_COUNT = -40 ALIVE_OBJS_DELTA ~= -0.01k - MEMORY_USAGE_COUNT ~= 1203.41k bytes \ No newline at end of file + MEMORY_USAGE_COUNT ~= 1203.39k bytes \ No newline at end of file diff --git a/test/snapshots/production-bundles/billboard.ts.crdt b/test/snapshots/production-bundles/billboard.ts.crdt index 545259257..aea59f90d 100644 --- a/test/snapshots/production-bundles/billboard.ts.crdt +++ b/test/snapshots/production-bundles/billboard.ts.crdt @@ -58,7 +58,7 @@ CALL onUpdate(0.1) Scene: PUT_COMPONENT e=0x201 c=1 t=2 data={"position":{"x":12,"y":3.0420734882354736,"z":1},"rotation":{"x":0,"y":0,"z":0,"w":1},"scale":{"x":2,"y":2,"z":2},"parent":0} Scene: PUT_COMPONENT e=0x204 c=1 t=2 data={"position":{"x":12,"y":3.0420734882354736,"z":8},"rotation":{"x":0,"y":0,"z":0,"w":1},"scale":{"x":2,"y":2,"z":2},"parent":0} Scene: PUT_COMPONENT e=0x203 c=1 t=2 data={"position":{"x":8,"y":3.0420734882354736,"z":8},"rotation":{"x":0,"y":0,"z":0,"w":1},"scale":{"x":2,"y":2,"z":2},"parent":0} - OPCODES ~= 9k + OPCODES ~= 10k MALLOC_COUNT = 0 ALIVE_OBJS_DELTA ~= 0.00k CALL onUpdate(0.1) @@ -66,7 +66,7 @@ CALL onUpdate(0.1) Scene: PUT_COMPONENT e=0x201 c=1 t=3 data={"position":{"x":12,"y":3.087538480758667,"z":1},"rotation":{"x":0,"y":0,"z":0,"w":1},"scale":{"x":2,"y":2,"z":2},"parent":0} Scene: PUT_COMPONENT e=0x204 c=1 t=3 data={"position":{"x":12,"y":3.087538480758667,"z":8},"rotation":{"x":0,"y":0,"z":0,"w":1},"scale":{"x":2,"y":2,"z":2},"parent":0} Scene: PUT_COMPONENT e=0x203 c=1 t=3 data={"position":{"x":8,"y":3.087538480758667,"z":8},"rotation":{"x":0,"y":0,"z":0,"w":1},"scale":{"x":2,"y":2,"z":2},"parent":0} - OPCODES ~= 9k + OPCODES ~= 10k MALLOC_COUNT = 0 ALIVE_OBJS_DELTA ~= 0.00k CALL onUpdate(0.1) @@ -74,7 +74,7 @@ CALL onUpdate(0.1) Scene: PUT_COMPONENT e=0x201 c=1 t=4 data={"position":{"x":12,"y":3.0945944786071777,"z":1},"rotation":{"x":0,"y":0,"z":0,"w":1},"scale":{"x":2,"y":2,"z":2},"parent":0} Scene: PUT_COMPONENT e=0x204 c=1 t=4 data={"position":{"x":12,"y":3.0945944786071777,"z":8},"rotation":{"x":0,"y":0,"z":0,"w":1},"scale":{"x":2,"y":2,"z":2},"parent":0} Scene: PUT_COMPONENT e=0x203 c=1 t=4 data={"position":{"x":8,"y":3.0945944786071777,"z":8},"rotation":{"x":0,"y":0,"z":0,"w":1},"scale":{"x":2,"y":2,"z":2},"parent":0} - OPCODES ~= 9k + OPCODES ~= 10k MALLOC_COUNT = 0 ALIVE_OBJS_DELTA ~= 0.00k MEMORY_USAGE_COUNT ~= 1042.09k bytes \ No newline at end of file diff --git a/test/snapshots/production-bundles/cubes.ts.crdt b/test/snapshots/production-bundles/cubes.ts.crdt index 1f61d0820..5f6ca10fa 100644 --- a/test/snapshots/production-bundles/cubes.ts.crdt +++ b/test/snapshots/production-bundles/cubes.ts.crdt @@ -563,7 +563,7 @@ CALL onUpdate(0) Scene: PUT_COMPONENT e=0x2b4 c=1018 t=1 data={"mesh":{"$case":"box","box":{"uvs":[]}}} Scene: PUT_COMPONENT e=0x2b5 c=1018 t=1 data={"mesh":{"$case":"box","box":{"uvs":[]}}} Scene: PUT_COMPONENT e=0x2b6 c=1018 t=1 data={"mesh":{"$case":"box","box":{"uvs":[]}}} - OPCODES ~= 998k + OPCODES ~= 1000k MALLOC_COUNT = 1840 ALIVE_OBJS_DELTA ~= 0.74k CALL onUpdate(0.1) @@ -925,7 +925,7 @@ CALL onUpdate(0.1) Scene: PUT_COMPONENT e=0x2b4 c=1017 t=2 data={"material":{"$case":"pbr","pbr":{"albedoColor":{"r":0,"g":0,"b":1,"a":1}}}} Scene: PUT_COMPONENT e=0x2b5 c=1017 t=2 data={"material":{"$case":"pbr","pbr":{"albedoColor":{"r":0,"g":0,"b":1,"a":1}}}} Scene: PUT_COMPONENT e=0x2b6 c=1017 t=2 data={"material":{"$case":"pbr","pbr":{"albedoColor":{"r":0,"g":0,"b":1,"a":1}}}} - OPCODES ~= 691k + OPCODES ~= 692k MALLOC_COUNT = 0 ALIVE_OBJS_DELTA ~= 0.00k CALL onUpdate(0.1) @@ -1287,7 +1287,7 @@ CALL onUpdate(0.1) Scene: PUT_COMPONENT e=0x2b4 c=1017 t=3 data={"material":{"$case":"pbr","pbr":{"albedoColor":{"r":0,"g":0,"b":1,"a":1}}}} Scene: PUT_COMPONENT e=0x2b5 c=1017 t=3 data={"material":{"$case":"pbr","pbr":{"albedoColor":{"r":0,"g":0,"b":1,"a":1}}}} Scene: PUT_COMPONENT e=0x2b6 c=1017 t=3 data={"material":{"$case":"pbr","pbr":{"albedoColor":{"r":0,"g":0,"b":1,"a":1}}}} - OPCODES ~= 691k + OPCODES ~= 692k MALLOC_COUNT = 0 ALIVE_OBJS_DELTA ~= 0.00k CALL onUpdate(0.1) @@ -1649,7 +1649,7 @@ CALL onUpdate(0.1) Scene: PUT_COMPONENT e=0x2b4 c=1017 t=4 data={"material":{"$case":"pbr","pbr":{"albedoColor":{"r":0,"g":0,"b":1,"a":1}}}} Scene: PUT_COMPONENT e=0x2b5 c=1017 t=4 data={"material":{"$case":"pbr","pbr":{"albedoColor":{"r":0,"g":0,"b":1,"a":1}}}} Scene: PUT_COMPONENT e=0x2b6 c=1017 t=4 data={"material":{"$case":"pbr","pbr":{"albedoColor":{"r":0,"g":0,"b":1,"a":1}}}} - OPCODES ~= 691k + OPCODES ~= 692k MALLOC_COUNT = 0 ALIVE_OBJS_DELTA ~= 0.00k MEMORY_USAGE_COUNT ~= 1178.02k bytes \ No newline at end of file diff --git a/test/snapshots/production-bundles/schema-components.ts.crdt b/test/snapshots/production-bundles/schema-components.ts.crdt index ff93c6a98..d2dfe615e 100644 --- a/test/snapshots/production-bundles/schema-components.ts.crdt +++ b/test/snapshots/production-bundles/schema-components.ts.crdt @@ -31,4 +31,4 @@ CALL onUpdate(0.1) OPCODES ~= 1k MALLOC_COUNT = 0 ALIVE_OBJS_DELTA ~= 0.00k - MEMORY_USAGE_COUNT ~= 854.79k bytes \ No newline at end of file + MEMORY_USAGE_COUNT ~= 854.80k bytes \ No newline at end of file