mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-09 21:52:11 +02:00
add domain connection reset to NodeList reset
This commit is contained in:
parent
27c779666b
commit
050d223b3a
4 changed files with 23 additions and 7 deletions
|
@ -205,6 +205,5 @@ void AssignmentClient::assignmentCompleted() {
|
|||
// reset our NodeList by switching back to unassigned and clearing the list
|
||||
nodeList->setOwnerType(NodeType::Unassigned);
|
||||
nodeList->reset();
|
||||
nodeList->getDomainInfo().reset();
|
||||
nodeList->resetNodeInterestSet();
|
||||
}
|
||||
|
|
|
@ -26,11 +26,8 @@ DomainInfo::DomainInfo() :
|
|||
connect(&AccountManager::getInstance(), &AccountManager::logoutComplete, this, &DomainInfo::logout);
|
||||
}
|
||||
|
||||
void DomainInfo::reset() {
|
||||
void DomainInfo::clearConnectionInfo() {
|
||||
_uuid = QUuid();
|
||||
_hostname = QString();
|
||||
_sockAddr.setAddress(QHostAddress::Null);
|
||||
_assignmentUUID = QUuid();
|
||||
_connectionSecret = QUuid();
|
||||
_registrationToken = QByteArray();
|
||||
_rootAuthenticationURL = QUrl();
|
||||
|
@ -38,6 +35,12 @@ void DomainInfo::reset() {
|
|||
_isConnected = false;
|
||||
}
|
||||
|
||||
void DomainInfo::reset() {
|
||||
clearConnectionInfo();
|
||||
_hostname = QString();
|
||||
_sockAddr.setAddress(QHostAddress::Null);
|
||||
}
|
||||
|
||||
void DomainInfo::parseAuthInformationFromJsonObject(const QJsonObject& jsonObject) {
|
||||
QJsonObject dataObject = jsonObject["data"].toObject();
|
||||
_connectionSecret = QUuid(dataObject["connection_secret"].toString());
|
||||
|
@ -45,6 +48,15 @@ void DomainInfo::parseAuthInformationFromJsonObject(const QJsonObject& jsonObjec
|
|||
_publicKey = dataObject["public_key"].toString();
|
||||
}
|
||||
|
||||
void DomainInfo::setSockAddr(const HifiSockAddr& sockAddr) {
|
||||
if (_sockAddr != sockAddr) {
|
||||
// we should reset on a sockAddr change
|
||||
reset();
|
||||
// change the sockAddr
|
||||
_sockAddr = sockAddr;
|
||||
}
|
||||
}
|
||||
|
||||
void DomainInfo::setHostname(const QString& hostname) {
|
||||
|
||||
if (hostname != _hostname) {
|
||||
|
|
|
@ -24,7 +24,7 @@ class DomainInfo : public QObject {
|
|||
public:
|
||||
DomainInfo();
|
||||
|
||||
void reset();
|
||||
void clearConnectionInfo();
|
||||
|
||||
void parseAuthInformationFromJsonObject(const QJsonObject& jsonObject);
|
||||
|
||||
|
@ -38,7 +38,7 @@ public:
|
|||
void setIPToLocalhost() { _sockAddr.setAddress(QHostAddress(QHostAddress::LocalHost)); }
|
||||
|
||||
const HifiSockAddr& getSockAddr() { return _sockAddr; }
|
||||
void setSockAddr(const HifiSockAddr& sockAddr) { _sockAddr = sockAddr; }
|
||||
void setSockAddr(const HifiSockAddr& sockAddr);
|
||||
|
||||
unsigned short getPort() const { return _sockAddr.getPort(); }
|
||||
|
||||
|
@ -64,6 +64,8 @@ signals:
|
|||
void hostnameChanged(const QString& hostname);
|
||||
void connectedToDomain(const QString& hostname);
|
||||
private:
|
||||
void reset();
|
||||
|
||||
QUuid _uuid;
|
||||
QString _hostname;
|
||||
HifiSockAddr _sockAddr;
|
||||
|
|
|
@ -328,6 +328,9 @@ void NodeList::reset() {
|
|||
|
||||
// refresh the owner UUID to the NULL UUID
|
||||
setSessionUUID(QUuid());
|
||||
|
||||
// clear the domain connection information
|
||||
_domainInfo.clearConnectionInfo();
|
||||
}
|
||||
|
||||
void NodeList::addNodeTypeToInterestSet(NodeType_t nodeTypeToAdd) {
|
||||
|
|
Loading…
Reference in a new issue