Skip to content

Commit

Permalink
chore: 'about' response local scene parcels (#1013)
Browse files Browse the repository at this point in the history
  • Loading branch information
pravusjif authored Oct 1, 2024
1 parent ed941d5 commit 95177c9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async function runApp(
) {
const cmd = isWindows ? 'start' : 'open'
try {
const params = `realm=${realm}&position=${baseCoords.x},${baseCoords.y}&local-scene=true`
const params = `realm=${realm}&position=${baseCoords.x},${baseCoords.y}&local-scene=true&debug=true`
const app = `decentraland://"${params}"`
await components.spawner.exec(cwd, cmd, [app], { silent: true })
components.logger.info(`Desktop client: decentraland://${params}\n`)
Expand Down
9 changes: 7 additions & 2 deletions packages/@dcl/sdk-commands/src/commands/start/server/realm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ import { upgradeWebSocketResponse } from '@well-known-components/http-server/dis
* It runs using @dcl/mini-comms implementing RFC-5
*/

export function setupRealmAndComms(components: PreviewComponents, router: Router<PreviewComponents>) {
export function setupRealmAndComms(
components: PreviewComponents,
router: Router<PreviewComponents>,
localSceneParcels: string[] = []
) {
router.get('/about', async (ctx) => {
const host = ctx.url.host

const body: AboutResponse = {
const body: AboutResponse & { configurations: { localSceneParcels: string[] } } = {
acceptingUsers: true,
bff: { healthy: false, publicUrl: host },
comms: {
Expand All @@ -24,6 +28,7 @@ export function setupRealmAndComms(components: PreviewComponents, router: Router
configurations: {
networkId: 0,
globalScenesUrn: [],
localSceneParcels,
scenesUrn: [],
realmName: 'LocalPreview'
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,14 @@ export async function wireRouter(components: PreviewComponents, workspace: Works
return next()
})

setupRealmAndComms(components, router)
const localSceneParcels: string[] = []
for (const project of workspace.projects) {
for (const parcel of project.scene.scene.parcels) {
localSceneParcels.push(parcel)
}
}

setupRealmAndComms(components, router, localSceneParcels)
await setupEcs6Endpoints(components, router, workspace)

components.server.setContext(components)
Expand Down

0 comments on commit 95177c9

Please sign in to comment.