1
0
mirror of https://github.com/minetest/minetest.git synced 2025-07-01 07:30:23 +02:00

Source image tracking in tile generation (#12514)

This commit is contained in:
20kdc
2023-02-17 23:03:03 +00:00
committed by GitHub
parent 2a8becd650
commit 75e6cc190a
3 changed files with 89 additions and 48 deletions

View File

@ -1592,14 +1592,6 @@ void Client::handleCommand_MediaPush(NetworkPacket *pkt)
verbosestream << "with " << filedata.size() << " bytes ";
verbosestream << "(cached=" << cached << ")" << std::endl;
if (m_media_pushed_files.count(filename) != 0) {
// Ignore (but acknowledge). Previously this was for sync purposes,
// but even in new versions media cannot be replaced at runtime.
if (m_proto_ver >= 40)
sendHaveMedia({ token });
return;
}
if (!filedata.empty()) {
// LEGACY CODEPATH
// Compute and check checksum of data
@ -1618,7 +1610,6 @@ void Client::handleCommand_MediaPush(NetworkPacket *pkt)
// Actually load media
loadMedia(filedata, filename, true);
m_media_pushed_files.insert(filename);
// Cache file for the next time when this client joins the same server
if (cached)
@ -1626,8 +1617,6 @@ void Client::handleCommand_MediaPush(NetworkPacket *pkt)
return;
}
m_media_pushed_files.insert(filename);
// create a downloader for this file
auto downloader(std::make_shared<SingleMediaDownloader>(cached));
m_pending_media_downloads.emplace_back(token, downloader);