From: APTX Date: Tue, 3 Jan 2012 01:30:02 +0000 (+0100) Subject: Add detection incorrect API Key. X-Git-Url: https://gitweb.tyo.aptx.org/?a=commitdiff_plain;h=97498477a619d62a9204f8ca52efcd252f4d65bc;p=anidbudpclient.git Add detection incorrect API Key. --- diff --git a/client.cpp b/client.cpp index 078db26..142255d 100644 --- a/client.cpp +++ b/client.cpp @@ -266,6 +266,8 @@ qDebug() << "Entering Disconnected State"; #endif if (socket->state() == QAbstractSocket::BoundState) socket->disconnectFromHost(); + m_salt.clear(); + usingEncryption = false; } void Client::enterConnectingState() @@ -576,7 +578,7 @@ qDebug() << QString("Recieved datagram from [%1]:%2\nRaw datagram contents:%3") // Check if it is a 6xx error. { - QRegExp rx("(?:50[34]|555|6[0-9]{2}) "); + QRegExp rx("(?:50[34]|555|598|6[0-9]{2}) "); if (rx.exactMatch(tmp.mid(0, 4))) { int replyCode = tmp.mid(0, 3).toInt(); @@ -599,6 +601,15 @@ qDebug() << QString("Recieved datagram from [%1]:%2\nRaw datagram contents:%3") m_errorString = tr("Server busy. Try again later. Wait at least 30 minutes."); emit connectionError(); goto endLoop; + case UNKNOWN_COMMAND: + if (usingEncryption) + { + m_error = EncryptionError; + m_errorString = tr("Server did not recognize encrypted command. Make sure the API Key is correct."); + emit connectionError(); + goto endLoop; + } + break; default: if (replyCode > 601 && replyCode < 700) {