1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Merge remote-tracking branch 'upstream/master' into Visuals-Vol-2

This commit is contained in:
Gefüllte Taubenbrust 2024-06-11 13:59:14 +02:00
commit cd6e304cfa
172 changed files with 27747 additions and 18949 deletions

View file

@ -2547,9 +2547,7 @@ bool Server::addMediaFile(const std::string &filename,
// Read data
std::string filedata;
if (!fs::ReadFile(filepath, filedata)) {
errorstream << "Server::addMediaFile(): Failed to open \""
<< filename << "\" for reading" << std::endl;
if (!fs::ReadFile(filepath, filedata, true)) {
return false;
}
@ -2717,9 +2715,7 @@ void Server::sendRequestedMedia(session_t peer_id,
// Read data
std::string data;
if (!fs::ReadFile(m.path, data)) {
errorstream << "Server::sendRequestedMedia(): Failed to read \""
<< name << "\"" << std::endl;
if (!fs::ReadFile(m.path, data, true)) {
continue;
}
file_size_bunch_total += data.size();
@ -3620,7 +3616,7 @@ namespace {
auto filepath = fs::CreateTempFile();
if (filepath.empty())
return "";
std::ofstream os(filepath, std::ios::binary);
auto os = open_ofstream(filepath.c_str(), true);
if (!os.good())
return "";
os << content;
@ -4202,7 +4198,7 @@ Translations *Server::getTranslationLanguage(const std::string &lang_code)
for (const auto &i : m_media) {
if (str_ends_with(i.first, suffix)) {
std::string data;
if (fs::ReadFile(i.second.path, data)) {
if (fs::ReadFile(i.second.path, data, true)) {
translations->loadTranslation(data);
}
}