mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-08 06:32:35 +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) {
|
||||
qDebug() << "Got request for octree data from " << message->getSenderSockAddr();
|
||||
|
||||
maybeHandleReplacementEntityFile();
|
||||
|
||||
bool remoteHasExistingData { false };
|
||||
QUuid id;
|
||||
int version;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include <quazip5/quazip.h>
|
||||
#include <quazip5/quazipfile.h>
|
||||
|
||||
#include <LimitedNodeList.h>
|
||||
#include <OctreeUtils.h>
|
||||
|
||||
EntitiesBackupHandler::EntitiesBackupHandler(QString entitiesFilePath, QString entitiesReplacementFilePath) :
|
||||
|
@ -71,5 +72,13 @@ void EntitiesBackupHandler::recoverBackup(QuaZip& zip) {
|
|||
|
||||
if (entitiesFile.open(QIODevice::WriteOnly)) {
|
||||
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