From: Perttu Ahola Date: Sun, 25 Mar 2012 09:10:58 +0000 (+0300) Subject: Add more media directories; mod/{textures,sounds,media} X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=26666bb36f594bbca8aa71654c009bbceb1e5eb8;p=zefram%2Fminetest%2Fminetest_engine.git Add more media directories; mod/{textures,sounds,media} --- diff --git a/src/server.cpp b/src/server.cpp index d6bb14f9..13a8ebf7 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -3931,29 +3931,40 @@ void Server::fillMediaCache() { DSTACK(__FUNCTION_NAME); - infostream<<"Server: Calculating file checksums"< paths; for(core::list::Iterator i = m_mods.begin(); i != m_mods.end(); i++){ const ModSpec &mod = *i; - std::string filepath = mod.path + DIR_DELIM + "textures"; - std::vector dirlist = fs::GetDirListing(filepath); + paths.push_back(mod.path + DIR_DELIM + "textures"); + paths.push_back(mod.path + DIR_DELIM + "sounds"); + paths.push_back(mod.path + DIR_DELIM + "media"); + } + + // Collect media file information from paths into cache + for(std::list::iterator i = paths.begin(); + i != paths.end(); i++) + { + std::string mediapath = *i; + std::vector dirlist = fs::GetDirListing(mediapath); for(u32 j=0; jm_media[tname] = MediaInfo(tpath,digest_string); - verbosestream<<"Server: sha1 for "<m_media[filename] = MediaInfo(filepath, digest_string); + verbosestream<<"Server: sha1 for "<