mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 05:37:17 +02:00
Add restart of ES during backup recovery
This commit is contained in:
parent
f67931c936
commit
9e99c5c744
2 changed files with 11 additions and 0 deletions
|
@ -1785,6 +1785,8 @@ QString DomainServer::getEntitiesReplacementFilePath() {
|
||||||
void DomainServer::processOctreeDataRequestMessage(QSharedPointer<ReceivedMessage> message) {
|
void DomainServer::processOctreeDataRequestMessage(QSharedPointer<ReceivedMessage> message) {
|
||||||
qDebug() << "Got request for octree data from " << message->getSenderSockAddr();
|
qDebug() << "Got request for octree data from " << message->getSenderSockAddr();
|
||||||
|
|
||||||
|
maybeHandleReplacementEntityFile();
|
||||||
|
|
||||||
bool remoteHasExistingData { false };
|
bool remoteHasExistingData { false };
|
||||||
QUuid id;
|
QUuid id;
|
||||||
int version;
|
int version;
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include <quazip5/quazip.h>
|
#include <quazip5/quazip.h>
|
||||||
#include <quazip5/quazipfile.h>
|
#include <quazip5/quazipfile.h>
|
||||||
|
|
||||||
|
#include <LimitedNodeList.h>
|
||||||
#include <OctreeUtils.h>
|
#include <OctreeUtils.h>
|
||||||
|
|
||||||
EntitiesBackupHandler::EntitiesBackupHandler(QString entitiesFilePath, QString entitiesReplacementFilePath) :
|
EntitiesBackupHandler::EntitiesBackupHandler(QString entitiesFilePath, QString entitiesReplacementFilePath) :
|
||||||
|
@ -71,5 +72,13 @@ void EntitiesBackupHandler::recoverBackup(QuaZip& zip) {
|
||||||
|
|
||||||
if (entitiesFile.open(QIODevice::WriteOnly)) {
|
if (entitiesFile.open(QIODevice::WriteOnly)) {
|
||||||
entitiesFile.write(data.toGzippedByteArray());
|
entitiesFile.write(data.toGzippedByteArray());
|
||||||
|
entitiesFile.close();
|
||||||
|
|
||||||
|
auto nodeList = DependencyManager::get<LimitedNodeList>();
|
||||||
|
nodeList->eachMatchingNode([](const SharedNodePointer& otherNode) -> bool {
|
||||||
|
return otherNode->getType() == NodeType::EntityServer;
|
||||||
|
}, [nodeList](const SharedNodePointer& otherNode) {
|
||||||
|
QMetaObject::invokeMethod(nodeList.data(), "killNodeWithUUID", Q_ARG(const QUuid&, otherNode->getUUID()));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue