Advertisement

Prevent importing of functions and use of shared classes

Started by December 05, 2014 03:33 PM
1 comment, last by Solokiller 10 years, 2 months ago

Is there any way to prevent a script from using imported functions and shared classes?

We use multiple modules, where accessing another module's data is highly discouraged.

Imported functions only work if the application explicitly binds them, with BindAllImportedFunctions (or manually with BindImportedFunction).

If you want to give an explicit error if the script declares imported functions, then you can call GetImportedFunctionCount after compiling the module.

Shared classes doesn't share the data itself, only the code. It is used to allow the application to pass objects between modules and allow them to understand each other. But if the application do not pass the objects between modules then the modules cannot access another module's data even if it declares shared classes.

Here too, if you want to give an explicit error if the script declares shared classes, then you can enumerate the class declarations after compiling the module and check if any of them are shared by getting the object type flags and check the asOBJ_SHARED bit.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Advertisement

Ok, thanks for explaining. I'll add a post build check for both.

This topic is closed to new replies.

Advertisement