@@ -12,7 +12,6 @@ import {
1212 getAssetBundlesBaseUrl ,
1313 PIPE_SCENE_CONSOLE ,
1414 playerHeight ,
15- PREVIEW ,
1615 WSS_ENABLED
1716} from 'config'
1817import { gridToWorld } from 'lib/decentraland/parcels/gridToWorld'
@@ -43,7 +42,6 @@ import { joinBuffers } from 'lib/javascript/uint8arrays'
4342import { nativeMsgBridge } from 'unity-interface/nativeMessagesBridge'
4443import { _INTERNAL_WEB_TRANSPORT_ALLOC_SIZE } from 'renderer-protocol/transports/webTransport'
4544import { createInternalEngine } from './runtime-7/engine'
46- import { initSourcemap } from './runtime-7/sourcemap'
4745import { forceStopScene } from './parcelSceneManager'
4846
4947export enum SceneWorkerReadyState {
@@ -196,8 +194,7 @@ export class SceneWorker {
196194 readFile : this . readFile . bind ( this ) ,
197195 initialEntitiesTick0 : Uint8Array . of ( ) ,
198196 hasMainCrdt : false ,
199- internalEngine : undefined ,
200- sourcemap : undefined
197+ internalEngine : undefined
201198 }
202199
203200 // if the scene metadata has a base parcel, then we set it as the position
@@ -233,27 +230,7 @@ export class SceneWorker {
233230 }
234231 }
235232
236- async loadSourcemap ( ) {
237- try {
238- // Only sdk7 scenes
239- if ( ! this . rpcContext . sdk7 ) return
240-
241- // Only preview or production scenes with the DEBUG_MOD or DEBUG_SCENE_LOG param
242- if ( ! PREVIEW && ! DEBUG_SCENE_LOG ) return
243-
244- const mainFile = PREVIEW
245- ? this . loadableScene . entity . metadata . main
246- : `${ this . loadableScene . entity . metadata . main } .map`
247- const file = await this . readFile ( mainFile , 'text' )
248- if ( ! file ?. content ) return
249- return ( await initSourcemap ( file . content , PREVIEW ) ) ?? undefined
250- } catch ( _ ) { }
251- }
252-
253- async readFile < T extends 'text' | 'arraybuffer' = 'arraybuffer' > (
254- fileName : string ,
255- type ?: T
256- ) : Promise < T extends 'text' ? { hash : string ; content : string } : { hash : string ; content : Uint8Array } > {
233+ async readFile ( fileName : string ) {
257234 // filenames are lower cased as per https://adr.decentraland.org/adr/ADR-80
258235 const normalized = fileName . toLowerCase ( )
259236
@@ -268,11 +245,7 @@ export class SceneWorker {
268245 const response = await fetch ( url )
269246
270247 if ( ! response . ok ) throw new Error ( `Error fetching file ${ file } from ${ url } ` )
271- if ( ! type || type === 'arraybuffer' ) {
272- return { hash, content : new Uint8Array ( await response . arrayBuffer ( ) ) } as any
273- }
274-
275- return { hash, content : await response . text ( ) } as any
248+ return { hash, content : new Uint8Array ( await response . arrayBuffer ( ) ) }
276249 }
277250 }
278251
@@ -433,7 +406,6 @@ export class SceneWorker {
433406 this . metadata . scene . parcels ,
434407 showAsPortableExperience
435408 )
436- this . rpcContext . sourcemap = await this . loadSourcemap ( )
437409 }
438410 sceneEvents . emit ( SCENE_LOAD , signalSceneLoad ( this . loadableScene ) )
439411 }
0 commit comments