You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to use Spherun to run a script that could exist outside the game directory, while maintaining the ability to load scripts from inside the game directory as if Spherun had been started with the game's manifest.
This means being able to override the game path and start script path, so that any scripts loaded from the game have the correct path resolution for $/ and @/ paths.
There's a--not insurmountable!--design limitation to do with this, in that the internal path canonicalizer currently assumes any filename beginning with $/ (the location of the startup script) is always reachable from @/ (the location of the game manifest) and canonicalizes it as such. In this way a game gets guaranteed that FS.fullPath always returns the same path string for the same file, allowing the path to be used as a lookup key for, e.g. caching, map engines (think persist.js-like solutions), etc.
Note that this differs from Cell, which treats $/ and @/ as distinct roots. The potential for aliasing in this case was accepted as a necessary tradeoff in the name of enabling out-of-source builds without compromising the integrity of the SphereFS sandbox.
Use case:
I want to use Spherun to run a script that could exist outside the game directory, while maintaining the ability to load scripts from inside the game directory as if Spherun had been started with the game's manifest.
This means being able to override the game path and start script path, so that any scripts loaded from the game have the correct path resolution for
$/
and@/
paths.e.g.
spherun --gamepath /my/game --startscriptpath /my/game/src /my/testframework/testharness.js
In this example,
testharness.js
would now be sandboxed to the game directory, even though it doesn't reside there.The text was updated successfully, but these errors were encountered: