1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-09-30 19:22:14 +00:00

Adjust Server::dynamicAddMedia() and related parts a bit

This commit is contained in:
sfan5 2025-08-26 15:22:36 +02:00
parent c7d45fe51a
commit 0b66465f33
4 changed files with 60 additions and 41 deletions

View file

@ -7379,7 +7379,7 @@ Server
it will not be cached on the client (optional, default false)
* Exactly one of the parameters marked [*] must be specified.
* `callback`: function with arguments `name`, which is a player name
* Pushes the specified media file to client(s). (details below)
* Pushes the specified media file to client(s) as detailed below.
The file must be a supported image, sound or model format.
Dynamically added media is not persisted between server restarts.
* Returns false on error, true if the request was accepted
@ -7388,19 +7388,17 @@ Server
* Details/Notes:
* If `ephemeral`=false and `to_player` is unset the file is added to the media
sent to clients on startup, this means the media will appear even on
old clients if they rejoin the server.
old clients (<5.3.0) if they rejoin the server.
* If `ephemeral`=false the file must not be modified, deleted, moved or
renamed after calling this function.
* Regardless of any use of `ephemeral`, adding media files with the same
name twice is not possible/guaranteed to work. An exception to this is the
use of `to_player` to send the same, already existent file to multiple
chosen players.
renamed after calling this function. This is allowed otherwise.
* Adding media files with the same name twice is not possible.
An exception to this is the use of `to_player` to send the same,
already existent file to multiple chosen players (`ephemeral`=false only).
* You can also call this at startup time. In that case `callback` MUST
be `nil` and you cannot use `ephemeral` or `to_player`, as these logically
do not make sense.
* Clients will attempt to fetch files added this way via remote media,
this can make transfer of bigger files painless (if set up). Nevertheless
it is advised not to use dynamic media for big media files.
this can make transfer of bigger files painless (if set up).
IPC
---