diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 3b633580ee..fb01af2747 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3815,6 +3815,21 @@ void Application::domainConnectionDenied(const QString& reason) { } } +void handleDomainConnectionDeniedPacket(std::unique_ptr, HifiSockAddr senderSockAddr) { + int headerSize = numBytesForPacketHeaderGivenPacketType(PacketType::DomainConnectionDenied); + QDataStream packetStream(QByteArray(incomingPacket.constData() + headerSize, + incomingPacket.size() - headerSize)); + QString reason; + packetStream >> reason; + + // output to the log so the user knows they got a denied connection request + // and check and signal for an access token so that we can make sure they are logged in + qCDebug(interfaceapp) << "The domain-server denied a connection request: " << reason; + qCDebug(interfaceapp) << "You may need to re-log to generate a keypair so you can provide a username signature."; + domainConnectionDenied(reason); + AccountManager::getInstance().checkAndSignalForAccessToken(); +} + void Application::connectedToDomain(const QString& hostname) { AccountManager& accountManager = AccountManager::getInstance(); const QUuid& domainID = DependencyManager::get()->getDomainHandler().getUUID(); diff --git a/interface/src/Application.h b/interface/src/Application.h index 0131fdb19a..8ae00cdd38 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -445,6 +445,7 @@ public slots: void notifyPacketVersionMismatch(); void domainConnectionDenied(const QString& reason); + void handleDomainConnectionDeniedPacket(std::unique_ptr, HifiSockAddr senderSockAddr); void cameraMenuChanged(); @@ -528,8 +529,6 @@ private: ToolWindow* _toolWindow; WebWindowClass* _friendsWindow; - DatagramProcessor* _datagramProcessor; - QUndoStack _undoStack; UndoStackScriptingInterface _undoStackScriptingInterface;