Skip to content

Commit 46ce898

Browse files
authored
feat: multi instance support added (#1336)
1 parent 3a83d2f commit 46ce898

File tree

3 files changed

+50
-2
lines changed

3 files changed

+50
-2
lines changed

packages/@dcl/sdk-commands/src/commands/start/explorer-alpha.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ async function runApp(
4646
const skipAuthScreen = !!args['--skip-auth-screen']
4747
const landscapeTerrainEnabled = !!args['--landscape-terrain-enabled']
4848
const openDeeplinkInNewInstance = !!args['-n']
49+
const multiInstance = !!args['--multi-instance']
4950

5051
try {
5152
if (isWindows) {
@@ -74,6 +75,9 @@ async function runApp(
7475
if (openDeeplinkInNewInstance) {
7576
params.set('open-deeplink-in-new-instance', 'true')
7677
}
78+
if (multiInstance) {
79+
params.set('multi-instance', 'true')
80+
}
7781

7882
const queryParams = params.toString()
7983

packages/@dcl/sdk-commands/src/commands/start/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ export const args = declareArgs({
6666
'--skip-auth-screen': Boolean,
6767
'--landscape-terrain-enabled': Boolean,
6868
'-n': Boolean,
69-
'--bevy-web': Boolean
69+
'--bevy-web': Boolean,
70+
'--multi-instance': Boolean
7071
})
7172

7273
export async function help(options: Options) {
@@ -93,7 +94,8 @@ export async function help(options: Options) {
9394
--landscape-terrain-enabled Enable landscape terrain.
9495
-n Open a new instance of the Client even if one is already running.
9596
--bevy-web Opens preview using the Bevy Web browser window.
96-
--mobile Show QR code for mobile preview on the same network
97+
--mobile Show QR code for mobile preview on the same network.
98+
--multi-instance Allow running multiple Explorer instances simultaneously.
9799
98100
99101
Examples:

test/sdk-commands/commands/start/explorer-alpha.spec.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,48 @@ describe('explorer-alpha', () => {
143143
})
144144
})
145145

146+
describe('multiInstance parameter', () => {
147+
it('should include multi-instance parameter when --multi-instance flag is provided', async () => {
148+
const args: any = {
149+
'--multi-instance': true
150+
}
151+
152+
await runExplorerAlpha(mockComponents, {
153+
cwd: '/test',
154+
realm: 'test-realm',
155+
baseCoords: { x: 0, y: 0 },
156+
isHub: false,
157+
args
158+
})
159+
160+
expect(mockExec).toHaveBeenCalledWith(
161+
'/test',
162+
'open',
163+
expect.arrayContaining([expect.stringContaining('multi-instance=true')]),
164+
{ silent: true }
165+
)
166+
})
167+
168+
it('should not include multi-instance parameter when --multi-instance flag is not provided', async () => {
169+
const args: any = {}
170+
171+
await runExplorerAlpha(mockComponents, {
172+
cwd: '/test',
173+
realm: 'test-realm',
174+
baseCoords: { x: 0, y: 0 },
175+
isHub: false,
176+
args
177+
})
178+
179+
expect(mockExec).toHaveBeenCalledWith(
180+
'/test',
181+
'open',
182+
expect.arrayContaining([expect.not.stringContaining('multi-instance')]),
183+
{ silent: true }
184+
)
185+
})
186+
})
187+
146188
describe('URL parameter construction', () => {
147189
it('should construct URL with all parameters correctly', async () => {
148190
const args: any = {

0 commit comments

Comments
 (0)