From 98f097dc2fd818637e7750d491fe7d394a94d9e8 Mon Sep 17 00:00:00 2001 From: Zughy <63455151+Zughy@users.noreply.github.com> Date: Sun, 6 Aug 2023 14:16:00 +0200 Subject: [PATCH] Warn about unsupported file extensions for media --- doc/lua_api.md | 13 ++++++++++++- src/server.cpp | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/doc/lua_api.md b/doc/lua_api.md index 356c28cc8..28446ac4d 100644 --- a/doc/lua_api.md +++ b/doc/lua_api.md @@ -259,7 +259,18 @@ time, if necessary. (See [`Settings`]) Media files (textures, sounds, whatever) that will be transferred to the client and will be available for use by the mod and translation files for -the clients (see [Translations]). +the clients (see [Translations]). Accepted characters for names are: + + a-zA-Z0-9_.- + +Accepted formats are: + + images: .png, .jpg, .bmp, (deprecated) .tga + sounds: .ogg vorbis + models: .x, .b3d, .obj + +Other formats won't be sent to the client (e.g. you can store .blend files +in a folder for convenience, without the risk that such files are transferred) It is suggested to use the folders for the purpose they are thought for, eg. put textures into `textures`, translation files into `locale`, diff --git a/src/server.cpp b/src/server.cpp index 2dca13cf0..445955020 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -2513,7 +2513,7 @@ bool Server::addMediaFile(const std::string &filename, { // If name contains illegal characters, ignore the file if (!string_allowed(filename, TEXTURENAME_ALLOWED_CHARS)) { - infostream << "Server: ignoring illegal file name: \"" + warningstream << "Server: ignoring file as it has disallowed characters: \"" << filename << "\"" << std::endl; return false; }