summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2021-01-30 14:35:34 +0100
committersfan5 <sfan5@live.de>2021-02-01 23:00:13 +0100
commit40ad9767531beb6cf2e8bd918c9c9ed5f2749320 (patch)
tree957666f5b93f3e02de412813f0a0a6393b325333 /doc
parenta01a02f7a1ec915c207632085cd5f24eab28da17 (diff)
downloadminetest-40ad9767531beb6cf2e8bd918c9c9ed5f2749320.tar.gz
minetest-40ad9767531beb6cf2e8bd918c9c9ed5f2749320.tar.bz2
minetest-40ad9767531beb6cf2e8bd918c9c9ed5f2749320.zip
Revise dynamic_add_media API to better accomodate future changes
Diffstat (limited to 'doc')
-rw-r--r--doc/lua_api.txt22
1 files changed, 12 insertions, 10 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index 18499e15a..9c2a0f131 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -5446,20 +5446,22 @@ Server
* Returns a code (0: successful, 1: no such player, 2: player is connected)
* `minetest.remove_player_auth(name)`: remove player authentication data
* Returns boolean indicating success (false if player nonexistant)
-* `minetest.dynamic_add_media(filepath)`
- * Adds the file at the given path to the media sent to clients by the server
- on startup and also pushes this file to already connected clients.
+* `minetest.dynamic_add_media(filepath, callback)`
+ * `filepath`: path to a media file on the filesystem
+ * `callback`: function with arguments `name`, where name is a player name
+ (previously there was no callback argument; omitting it is deprecated)
+ * Adds the file to the media sent to clients by the server on startup
+ and also pushes this file to already connected clients.
The file must be a supported image, sound or model format. It must not be
modified, deleted, moved or renamed after calling this function.
The list of dynamically added media is not persisted.
- * Returns boolean indicating success (duplicate files count as error)
- * The media will be ready to use (in e.g. entity textures, sound_play)
- immediately after calling this function.
+ * Returns false on error, true if the request was accepted
+ * The given callback will be called for every player as soon as the
+ media is available on the client.
Old clients that lack support for this feature will not see the media
- unless they reconnect to the server.
- * Since media transferred this way does not use client caching or HTTP
- transfers, dynamic media should not be used with big files or performance
- will suffer.
+ unless they reconnect to the server. (callback won't be called)
+ * Since media transferred this way currently does not use client caching
+ or HTTP transfers, dynamic media should not be used with big files.
Bans
----