Commit Graph

10 Commits

Author SHA1 Message Date
Auke Kok ad884f23d4 New timer design.
I could honestly not make much sense of the timer implementation
that was here. Instead I've implemented the type of timer algorithm
that I've used before, and tested it instead.

The concept is extremely simple: all timers are put in an ordered
list. We check every server tick if any of the timers have
elapsed, and execute the function associated with this timer.

We know that many timers by themselves cause new timers to be
added to this list, so we iterate *backwards* over the timer
list. This means that new timers being added while timers are
being executed, can never be executed in the same function pass,
as they are always appended to the table *after* the end of
the table, which we will never reach in the current pass over
all the table elements.

We switch time keeping to minetest.get_us_time(). dtime is
likely unreliable and we have our own high-res timer that we
can fix if it is indeed broken. This removes the need to do
any sort of time keeping.
2016-01-29 01:04:51 -05:00
Robert Zenz c32847838d Add more ways to pass data to check_player_privs
The callback can now be invoked with either the player object or name as
the first parameter, and with either a table or a list of strings, like
this:

    minetest.check_player_privs(player_name, { shout = true, fly = true })
    minetest.check_player_privs(player_name, "shout", "fly")
    minetest.check_player_privs(player, { shout = true, fly = true })
    minetest.check_player_privs(player, "shout", "fly")
2015-10-22 19:55:48 +02:00
kwolekr f062bbd7a1 Add /emergeblocks command and core.emerge_area() Lua API 2015-09-23 15:56:24 -04:00
kwolekr 2b04ab874d SAPI: Track last executed mod and include in error messages 2015-08-12 23:56:12 -04:00
HybridDog 8383a61eac Decrease minetest.after globalstep lag
* abort if theres no active timer
* only reduce the timer.time of all timers when its necessary
* move updating timers_to_add into a seperate function
2015-06-06 21:00:38 +02:00
Novatux 75622c30be Add code to support raillike group names 2015-05-12 20:48:55 +02:00
kwolekr 5aeeb219e3 Simplify deleteblocks chat command argument parsing
Add optional core.pos_to_string decimal place rounding
Move core.string_to_pos to builtin/common/misc_helpers.lua for consistency
2015-01-15 18:05:13 -05:00
Zefram aebbcbf398 Fix indexing error in timer processing 2014-07-16 17:24:39 +02:00
ShadowNinja c4359ff65c Use "core" namespace internally 2014-05-08 13:02:04 -04:00
ShadowNinja 1cd512913e Organize builtin into subdirectories 2014-05-07 17:14:23 -04:00