Add handleComainConnectionDeniedPacket to Application

This commit is contained in:
Ryan Huffman 2015-07-08 11:54:22 -07:00
parent b960d86f80
commit 0b0446e527
2 changed files with 16 additions and 2 deletions

View file

@ -3815,6 +3815,21 @@ void Application::domainConnectionDenied(const QString& reason) {
}
}
void handleDomainConnectionDeniedPacket(std::unique_ptr<NLPacket>, 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<NodeList>()->getDomainHandler().getUUID();

View file

@ -445,6 +445,7 @@ public slots:
void notifyPacketVersionMismatch();
void domainConnectionDenied(const QString& reason);
void handleDomainConnectionDeniedPacket(std::unique_ptr<NLPacket>, HifiSockAddr senderSockAddr);
void cameraMenuChanged();
@ -528,8 +529,6 @@ private:
ToolWindow* _toolWindow;
WebWindowClass* _friendsWindow;
DatagramProcessor* _datagramProcessor;
QUndoStack _undoStack;
UndoStackScriptingInterface _undoStackScriptingInterface;