scontext.cfg 1.2 KB

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