mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 07:15:35 +08:00
[FSD] use Serializer::fromQString function, to static_cast
see https://discordapp.com/channels/539048679160676382/539925070550794240/694955298217263124
This commit is contained in:
committed by
Mat Sutcliffe
parent
81049cd835
commit
5eaa8db1a2
@@ -48,8 +48,8 @@ namespace BlackCore
|
||||
return {};
|
||||
}
|
||||
|
||||
AtcRating rating = static_cast<AtcRating>(tokens[5].toInt());
|
||||
int protocolRevision = tokens[6].toInt();
|
||||
const AtcRating rating = fromQString<AtcRating>(tokens[5]);
|
||||
const int protocolRevision = tokens[6].toInt();
|
||||
return AddAtc(tokens[0], tokens[2], tokens[3], tokens[4], rating, protocolRevision);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,10 +46,10 @@ namespace BlackCore
|
||||
return {};
|
||||
}
|
||||
|
||||
PilotRating rating = static_cast<PilotRating>(tokens[4].toInt());
|
||||
int protocolRevision = tokens[5].toInt();
|
||||
SimType simType = static_cast<SimType>(tokens[6].toInt());
|
||||
AddPilot packet(tokens[0], tokens[2], tokens[3], rating, protocolRevision, simType, tokens[7]);
|
||||
const PilotRating rating = fromQString<PilotRating>(tokens[4]);
|
||||
const int protocolRevision = tokens[5].toInt();
|
||||
const SimType simType = fromQString<SimType>(tokens[6]);
|
||||
const AddPilot packet(tokens[0], tokens[2], tokens[3], rating, protocolRevision, simType, tokens[7]);
|
||||
return packet;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
#include "blackmisc/logmessage.h"
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Aviation;
|
||||
|
||||
namespace BlackCore
|
||||
@@ -61,7 +62,7 @@ namespace BlackCore
|
||||
{
|
||||
if (tokens.size() < 10)
|
||||
{
|
||||
BlackMisc::CLogMessage(static_cast<PilotDataUpdate *>(nullptr)).debug(u"Wrong number of arguments.");
|
||||
CLogMessage(static_cast<PilotDataUpdate *>(nullptr)).debug(u"Wrong number of arguments.");
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user