mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 18:13:05 +02:00
force NL reset if the domain changes session ID or local ID
This commit is contained in:
parent
6ab3f83be0
commit
1263db5688
1 changed files with 12 additions and 0 deletions
|
@ -273,6 +273,7 @@ void NodeList::reset(bool skipDomainHandlerReset) {
|
||||||
|
|
||||||
// refresh the owner UUID to the NULL UUID
|
// refresh the owner UUID to the NULL UUID
|
||||||
setSessionUUID(QUuid());
|
setSessionUUID(QUuid());
|
||||||
|
setSessionLocalID(Node::NULL_LOCAL_ID);
|
||||||
|
|
||||||
// if we setup the DTLS socket, also disconnect from the DTLS socket readyRead() so it can handle handshaking
|
// if we setup the DTLS socket, also disconnect from the DTLS socket readyRead() so it can handle handshaking
|
||||||
if (_dtlsSocket) {
|
if (_dtlsSocket) {
|
||||||
|
@ -647,6 +648,17 @@ void NodeList::processDomainServerList(QSharedPointer<ReceivedMessage> message)
|
||||||
Node::LocalID newLocalID;
|
Node::LocalID newLocalID;
|
||||||
packetStream >> newUUID;
|
packetStream >> newUUID;
|
||||||
packetStream >> newLocalID;
|
packetStream >> newLocalID;
|
||||||
|
|
||||||
|
// when connected, if the session ID or local ID were not null and changed, we should reset
|
||||||
|
auto currentLocalID = getSessionLocalID();
|
||||||
|
auto currentSessionID = getSessionUUID();
|
||||||
|
if (_domainHandler.isConnected() &&
|
||||||
|
((currentLocalID != Node::NULL_LOCAL_ID && newLocalID != currentLocalID) ||
|
||||||
|
(!currentSessionID.isNull() && newUUID != currentSessionID))) {
|
||||||
|
qCDebug(networking) << "Local ID or Session ID changed while connected to domain - forcing NodeList reset";
|
||||||
|
reset(true);
|
||||||
|
}
|
||||||
|
|
||||||
setSessionLocalID(newLocalID);
|
setSessionLocalID(newLocalID);
|
||||||
setSessionUUID(newUUID);
|
setSessionUUID(newUUID);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue