Advertisement

hi, one question

Started by March 06, 2010 09:35 PM
5 comments, last by WitchLord 14 years, 8 months ago
hi, am back. I have question, i cannot allow any script to run in my host so before starting to run a script i want to scan for any possible illegal functions in script. Is there a way to use AS's apis to do it or use Builer/Compiler/Parse classes of AS to do it? Regards ragha
Scripts in AngelScript cannot call any functions that haven't been registered with the script engine by the application.

There is currently no methods exposed that let you enumerate the functions that are called by the script. Though I suppose it wouldn't be too difficult to implement. Still, I really don't think you need this.

Regards,
Andreas

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
Thanks.

I was going through the code, looks like this class does the job,
"asIScriptModule"
I have to register the script as a module before using it, is this correct?

regards
ragha
hi,

My problem is similar to "Ideas for class inheritance" to this.
By checking the script code, i want to throw an exception that u have violated the rule of overriding as AS currently does not support this feature of "final" at compiler level. Pls give your suggestion, can i use asIScriptModule to do this checking or some other internal class is needed. Also as you had said earlier AS bytecode has no mapping to source code statements,is it right? If so how can i achieve it?

regards
ragha
There is currently no built-in way to determine if a script class is overriding an inherited method. However, if you're willing to change the library a bit you could determine this by looking at the asCObjectType::virtualFunctionTable and determine if the method is from the base type or from the derived type.

What do you mean with mapping to source code statement?

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

hi,

What do you mean with mapping to source code statement?
===>I had asked you how to retreive statements of functions, you had confirmed this is not saved in the Module/Builder,only transformed information is kept.

Thanks.

regards
ragha
Advertisement
Yes, that's true. If you need to show the original source code the application needs to keep a copy by itself, or reload it from the disk as needed.

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

This topic is closed to new replies.

Advertisement