[FSD] Smaller fixes, style

This commit is contained in:
Klaus Basan
2019-11-09 18:00:23 +01:00
committed by Mat Sutcliffe
parent 11187870de
commit 702ca31b38
3 changed files with 9 additions and 7 deletions

View File

@@ -69,7 +69,7 @@ namespace BlackCore
this->connectToVoiceServer();
// taskServerConnectionCheck.Start();
CLogMessage(this).info(u"Connected: '%1' to voice server, socket open: ") << callsign << boolToYesNo(m_udpSocket->isOpen());
CLogMessage(this).info(u"Connected: '%1' to voice server, socket open: %2") << callsign << boolToYesNo(m_udpSocket->isOpen());
}
// callback of the calling parent

View File

@@ -630,6 +630,7 @@ namespace BlackCore
void CFSDClient::sendFsdMessage(const QString &message)
{
// UNIT tests
parseMessage(message);
}
@@ -1174,9 +1175,10 @@ namespace BlackCore
QString keyValuePair = clientResponse.m_responseData.at(i);
if (keyValuePair.count('=') != 1) { continue; }
QStringList split = keyValuePair.split('=');
QString key = split.at(0);
QString value = split.at(1);
const QStringList split = keyValuePair.split('=');
if (split.size() < 2) { continue; }
const QString key = split.at(0);
const QString value = split.at(1);
if (value == "1")
{
@@ -1243,7 +1245,7 @@ namespace BlackCore
void CFSDClient::handleServerError(const QStringList &tokens)
{
ServerError serverError = ServerError::fromTokens(tokens);
const ServerError serverError = ServerError::fromTokens(tokens);
switch (serverError.m_errorNumber)
{
case ServerErrorCode::CallsignInUse: CLogMessage(this).error(u"The requested callsign is already taken"); break;
@@ -1267,7 +1269,7 @@ namespace BlackCore
case ServerErrorCode::AlreadyRegistered: CLogMessage(this).info(u"Server says already registered: %1") << serverError.m_description; break;
case ServerErrorCode::InvalidCtrl: CLogMessage(this).info(u"Server invalid control: %1") << serverError.m_description; break;
case ServerErrorCode::Unknown: CLogMessage(this).info(u"Server sent unknown error code: %1 (%2)") << serverError.m_causingParameter << serverError.m_description; break;
case ServerErrorCode::AuthTimeout: CLogMessage(this).info(u"Client did not authenticate in time"); break;
case ServerErrorCode::AuthTimeout: CLogMessage(this).error(u"Client did not authenticate in time"); break;
}
if (serverError.isFatalError()) { disconnectFromServer(); }
}

View File

@@ -158,10 +158,10 @@ namespace BlackCore
void sendPlaneInformationFsinn(const BlackMisc::Aviation::CCallsign &callsign);
void sendCustomPilotPacket(const QString &receiver, const QString &subType, const std::vector<QString> &payload);
void sendAircraftConfiguration(const QString &receiver, const QString &aircraftConfigJson);
void sendFsdMessage(const QString &message);
//! @}
//! Unit test/debug functions @{
void sendFsdMessage(const QString &message);
void setUnitTestMode(bool on) { m_unitTestMode = on; }
void printToConsole(bool on) { m_printToConsole = on; }
//! @}