summaryrefslogtreecommitdiff
path: root/minetest.conf.example
Commit message (Expand)AuthorAge
* Mod profiling supportsapier2014-08-19
* Remove indev mapgenproller2014-07-12
* Remove math mapgenproller2014-07-12
* Add separate download timeout to allow download of bigger files or on low ban...sapier2014-06-26
* Add setting for tooltips show delay.RealBadAngel2014-06-25
* Added show_debug to minetest.conf.example0gb.us2014-06-09
* Remove settings not used any longersapier2014-05-24
* Item entity stacks merge on the ground.RealBadAngel2014-05-23
* Add support for interlaced polarized 3d screenssapier2014-05-18
* Add proper lua api deprecated handlingsapier2014-04-29
* Add download rate to media progress bar (non http mode only!)sapier2014-04-29
* Add support for dpi based HUD scalingsapier2014-04-27
* Remove liquid_finite and weatherproller2014-04-18
* Add third person viewBlockMen2014-04-12
* Infer ipv6_server from bind_address; fix client connect to IN(6)ADDR_ANYKahrl2014-04-10
* Normal maps generation on the fly.RealBadAngel2014-03-21
* Tune block emerge and sending parameters to more aggressive valueskwolekr2014-02-08
* Make flag strings clear specified flag with 'no' prefixkwolekr2014-02-08
* Add the option to bind to a specific addressShadowNinja2014-02-05
* Update minetest.conf.examplekwolekr2014-02-03
* Add forceloadingNovatux2014-01-11
* Fixed minetest reliable udp implementation (compatible to old clients)sapier2014-01-10
* Revert "Improve (re)spawn, add cache_block_before_spawn and max_spawn_height ...ShadowNinja2014-01-06
* Actually pause singleplayer game in pause menu and use lower maximum FPS in itPerttu Ahola2014-01-06
* Fix wrong names for parallax settings in config example.RealBadAngel2013-12-22
* Add setting to disable direction dependent fog and sky colorssapier2013-12-15
* Add alpha setting to font shadowBlockMen2013-12-14
* Replace any direct curl usage by httpfetchsapier2013-12-13
* Rewrite client media download and support hash-based remote downloadKahrl2013-12-13
* Add configurable font shadow.Ilya Zhuravlev2013-12-12
* Improve (re)spawn, add cache_block_before_spawn and max_spawn_height settingssweetbomber2013-12-05
* Shaders rework.RealBadAngel2013-12-03
* Split server/client port setting to avoid port number clashes in mainmenusapier2013-11-28
* Increase liquid_loop_max to 10000 againPilzAdam2013-11-17
* Lower the default max_users from 100 to 15ShadowNinja2013-09-28
* Add configurable PRAGMA synchronous =proller2013-09-17
* Add fallback font support for some languages.Ilya Zhuravlev2013-09-08
* Fix remnants of s32 enable_shadersKahrl2013-09-04
* Add a setting for HighPrecisionFPU (fixes #763).Ilya Zhuravlev2013-08-25
* Omnicleanup: header cleanup, add ModApiUtil shared between game and mainmenuKahrl2013-08-14
* Remove farmeshKahrl2013-08-13
* Make freetype usage configureable by a settingPilzAdam2013-08-04
* Change large amount of objects to be configurable via a setting in minetest.c...Novatux2013-08-04
* Weather supportproller2013-07-27
* Fix modstore URLsPilzAdam2013-07-22
* Disable gamemanager by defaultPilzAdam2013-07-22
* Masterserver mods announse, ipv6, better curl errorsproller2013-07-13
* Add texture bumpmapping feature.RealBadAngel2013-07-04
* Update wiki urlBlockMen2013-07-03
* Replace C++ mainmenu by formspec powered onesapier2013-07-02
"assert", "error", "ipairs", "next", "pairs", "select", "tonumber", "tostring", "type", "unpack", "_VERSION" } --print is actually minetest.chat_send_all() --using advtrains.print_concat_table because it's cool local function safe_print(t, ...) local str=advtrains.print_concat_table({t, ...}) minetest.log("action", "[atlatc] "..str) minetest.chat_send_all(str) end local function safe_date() return(os.date("*t",os.time())) end -- string.rep(str, n) with a high value for n can be used to DoS -- the server. Therefore, limit max. length of generated string. local function safe_string_rep(str, n) if #str * n > 2000 then debug.sethook() -- Clear hook error("string.rep: string length overflow", 2) end return string.rep(str, n) end -- string.find with a pattern can be used to DoS the server. -- Therefore, limit string.find to patternless matching. -- Note: Disabled security since there are enough security leaks and this would be unneccessary anyway to DoS the server local function safe_string_find(...) --if (select(4, ...)) ~= true then -- debug.sethook() -- Clear hook -- error("string.find: 'plain' (fourth parameter) must always be true for security reasons.") --end return string.find(...) end local mp=minetest.get_modpath("advtrains_luaautomation") local p_api_getstate, p_api_setstate = dofile(mp.."/passive.lua") local static_env = { --core LUA functions print = safe_print, string = { byte = string.byte, char = string.char, format = string.format, len = string.len, lower = string.lower, upper = string.upper, rep = safe_string_rep, reverse = string.reverse, sub = string.sub, find = safe_string_find, }, math = { abs = math.abs, acos = math.acos, asin = math.asin, atan = math.atan, atan2 = math.atan2, ceil = math.ceil, cos = math.cos, cosh = math.cosh, deg = math.deg, exp = math.exp, floor = math.floor, fmod = math.fmod, frexp = math.frexp, huge = math.huge, ldexp = math.ldexp, log = math.log, log10 = math.log10, max = math.max, min = math.min, modf = math.modf, pi = math.pi, pow = math.pow, rad = math.rad, random = math.random, sin = math.sin, sinh = math.sinh, sqrt = math.sqrt, tan = math.tan, tanh = math.tanh, }, table = { concat = table.concat, insert = table.insert, maxn = table.maxn, remove = table.remove, sort = table.sort, }, os = { clock = os.clock, difftime = os.difftime, time = os.time, date = safe_date, }, POS = function(x,y,z) return {x=x, y=y, z=z} end, getstate = p_api_getstate, setstate = p_api_setstate, --interrupts are handled per node, position unknown. --however external interrupts can be set here. interrupt_pos = function(pos, imesg) if not type(pos)=="table" or not pos.x or not pos.y or not pos.z then debug.sethook() error("Invalid position supplied to interrupt_pos") end atlatc.interrupt.add(0, pos, {type="ext_int", ext_int=true, message=imesg}) end, } for _, name in pairs(safe_globals) do static_env[name] = _G[name] end --The environment all code calls get is a table that has set static_env as metatable. --In general, every variable is local to a single code chunk, but kept persistent over code re-runs. Data is also saved, but functions and userdata and circular references are removed --Init code and step code's environments are not saved -- S - Table that can contain any save data global to the environment. Will be saved statically. Can't contain functions or userdata or circular references. -- F - Table global to the environment, can contain volatile data that is deleted when server quits. -- The init code should populate this table with functions and other definitions. local proxy_env={} --proxy_env gets a new metatable in every run, but is the shared environment of all functions ever defined. -- returns: true, fenv if successful; nil, error if error function env_proto:execute_code(localenv, code, evtdata, customfct) local metatbl ={ __index = function(t, i) if i=="S" then return self.sdata elseif i=="F" then return self.fdata elseif i=="event" then return evtdata elseif customfct and customfct[i] then return customfct[i] elseif localenv and localenv[i] then return localenv[i] end return static_env[i] end, __newindex = function(t, i, v) if i=="S" or i=="F" or i=="event" or (customfct and customfct[i]) or static_env[i] then debug.sethook() error("Trying to overwrite environment contents") end localenv[i]=v end, } setmetatable(proxy_env, metatbl) local fun, err=loadstring(code) if not fun then return false, err end setfenv(fun, proxy_env) local succ, data = pcall(fun) if succ then data=localenv end return succ, data end function env_proto:run_initcode() if self.init_code and self.init_code~="" then local old_fdata=self.fdata self.fdata = {} atprint("[atlatc]Running initialization code for environment '"..self.name.."'") local succ, err = self:execute_code({}, self.init_code, {type="init", init=true}) if not succ then atwarn("[atlatc]Executing InitCode for '"..self.name.."' failed:"..err) self.init_err=err if old_fdata then self.fdata=old_fdata atwarn("[atlatc]The 'F' table has been restored to the previous state.") end end end end function env_proto:run_stepcode() if self.step_code and self.step_code~="" then local succ, err = self:execute_code({}, self.step_code, nil, {}) if not succ then --TODO end end end --- class interface function atlatc.env_new(name) local newenv={ name=name, init_code="", step_code="", sdata={} } setmetatable(newenv, {__index=env_proto}) return newenv end function atlatc.env_load(name, data) local newenv={} setmetatable(newenv, {__index=env_proto}) newenv:load(name, data) return newenv end function atlatc.run_initcode() for envname, env in pairs(atlatc.envs) do env:run_initcode() end end function atlatc.run_stepcode() for envname, env in pairs(atlatc.envs) do env:run_stepcode() end end