mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 06:23:06 +02:00
read redirected path info in MappingRequest
This commit is contained in:
parent
03e952ec38
commit
96672becc6
3 changed files with 18 additions and 1 deletions
|
@ -314,7 +314,7 @@ void AssetServer::handleGetMappingOperation(ReceivedMessage& message, SharedNode
|
||||||
replyPacket.writePrimitive(wasRedirected);
|
replyPacket.writePrimitive(wasRedirected);
|
||||||
|
|
||||||
// include the re-directed path in case the caller needs to make relative path requests for the baked asset
|
// include the re-directed path in case the caller needs to make relative path requests for the baked asset
|
||||||
replyPacket.write(bakedAssetPath.toUtf8());
|
replyPacket.writeString(bakedAssetPath);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
replyPacket.write(QByteArray::fromHex(originalAssetHash.toUtf8()));
|
replyPacket.write(QByteArray::fromHex(originalAssetHash.toUtf8()));
|
||||||
|
|
|
@ -87,6 +87,17 @@ void GetMappingRequest::doStart() {
|
||||||
|
|
||||||
if (!_error) {
|
if (!_error) {
|
||||||
_hash = message->read(SHA256_HASH_LENGTH).toHex();
|
_hash = message->read(SHA256_HASH_LENGTH).toHex();
|
||||||
|
|
||||||
|
// check the boolean to see if this request got re-directed
|
||||||
|
quint8 wasRedirected;
|
||||||
|
message->readPrimitive(&wasRedirected);
|
||||||
|
_wasRedirected = wasRedirected;
|
||||||
|
|
||||||
|
// if it did grab that re-directed path
|
||||||
|
if (_wasRedirected) {
|
||||||
|
_redirectedPath = message->readString();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
emit finished(this);
|
emit finished(this);
|
||||||
});
|
});
|
||||||
|
|
|
@ -53,6 +53,8 @@ public:
|
||||||
GetMappingRequest(const AssetPath& path);
|
GetMappingRequest(const AssetPath& path);
|
||||||
|
|
||||||
AssetHash getHash() const { return _hash; }
|
AssetHash getHash() const { return _hash; }
|
||||||
|
AssetPath getRedirectedPath() const { return _redirectedPath; }
|
||||||
|
bool wasRedirected() const { return _wasRedirected; }
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void finished(GetMappingRequest* thisRequest);
|
void finished(GetMappingRequest* thisRequest);
|
||||||
|
@ -62,6 +64,10 @@ private:
|
||||||
|
|
||||||
AssetPath _path;
|
AssetPath _path;
|
||||||
AssetHash _hash;
|
AssetHash _hash;
|
||||||
|
|
||||||
|
|
||||||
|
AssetPath _redirectedPath;
|
||||||
|
bool _wasRedirected { false };
|
||||||
};
|
};
|
||||||
|
|
||||||
class SetMappingRequest : public MappingRequest {
|
class SetMappingRequest : public MappingRequest {
|
||||||
|
|
Loading…
Reference in a new issue