mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-08 21:53:02 +02:00
CR
This commit is contained in:
parent
46449256ce
commit
e15ab2ca6c
4 changed files with 4 additions and 9 deletions
|
@ -108,6 +108,7 @@ bool BackupSupervisor::loadBackup(const QString& backupFile) {
|
|||
auto document = QJsonDocument::fromJson(file.readAll(), &error);
|
||||
if (document.isNull() || !document.isObject()) {
|
||||
qCritical() << "Could not parse backup file to JSON object:" << backupFile;
|
||||
qCritical() << " Error:" << error.errorString();
|
||||
backup.corruptedBackup = true;
|
||||
return false;
|
||||
}
|
||||
|
@ -165,7 +166,6 @@ void BackupSupervisor::backupAssetServer() {
|
|||
});
|
||||
|
||||
startBackup();
|
||||
qDebug() << "Requesting mappings for backup!";
|
||||
request->start();
|
||||
}
|
||||
|
||||
|
@ -197,7 +197,7 @@ void BackupSupervisor::backupNextMissingFile() {
|
|||
if (request->getError() == AssetRequest::NoError) {
|
||||
qDebug() << "Got" << request->getHash();
|
||||
|
||||
bool success = writeAssetFile(request->getHash(),request->getData());
|
||||
bool success = writeAssetFile(request->getHash(), request->getData());
|
||||
if (!success) {
|
||||
qCritical() << "Failed to write asset file" << request->getHash();
|
||||
}
|
||||
|
@ -263,8 +263,6 @@ void BackupSupervisor::restoreAssetServer(int backupIndex) {
|
|||
auto request = assetClient->createGetAllMappingsRequest();
|
||||
|
||||
connect(request, &GetAllMappingsRequest::finished, this, [this, backupIndex](GetAllMappingsRequest* request) {
|
||||
qDebug() << "Got" << request->getMappings().size() << "mappings!";
|
||||
|
||||
if (request->getError() == MappingRequest::NoError) {
|
||||
const auto& newMappings = _backups.at(backupIndex).mappings;
|
||||
computeServerStateDifference(request->getMappings(), newMappings);
|
||||
|
@ -278,7 +276,6 @@ void BackupSupervisor::restoreAssetServer(int backupIndex) {
|
|||
});
|
||||
|
||||
startRestore();
|
||||
qDebug() << "Requesting mappings for restore!";
|
||||
request->start();
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,6 @@ private:
|
|||
bool writeBackupFile(const AssetUtils::AssetMappings& mappings);
|
||||
bool writeAssetFile(const AssetUtils::AssetHash& hash, const QByteArray& data);
|
||||
|
||||
|
||||
void startRestore() { _restoreInProgress = true; }
|
||||
void finishRestore() { _restoreInProgress = false; }
|
||||
void computeServerStateDifference(const AssetUtils::AssetMappings& currentMappings,
|
||||
|
@ -75,7 +74,7 @@ private:
|
|||
bool _backupInProgress { false };
|
||||
std::vector<AssetUtils::AssetHash> _assetsLeftToRequest;
|
||||
|
||||
// Internal storage for restor in progress
|
||||
// Internal storage for restore in progress
|
||||
bool _restoreInProgress { false };
|
||||
std::vector<AssetUtils::AssetHash> _assetsLeftToUpload;
|
||||
std::vector<std::pair<AssetUtils::AssetPath, AssetUtils::AssetHash>> _mappingsLeftToSet;
|
||||
|
|
|
@ -253,7 +253,6 @@ private:
|
|||
bool _sendICEServerAddressToMetaverseAPIRedo { false };
|
||||
|
||||
QHash<QUuid, QPointer<HTTPSConnection>> _pendingOAuthConnections;
|
||||
BackupSupervisor _backupSupervisor;
|
||||
|
||||
QThread _assetClientThread;
|
||||
};
|
||||
|
|
|
@ -315,7 +315,7 @@ void PacketReceiver::handleVerifiedMessage(QSharedPointer<ReceivedMessage> recei
|
|||
}
|
||||
} else {
|
||||
qCDebug(networking).nospace() << "Listener for packet " << receivedMessage->getType()
|
||||
<< " has been destroyed. Removing from listener map.";
|
||||
<< " has been destroyed. Removing from listener map.";
|
||||
it = _messageListenerMap.erase(it);
|
||||
|
||||
// if it exists, remove the listener from _directlyConnectedObjects
|
||||
|
|
Loading…
Reference in a new issue