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

Bypass media transfer in single player

This commit is contained in:
sfan5 2024-01-20 16:26:05 +01:00
parent 16aaef097a
commit 93381014a0
7 changed files with 81 additions and 25 deletions

View file

@ -4108,6 +4108,19 @@ Translations *Server::getTranslationLanguage(const std::string &lang_code)
return translations;
}
std::unordered_map<std::string, std::string> Server::getMediaList()
{
MutexAutoLock env_lock(m_env_mutex);
std::unordered_map<std::string, std::string> ret;
for (auto &it : m_media) {
if (it.second.no_announce)
continue;
ret.emplace(base64_decode(it.second.sha1_digest), it.second.path);
}
return ret;
}
ModStorageDatabase *Server::openModStorageDatabase(const std::string &world_path)
{
std::string world_mt_path = world_path + DIR_DELIM + "world.mt";