// define script security contexts to restrict commands to certain contexts // do NOT modify persistidents 0 // supported contexts const context_core 0 // hardcoded scripts const context_cfg 1 // known scripts const context_prompt 2 // command prompt const context_mapcfg 3 // map configs, we don't trust them const context_mdlcfg 4 // mdl configs, same // set allowed commands for the map config context mapcfgidents = [loadnotexture loadsky mapmodelreset mapmodel texturereset texture fog fogcolour mapsoundreset mapsound watercolour shadowyaw] mdlcfgidents = [md2anim md2emit md2tag md3anim md3emit md3link md3load md3skin mdlalphatest mdlalphablend mdlcachelimit mdlcullface mdlscale mdlshadowdist mdltrans mdltranslucent mdlvertexlight mdlattribute] loop i (listlen $mapcfgidents) [ scriptcontext $context_mapcfg (at $mapcfgidents $i) ] loop i (listlen $mdlcfgidents) [ scriptcontext $context_mdlcfg (at $mdlcfgidents $i) ] // isolate the map config context // this disables access from this context to identifiers located in other contexts // also it removes all aliases created in this context once the running context changes isolatecontext $context_mapcfg isolatecontext $context_mdlcfg // secure this configuration for the rest of the game sealcontexts persistidents 1