From 99aaefbd0331922f921af44f8fbf8df010d510a5 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Fri, 10 Jul 2015 15:00:29 -0700 Subject: [PATCH] Fix and update signature of Application::handleDomainConnectionDeniedPacket --- interface/src/Application.cpp | 24 ++++++++++++------------ interface/src/Application.h | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 20878205a9..98d9325403 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3822,19 +3822,19 @@ 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; +void Application::handleDomainConnectionDeniedPacket(QSharedPointer packet, SharedNodePointer senderNode, HifiSockAddr senderSockAddr) { + int headerSize = numBytesForPacketHeaderGivenPacketType(PacketType::DomainConnectionDenied); + QDataStream packetStream(QByteArray::fromRawData(packet->getData(), packet->getSizeWithHeader())); - // 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(); + 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) { diff --git a/interface/src/Application.h b/interface/src/Application.h index 9653556da0..c3f31a107c 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -444,7 +444,7 @@ public slots: void notifyPacketVersionMismatch(); void domainConnectionDenied(const QString& reason); - void handleDomainConnectionDeniedPacket(std::unique_ptr, HifiSockAddr senderSockAddr); + void handleDomainConnectionDeniedPacket(QSharedPointer, SharedNodePointer senderNode, HifiSockAddr senderSockAddr); void cameraMenuChanged();