mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 20:23:06 +02:00
Rename assetHashHex to hexHash
This commit is contained in:
parent
8452289e00
commit
efef60af04
1 changed files with 5 additions and 5 deletions
|
@ -34,8 +34,8 @@ SendAssetTask::SendAssetTask(MessageID messageID, const QByteArray& assetHash, Q
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendAssetTask::run() {
|
void SendAssetTask::run() {
|
||||||
QString assetHashHex = _assetHash.toHex();
|
QString hexHash = _assetHash.toHex();
|
||||||
qDebug() << "Starting task to send asset: " << assetHashHex << " for messageID " << _messageID;
|
qDebug() << "Starting task to send asset: " << hexHash << " for messageID " << _messageID;
|
||||||
auto replyPacketList = std::unique_ptr<NLPacketList>(new NLPacketList(PacketType::AssetGetReply, QByteArray(), true, true));
|
auto replyPacketList = std::unique_ptr<NLPacketList>(new NLPacketList(PacketType::AssetGetReply, QByteArray(), true, true));
|
||||||
|
|
||||||
replyPacketList->write(_assetHash);
|
replyPacketList->write(_assetHash);
|
||||||
|
@ -50,18 +50,18 @@ void SendAssetTask::run() {
|
||||||
if (file.open(QIODevice::ReadOnly)) {
|
if (file.open(QIODevice::ReadOnly)) {
|
||||||
if (file.size() < _end) {
|
if (file.size() < _end) {
|
||||||
writeError(replyPacketList.get(), AssetServerError::INVALID_BYTE_RANGE);
|
writeError(replyPacketList.get(), AssetServerError::INVALID_BYTE_RANGE);
|
||||||
qCDebug(networking) << "Bad byte range: " << assetHashHex << " " << _start << ":" << _end;
|
qCDebug(networking) << "Bad byte range: " << hexHash << " " << _start << ":" << _end;
|
||||||
} else {
|
} else {
|
||||||
auto size = _end - _start;
|
auto size = _end - _start;
|
||||||
file.seek(_start);
|
file.seek(_start);
|
||||||
replyPacketList->writePrimitive(AssetServerError::NO_ERROR);
|
replyPacketList->writePrimitive(AssetServerError::NO_ERROR);
|
||||||
replyPacketList->writePrimitive(size);
|
replyPacketList->writePrimitive(size);
|
||||||
replyPacketList->write(file.read(size));
|
replyPacketList->write(file.read(size));
|
||||||
qCDebug(networking) << "Sending asset: " << assetHashHex;
|
qCDebug(networking) << "Sending asset: " << hexHash;
|
||||||
}
|
}
|
||||||
file.close();
|
file.close();
|
||||||
} else {
|
} else {
|
||||||
qCDebug(networking) << "Asset not found: " << _filePath << "(" << assetHashHex << ")";
|
qCDebug(networking) << "Asset not found: " << _filePath << "(" << hexHash << ")";
|
||||||
writeError(replyPacketList.get(), AssetServerError::ASSET_NOT_FOUND);
|
writeError(replyPacketList.get(), AssetServerError::ASSET_NOT_FOUND);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue