1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00: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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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);