Godot-GDShell icon indicating copy to clipboard operation
Godot-GDShell copied to clipboard

Add an export script, that excludes unsafe commands from release builds.

Open Kubulambula opened this issue 2 years ago • 3 comments

I envisioned GDShell as a safe console by default with commands, that should don't do any harm to your projects if a user has access to it. Some commands useful for debugging have to be unsafe to be useful and providing a secondary repository with commands is just annoying to use for both developers and users.

We could make an export script that looks through all available GDShell commands and excludes unsafe scripts by looking at other SAFE flag. It would be a property of GDShellCommand and thus can be overridden in user commands if they wish to exclude their scripts from release builds.

Kubulambula avatar Nov 02 '23 10:11 Kubulambula

I think this is a really good way to handle it (well obviously given its based off my suggestion). It would still be nice to see an option to allow unsafe commands even in release builds. Personally I think its cool if players can do whatever to alter game logic so long as its not hurting anyone else, so for my pourposes I may want to allow things like scene instancing and PCK injection.

I presume SAFE would default to false, so being able to use them in a relesae that dosen't allow it is off by default since most developers won't know to set it or may forget.

tryoxiss avatar Nov 02 '23 17:11 tryoxiss

We could add a project settings to handle all of those cases.

I presume SAFE would default to false, so being able to use them in a relesae that dosen't allow it is off by default since most developers won't know to set it or may forget.

Or maybe GDShell could output a message with an explanation of why the command cannot be run in release build and where to change that.

Kubulambula avatar Nov 04 '23 17:11 Kubulambula

Thats good!

Yeah that would probably be a good thing to add!

tryoxiss avatar Nov 06 '23 19:11 tryoxiss