mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +00:00
Server pushing media at runtime (#9961)
This commit is contained in:
parent
982a030f33
commit
2424dfe007
16 changed files with 263 additions and 85 deletions
|
@ -35,6 +35,15 @@ static std::string getMediaCacheDir()
|
|||
return porting::path_cache + DIR_DELIM + "media";
|
||||
}
|
||||
|
||||
bool clientMediaUpdateCache(const std::string &raw_hash, const std::string &filedata)
|
||||
{
|
||||
FileCache media_cache(getMediaCacheDir());
|
||||
std::string sha1_hex = hex_encode(raw_hash);
|
||||
if (!media_cache.exists(sha1_hex))
|
||||
return media_cache.update(sha1_hex, filedata);
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
ClientMediaDownloader
|
||||
*/
|
||||
|
@ -559,7 +568,6 @@ bool ClientMediaDownloader::checkAndLoad(
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Minetest Hashset File Format
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue