Disable world exposure #417
Replies: 1 comment 1 reply
-
Hello! So at the moment there is no nice way to do this, but the world is set as a global in the very first Removing this initializer (probably in a startup system), will prevent If you disable the Another way of doing this, is invalidating the thread local which backs this value i.e. adding a context initializer which retrieves the world and then: let world = ThreadWorldContainer.try_get_world().unwrap();
world.invalidate(); this will render ANY AND ALL accesses to the world null and void including in your own bindings. This type of hardcode invalidation is probably mostly suitable for applications in which you just don't want scripts to change anything directly. As for a longer term solution, I should be able to make this global optional, probably by setting it through the global registry, allowing you to filter it like any other |
Beta Was this translation helpful? Give feedback.
-
Hello, after testing the plugin, it's wonderful, love it, but I'm going to use it to allow my game to be moddable by third party people
The problem is that I can't trust people, using luau doesn't completely fix the problem, as this plugin currently exposes "world" to all scripts, and after taking a look at the great documentation, world is just "too powerful", it can alter arbitrary any part of the game, so my idea is to disable it, I would like to disable any binding unless explicitly allowed.
So I can develop my game custom mod api such as
instead of using world to directly insert an entity, modder would use my custom add_unit method for it, I already saw it's perfectly possible to create objects and functions (awesome work!), so I only need to disable world and any other potentially powerful type
Thanks in advance 🙏 !
Beta Was this translation helpful? Give feedback.
All reactions