mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 02:45:33 +08:00
Fix for index issue
https://discordapp.com/channels/539048679160676382/568904623151382546/604778928787161099 https://discordapp.com/channels/539048679160676382/567983892791951374/593854116992778263 5 org.qt-project.QtCore 0x0000000104efe2c2 qt_assert_x(char const*, char const*, char const*, int) + 80 6 libblackcore.0.9.2.dylib 0x0000000102ad79f1 BlackCore::Vatsim::CVatsimDataFileReader::parseVatsimFile(QNetworkReply*) + 13633 (qstringliteral.h:100)
This commit is contained in:
@@ -286,8 +286,8 @@ namespace BlackCore
|
|||||||
|
|
||||||
bool ok;
|
bool ok;
|
||||||
bool validPos = true;
|
bool validPos = true;
|
||||||
const double lat = clientPartsMap["latitude"].toDouble(&ok);
|
|
||||||
QStringList posMsg;
|
QStringList posMsg;
|
||||||
|
const double lat = clientPartsMap["latitude"].toDouble(&ok);
|
||||||
if (!ok) { validPos = false; posMsg << QStringLiteral("latitude: '%1'").arg(clientPartsMap["latitude"]); }
|
if (!ok) { validPos = false; posMsg << QStringLiteral("latitude: '%1'").arg(clientPartsMap["latitude"]); }
|
||||||
|
|
||||||
const double lng = clientPartsMap["longitude"].toDouble(&ok);
|
const double lng = clientPartsMap["longitude"].toDouble(&ok);
|
||||||
@@ -297,7 +297,7 @@ namespace BlackCore
|
|||||||
if (!ok) { validPos = false; posMsg << QStringLiteral("altitude: '%1'").arg(clientPartsMap["altitude"]); }
|
if (!ok) { validPos = false; posMsg << QStringLiteral("altitude: '%1'").arg(clientPartsMap["altitude"]); }
|
||||||
CCoordinateGeodetic position = validPos ? CCoordinateGeodetic(lat, lng, alt) : CCoordinateGeodetic::null();
|
CCoordinateGeodetic position = validPos ? CCoordinateGeodetic(lat, lng, alt) : CCoordinateGeodetic::null();
|
||||||
|
|
||||||
Q_ASSERT_X((validPos && posMsg.isEmpty()) || (!validPos && !posMsg.isEmpty()), Q_FUNC_INFO, "Inconsisten data");
|
Q_ASSERT_X((validPos && posMsg.isEmpty()) || (!validPos && !posMsg.isEmpty()), Q_FUNC_INFO, "Inconsistent data");
|
||||||
if (!posMsg.isEmpty())
|
if (!posMsg.isEmpty())
|
||||||
{
|
{
|
||||||
// Only info not to flood lof with warning
|
// Only info not to flood lof with warning
|
||||||
@@ -360,7 +360,7 @@ namespace BlackCore
|
|||||||
if (currentLine.contains("UPDATE"))
|
if (currentLine.contains("UPDATE"))
|
||||||
{
|
{
|
||||||
const QStringList updateParts = currentLine.replace(" ", "").split('=');
|
const QStringList updateParts = currentLine.replace(" ", "").split('=');
|
||||||
if (updateParts.length() < 2) break;
|
if (updateParts.length() < 2) { break; }
|
||||||
const QString dts = updateParts.at(1).trimmed();
|
const QString dts = updateParts.at(1).trimmed();
|
||||||
updateTimestampFromFile = fromStringUtc(dts, "yyyyMMddHHmmss");
|
updateTimestampFromFile = fromStringUtc(dts, "yyyyMMddHHmmss");
|
||||||
const bool alreadyRead = (updateTimestampFromFile == this->getUpdateTimestamp());
|
const bool alreadyRead = (updateTimestampFromFile == this->getUpdateTimestamp());
|
||||||
@@ -376,8 +376,8 @@ namespace BlackCore
|
|||||||
{
|
{
|
||||||
// ident:hostname_or_IP:location:name:clients_connection_allowed:
|
// ident:hostname_or_IP:location:name:clients_connection_allowed:
|
||||||
const QStringList fsdServerParts = currentLine.split(':');
|
const QStringList fsdServerParts = currentLine.split(':');
|
||||||
if (fsdServerParts.size() < 5) break;
|
if (fsdServerParts.size() < 5) { break; }
|
||||||
if (!fsdServerParts.at(4).trimmed().contains('1')) break; // allowed?
|
if (!fsdServerParts.at(4).trimmed().contains('1')) { break; } // allowed?
|
||||||
const QString description(fsdServerParts.at(2)); // part(3) could be added
|
const QString description(fsdServerParts.at(2)); // part(3) could be added
|
||||||
const CServer fsdServer(fsdServerParts.at(0), description, fsdServerParts.at(1), 6809,
|
const CServer fsdServer(fsdServerParts.at(0), description, fsdServerParts.at(1), 6809,
|
||||||
CUser("id", "real name", "email", "password"),
|
CUser("id", "real name", "email", "password"),
|
||||||
@@ -390,8 +390,8 @@ namespace BlackCore
|
|||||||
{
|
{
|
||||||
// hostname_or_IP:location:name:clients_connection_allowed:type_of_voice_server:
|
// hostname_or_IP:location:name:clients_connection_allowed:type_of_voice_server:
|
||||||
const QStringList voiceServerParts = currentLine.split(':');
|
const QStringList voiceServerParts = currentLine.split(':');
|
||||||
if (voiceServerParts.size() < 3) break;
|
if (voiceServerParts.size() < 4) { break; }
|
||||||
if (!voiceServerParts.at(3).trimmed().contains('1')) break; // allowed?
|
if (!voiceServerParts.at(3).trimmed().contains('1')) { break; } // allowed?
|
||||||
const CServer voiceServer(voiceServerParts.at(1), voiceServerParts.at(2), voiceServerParts.at(0), -1,
|
const CServer voiceServer(voiceServerParts.at(1), voiceServerParts.at(2), voiceServerParts.at(0), -1,
|
||||||
CUser(),
|
CUser(),
|
||||||
CFsdSetup(), CVoiceSetup::vatsimStandard(),
|
CFsdSetup(), CVoiceSetup::vatsimStandard(),
|
||||||
|
|||||||
Reference in New Issue
Block a user