Game Development Community

Secure Script Environment?

by Demolishun · in Torque Game Engine · 05/13/2004 (8:50 pm) · 1 replies

Is there a way to create a separate secure script environment? This environment would allow scripts to be written by the user, but would not be able to escape to do harm on the rest of the game. My other option is to embed another scripting language (basic, tcl, etc) that is limited in function. I guess I am curious as to what Think Tanks did. Also, can scripts be updated on the fly? Perhaps even in game inside the sim? By the user?

Thanks,
Frank

About the author

I love programming, I love programming things that go click, whirr, boom. For organized T3D Links visit: http://demolishun.com/?page_id=67


#1
05/13/2004 (10:41 pm)
The nature of programming languages is to become more and more powerful, so the modern incarnations of all of those languages could do harm to the system/game if curtailed. TorqueScript is actually fairly safe - it might be able to blow up your game but it can't permanently damage your system.

You might look at what Python did for its secure script environments, or take a page from the hardware developers and study the hardware hooks that make protected mode operating systems like Unix, OSX, and (in theory :P) windows possible.

I implemented a secure JavaScript environment a few years back with a ring-based architecture borrowed from Intel. It worked pretty well, although I never had time to go anywhere beyond a prototype with it.