Jump to content
  • Advertisement
Sign in to follow this  
Solokiller

Prevent importing of functions and use of shared classes

This topic is 1415 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!