Skip to content

Commit

Permalink
Warn about unsupported file extensions for media
Browse files Browse the repository at this point in the history
  • Loading branch information
Zughy committed Aug 6, 2023
1 parent c816aa5 commit 98f097d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion doc/lua_api.md
Expand Up @@ -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`,
Expand Down
2 changes: 1 addition & 1 deletion src/server.cpp
Expand Up @@ -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;
}
Expand Down

0 comments on commit 98f097d

Please sign in to comment.