mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 11:05:33 +08:00
refs #246 style: rename package to packet
This commit is contained in:
@@ -56,7 +56,7 @@ namespace BlackCore
|
||||
this->m_aircraftsInRange.push_back(aircraft);
|
||||
|
||||
// and new client, there is a chance it has been created by
|
||||
// custom package first
|
||||
// custom packet first
|
||||
if (!this->m_otherClients.contains(&CClient::getCallsign, callsign))
|
||||
{
|
||||
CClient c(callsign);
|
||||
@@ -71,7 +71,7 @@ namespace BlackCore
|
||||
this->m_network->sendIcaoCodesQuery(callsign);
|
||||
this->m_network->sendCapabilitiesQuery(callsign);
|
||||
this->m_network->sendServerQuery(callsign);
|
||||
this->sendFsipirCustomPackage(callsign); // own aircraft model
|
||||
this->sendFsipirCustomPacket(callsign); // own aircraft model
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace BlackCore
|
||||
this->connect(this->m_network, &INetwork::frequencyReplyReceived, this, &CContextNetwork::psFsdFrequencyReceived);
|
||||
this->connect(this->m_network, &INetwork::textMessagesReceived, this, &CContextNetwork::psFsdTextMessageReceived);
|
||||
this->connect(this->m_network, &INetwork::capabilitiesReplyReceived, this, &CContextNetwork::psFsdCapabilitiesReplyReceived);
|
||||
this->connect(this->m_network, &INetwork::customPacketReceived, this, &CContextNetwork::psFsdCustomPackageReceived);
|
||||
this->connect(this->m_network, &INetwork::customPacketReceived, this, &CContextNetwork::psFsdCustomPacketReceived);
|
||||
this->connect(this->m_network, &INetwork::serverReplyReceived, this, &CContextNetwork::psFsdServerReplyReceived);
|
||||
if (this->getIContextApplication()) this->connect(this->m_network, &INetwork::statusMessage, this->getIContextApplication(), &IContextApplication::sendStatusMessage);
|
||||
}
|
||||
@@ -409,12 +409,12 @@ namespace BlackCore
|
||||
}
|
||||
|
||||
/*
|
||||
* Custom packages
|
||||
* Custom packets
|
||||
*/
|
||||
void CContextNetwork::psFsdCustomPackageReceived(const CCallsign &callsign, const QString &package, const QStringList &data)
|
||||
void CContextNetwork::psFsdCustomPacketReceived(const CCallsign &callsign, const QString &packet, const QStringList &data)
|
||||
{
|
||||
if (callsign.isEmpty() || data.isEmpty()) return;
|
||||
if (package.startsWith("FSIPIR", Qt::CaseInsensitive))
|
||||
if (packet.startsWith("FSIPIR", Qt::CaseInsensitive))
|
||||
{
|
||||
// Request of other client, I can get the other's model from that
|
||||
// FsInn response is usually my model
|
||||
@@ -423,12 +423,12 @@ namespace BlackCore
|
||||
CIndexVariantMap vm(CClient::IndexQueriedModelString, QVariant(model));
|
||||
if (!this->m_otherClients.contains(&CClient::getCallsign, callsign))
|
||||
{
|
||||
// with custom packages it can happen,
|
||||
//the package is received before any other package
|
||||
// with custom packets it can happen,
|
||||
//the packet is received before any other packet
|
||||
this->m_otherClients.push_back(CClient(callsign));
|
||||
}
|
||||
this->m_otherClients.applyIf(&CClient::getCallsign, callsign, vm);
|
||||
this->sendFsipiCustomPackage(callsign); // response
|
||||
this->sendFsipiCustomPacket(callsign); // response
|
||||
}
|
||||
}
|
||||
|
||||
@@ -473,19 +473,19 @@ namespace BlackCore
|
||||
}
|
||||
|
||||
|
||||
void CContextNetwork::sendFsipiCustomPackage(const CCallsign &recipientCallsign) const
|
||||
void CContextNetwork::sendFsipiCustomPacket(const CCallsign &recipientCallsign) const
|
||||
{
|
||||
QStringList data = this->createFsipiCustomPackageData();
|
||||
QStringList data = this->createFsipiCustomPacketData();
|
||||
this->m_network->sendCustomPacket(recipientCallsign.asString(), "FSIPI", data);
|
||||
}
|
||||
|
||||
void CContextNetwork::sendFsipirCustomPackage(const CCallsign &recipientCallsign) const
|
||||
void CContextNetwork::sendFsipirCustomPacket(const CCallsign &recipientCallsign) const
|
||||
{
|
||||
QStringList data = this->createFsipiCustomPackageData();
|
||||
QStringList data = this->createFsipiCustomPacketData();
|
||||
this->m_network->sendCustomPacket(recipientCallsign.asString(), "FSIPIR", data);
|
||||
}
|
||||
|
||||
QStringList CContextNetwork::createFsipiCustomPackageData() const
|
||||
QStringList CContextNetwork::createFsipiCustomPacketData() const
|
||||
{
|
||||
CAircraft me = this->ownAircraft();
|
||||
CAircraftIcao icao = me.getIcaoInfo();
|
||||
@@ -495,7 +495,7 @@ namespace BlackCore
|
||||
if (this->getIContextSimulator()->isConnected()) modelString = this->getIContextSimulator()->getOwnAircraftModel().getQueriedModelString();
|
||||
}
|
||||
if (modelString.isEmpty()) modelString = CProject::systemNameAndVersion();
|
||||
QStringList data = CNetworkVatlib::createFsipiCustomPackageData(
|
||||
QStringList data = CNetworkVatlib::createFsipiCustomPacketData(
|
||||
"0", icao.getAirlineDesignator(), icao.getAircraftDesignator(),
|
||||
"", "", "", "",
|
||||
icao.getAircraftCombinedType(), modelString);
|
||||
|
||||
@@ -155,14 +155,14 @@ namespace BlackCore
|
||||
return this->getRuntime()->getIContextSettings()->getNetworkSettings();
|
||||
}
|
||||
|
||||
//! Send FsInn custom package
|
||||
void sendFsipiCustomPackage(const BlackMisc::Aviation::CCallsign &recipientCallsign) const;
|
||||
//! Send FsInn custom packet
|
||||
void sendFsipiCustomPacket(const BlackMisc::Aviation::CCallsign &recipientCallsign) const;
|
||||
|
||||
//! Send FsInn custom package
|
||||
void sendFsipirCustomPackage(const BlackMisc::Aviation::CCallsign &recipientCallsign) const;
|
||||
//! Send FsInn custom packet
|
||||
void sendFsipirCustomPacket(const BlackMisc::Aviation::CCallsign &recipientCallsign) const;
|
||||
|
||||
//! Custom package data based on own aircraft / model
|
||||
QStringList createFsipiCustomPackageData() const;
|
||||
//! Custom packet data based on own aircraft / model
|
||||
QStringList createFsipiCustomPacketData() const;
|
||||
|
||||
//! Own aircraft
|
||||
const BlackMisc::Aviation::CAircraft &ownAircraft() const;
|
||||
@@ -237,8 +237,8 @@ namespace BlackCore
|
||||
//! Capabilities received
|
||||
void psFsdCapabilitiesReplyReceived(const BlackMisc::Aviation::CCallsign &callsign, quint32 flags);
|
||||
|
||||
//! Custom package
|
||||
void psFsdCustomPackageReceived(const BlackMisc::Aviation::CCallsign &callsign, const QString &package, const QStringList &data);
|
||||
//! Custom packet
|
||||
void psFsdCustomPacketReceived(const BlackMisc::Aviation::CCallsign &callsign, const QString &package, const QStringList &data);
|
||||
|
||||
//! Server reply received
|
||||
void psFsdServerReplyReceived(const BlackMisc::Aviation::CCallsign &callsign, const QString &host);
|
||||
|
||||
@@ -779,7 +779,7 @@ namespace BlackCore
|
||||
catch (...) { exceptionDispatcher(Q_FUNC_INFO); }
|
||||
}
|
||||
|
||||
QStringList CNetworkVatlib::createFsipiCustomPackageData(const QString &unknown01, const QString &airlineIcao, const QString &aircraftIcao, const QString &magicNumber1, const QString &magicNumber2, const QString &magicNumber3, const QString &magicNumber4, const QString &combinedType, const QString &modelString)
|
||||
QStringList CNetworkVatlib::createFsipiCustomPacketData(const QString &unknown01, const QString &airlineIcao, const QString &aircraftIcao, const QString &magicNumber1, const QString &magicNumber2, const QString &magicNumber3, const QString &magicNumber4, const QString &combinedType, const QString &modelString)
|
||||
{
|
||||
|
||||
QStringList data;
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace BlackCore
|
||||
// some helper methods
|
||||
|
||||
/*!
|
||||
* \brief Create the data load for FSIPI(R) packages / FsInn
|
||||
* \brief Create the data load for FSIPI(R) packets / FsInn
|
||||
* \details FSIPI(R) queries
|
||||
* <BLOCKQUOTE>
|
||||
* index 0 .. 0/1 ???
|
||||
@@ -94,10 +94,10 @@ namespace BlackCore
|
||||
* 7 .. 3-letter combined L2J
|
||||
* 8 .. Model string
|
||||
* </BLOCKQUOTE>
|
||||
* \remarks This helper here has more or less the function of documenting the package,
|
||||
* \remarks This helper here has more or less the function of documenting the packet,
|
||||
* it is nothing but a little string concatenating
|
||||
*/
|
||||
static QStringList createFsipiCustomPackageData(const QString &unknown01, const QString &airlineDesignator, const QString &aircraftDesignator,
|
||||
static QStringList createFsipiCustomPacketData(const QString &unknown01, const QString &airlineDesignator, const QString &aircraftDesignator,
|
||||
const QString &magicNumber1, const QString &magicNumber2, const QString &magicNumber3, const QString &magicNumber4,
|
||||
const QString &combinedType, const QString &modelString);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user