🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Prevent importing of functions and use of shared classes

Started by
1 comment, last by Solokiller 9 years, 6 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.

Advertisement

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

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

This topic is closed to new replies.

Advertisement