minetest/src/script
Auke Kok 4e59fcf5c1 Add consistent monotonic day counter - get_day_count()
I've written several experimental bits of code that revolve around the
need for a consistent calendar, but implementing one is extremely hard
in mods due to time changes and mods overriding core.get_timeofday(),
which will conflict.

The second part of the problem is that doing this from a mod requires
constant maintenance of a settings file.

An implementation in core is trivial, however, and solves all of
these problems at virtually no cost: No extra branches in server
steps, and a single branch when minetest.set_time_of_day(), which is
entirely reasonable.

We store the day_count value in env_meta.txt.

The use case is obvious: This change allows mods to create an actual
virtual calendar, or properly account for seasonal changes, etc..

We add a "/days" chatcommand that displays the current day count. No
permissions are needed. It can only retrieve the day count, not
modify it.
2016-03-09 01:45:23 +01:00
..
common Add Lua interface to HTTPFetchRequest 2016-02-22 15:39:41 +01:00
cpp_api s_env.{cpp, h} cleanups 2016-03-07 19:54:26 +01:00
lua_api Add consistent monotonic day counter - get_day_count() 2016-03-09 01:45:23 +01:00
CMakeLists.txt Clean up and tweak build system 2015-03-27 15:00:48 -04:00
scripting_game.cpp Add Lua interface to HTTPFetchRequest 2016-02-22 15:39:41 +01:00
scripting_game.h Improve Script CPP API diagnostics 2015-08-05 21:13:03 -04:00
scripting_mainmenu.cpp Push error handler afresh each time lua_pcall is used 2015-08-27 01:56:06 +02:00
scripting_mainmenu.h Fix code style of async API 2014-04-27 16:15:53 -04:00