Commit Graph

26 Commits (e98d421aff046a2d9a9b87516779603dc170b209)

Author SHA1 Message Date
you 5004ad17f0 Add minetest.is_player (#7013)
* Add minetest.is_player

* First use for is_player
2018-06-03 17:32:00 +02:00
ShadowNinja dfb4074a5a Use a settings object for the main settings
This unifies the settings APIs.

This also unifies the sync and async registration APIs, since the async
registration API did not support adding non-functions to the API table.
2017-05-06 15:33:19 -04:00
Loïc Blot c99bfa77db Implement delayed server shutdown with cancelation (#4664) 2017-04-15 23:19:18 +02:00
red-001 9a9db57881 Give CSM access to use `core.colorize()` (#5113) 2017-03-17 19:20:13 +01:00
Loïc Blot 04680f648a [CSM] sound_play & sound_stop support + client_lua_api doc (#5096)
* squashed: CSM: Implement register_globalstep
  * Re-use fatal error mechanism from server to disconnect client on CSM error
  * Little client functions cleanups

* squashed: CSM: add core.after function
  * core.after is shared code between client & server
  * ModApiUtil get_us_time feature enabled for client
2017-03-13 23:56:05 +01:00
rubenwardy be9b0b2aea Add minetest.player_exists() (#5064) 2017-01-18 11:19:57 +01:00
red-001 a66a237c19 Don't send a join message in singleplayer mode. 2016-12-03 00:13:02 +01:00
orwell96 4e24ecae21 Make supplying empty formspec strings close the formspec (#4737)
This will only happen if the formname matches or if formname is "".
2016-11-23 02:15:22 +10:00
Rui d9ccbd026e Fix typo in core.after (#4560) 2016-10-01 16:16:50 +02:00
Xunto cd5ec468ef Move on join and on leave messages to lua (#4460) 2016-08-22 20:21:48 +02:00
Tim 0857d5cd21 Builtin: Fix check for a player object in core.check_player_privs
core.check_player_privs accepts as first argument a name or player object, but just tested for a string.
This caused crashes inside builtin, when being passed any unexpected types.

This provides a better (duck-typing like) test, better error reporting.
2016-07-26 04:15:06 +01:00
Ekdohibs e7b84d7db6 Add colored text (not only colored chat).
Add documentation, move files to a proper place and avoid memory leaks.
Make it work with most kind of texts, and allow backgrounds too.
2016-05-31 17:34:29 +02:00
TriBlade9 43390af812 Colored chat working as expected for both freetype and non-freetype builds. @nerzhul improvements * Add unit tests * Fix coding style * move guiChatConsole.hpp to client/ 2016-05-31 17:34:29 +02:00
Auke Kok 447e6d4160 Fix timer initialization.
This fixes the problem that the first timer tick is an
overrun and causes all timers to expire immediately.

replaces #4003
2016-04-21 10:14:59 +01:00
Rui914 7a9e8367db Faster insertion into table 2016-03-06 23:42:04 +00:00
Jeija 6128dc7a07 Add Lua interface to HTTPFetchRequest
This allows mods to perform both asynchronous and synchronous HTTP
requests. Mods are only granted access to HTTP APIs if either mod
security is disabled or if they are whitelisted in any of the
the secure.http_mods and secure.trusted_mods settings.

Adds httpfetch_caller_alloc_secure to generate random, non-predictable
caller IDs so that lua mods cannot spy on each others HTTP queries.
2016-02-22 15:39:41 +01:00
Auke Kok b37d266632 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 b52fd16e28 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 23316c9f92 Add /emergeblocks command and core.emerge_area() Lua API 2015-09-23 15:56:24 -04:00
kwolekr 2fb4917d8e SAPI: Track last executed mod and include in error messages 2015-08-12 23:56:12 -04:00
HybridDog d4f46baafa 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 84334c37cc Add code to support raillike group names 2015-05-12 20:48:55 +02:00
kwolekr 4e33a698b7 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 9940c2c4cd Fix indexing error in timer processing 2014-07-16 17:24:39 +02:00
ShadowNinja 9718e20bfa Use "core" namespace internally 2014-05-08 13:02:04 -04:00
ShadowNinja 6001210df6 Organize builtin into subdirectories 2014-05-07 17:14:23 -04:00