mojo_client/bin/scripts/config.def
False.Genesis 7ffc21bec5 * implemented automatic conf file loading using newly added "lgetfiles" script func.
* forgot to mention on last commit: a) support almost infinite DefScript args now: @0 ... @4294967295; b) speeded up DefScript execution speed by ~10%
* TODO: load .def files the same way as the conf files now.
2007-06-09 21:46:04 +00:00

36 lines
830 B
Modula-2

#permission=255
// Load all conf files from directory /conf/
// get all *.conf file names from /conf/ directory, store the names in list 'fl' and the amount in 'fcount'
SET,fcount ?{LGETFILES,fl,conf conf}
LOGDETAIL * Loading ${fcount} conf files.
// iterate over all files and load them; if counter i is equal to the amount of files we are done.
SET,i 0
LOOP
IF ?{EQUAL,${i} ${fcount}}
EXITLOOP
ENDIF
SET,fn ?{LINDEX,fl ${i}}
LOG * Loading conf file [ ${fn} ]
LOADCONF ${fn}
ADD,i 1
ENDLOOP
UNSET fcount
UNSET i
UNSET fn
LDELETE fl
// Apply the configuration
APPLYCONF
LOG * Configuration applied.
// Apply user permissions
APPLYPERMISSIONS
// remove dangerous variables
CLEANUPVARS
// if its not set in the conf file, default it to "." (WoWEmu & MaNGOS style)
DEFAULT,#CMDCHAR .