NoCheat, Alpha 2
Posted: 21 Jan 2009, 23:21
I've finally figured out how to shut down non-mod Widgets (I think) and just load game Widgets, in an easy-to-install package for game developers.
This is obviously a big step up in security from WhiteList, and will probably not be suitable for everybody's project (in which case, use WhiteList, or reverse its logic to make it a blacklist application, and remove the part where it shuts down the Widget Selector- sometimes all you'd want is to shut certain things off by default, and obviously this is a lot more rigid- if it's not in you mod/game, it just doesn't load at all).
This must be added as a dependency to your mod / game in order to work. I.E., go into modinfo.tdf, and add it in there. If somebody is clueless and wants an example, lemme know, it's pretty straightforward imo.
100% of the credit for this code goes to Lurker, Trepan and Regret. This version uses Regret's suggested changes, which were based on Lurker's comments in the White List thread and Trepan's original source. I just typed some stuff and copy-pasted.
Please let me know if my fumble-fingered programming broke anything really permanently. Thus far, it seems to be passing all tests- my Widgets load, nothing else does. And it finally works with World Builder!
So, the next step is deciding on a list of non-cheating-but-useful Widgets that may be run with my game, and throwing them into an archive, or into World Builder (might be handy to just make a compilation of stuff that's useful, isn't a cheat, and doesn't break UIs).
Here's the file.
This is obviously a big step up in security from WhiteList, and will probably not be suitable for everybody's project (in which case, use WhiteList, or reverse its logic to make it a blacklist application, and remove the part where it shuts down the Widget Selector- sometimes all you'd want is to shut certain things off by default, and obviously this is a lot more rigid- if it's not in you mod/game, it just doesn't load at all).
This must be added as a dependency to your mod / game in order to work. I.E., go into modinfo.tdf, and add it in there. If somebody is clueless and wants an example, lemme know, it's pretty straightforward imo.
100% of the credit for this code goes to Lurker, Trepan and Regret. This version uses Regret's suggested changes, which were based on Lurker's comments in the White List thread and Trepan's original source. I just typed some stuff and copy-pasted.
Please let me know if my fumble-fingered programming broke anything really permanently. Thus far, it seems to be passing all tests- my Widgets load, nothing else does. And it finally works with World Builder!
So, the next step is deciding on a list of non-cheating-but-useful Widgets that may be run with my game, and throwing them into an archive, or into World Builder (might be handy to just make a compilation of stuff that's useful, isn't a cheat, and doesn't break UIs).
Here's the file.