mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 18:44:01 +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);
|
||||
|
||||
// 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 {
|
||||
replyPacket.write(QByteArray::fromHex(originalAssetHash.toUtf8()));
|
||||
|
|
|
@ -87,6 +87,17 @@ void GetMappingRequest::doStart() {
|
|||
|
||||
if (!_error) {
|
||||
_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);
|
||||
});
|
||||
|
|
|
@ -53,6 +53,8 @@ public:
|
|||
GetMappingRequest(const AssetPath& path);
|
||||
|
||||
AssetHash getHash() const { return _hash; }
|
||||
AssetPath getRedirectedPath() const { return _redirectedPath; }
|
||||
bool wasRedirected() const { return _wasRedirected; }
|
||||
|
||||
signals:
|
||||
void finished(GetMappingRequest* thisRequest);
|
||||
|
@ -62,6 +64,10 @@ private:
|
|||
|
||||
AssetPath _path;
|
||||
AssetHash _hash;
|
||||
|
||||
|
||||
AssetPath _redirectedPath;
|
||||
bool _wasRedirected { false };
|
||||
};
|
||||
|
||||
class SetMappingRequest : public MappingRequest {
|
||||
|
|
Loading…
Reference in a new issue