refs #246 style: rename package to packet

This commit is contained in:
Mathew Sutcliffe
2014-06-11 19:01:00 +01:00
parent 45260258d6
commit ef1c5d0d77
5 changed files with 27 additions and 27 deletions

View File

@@ -56,7 +56,7 @@ namespace BlackCore
this->m_aircraftsInRange.push_back(aircraft); this->m_aircraftsInRange.push_back(aircraft);
// and new client, there is a chance it has been created by // 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)) if (!this->m_otherClients.contains(&CClient::getCallsign, callsign))
{ {
CClient c(callsign); CClient c(callsign);
@@ -71,7 +71,7 @@ namespace BlackCore
this->m_network->sendIcaoCodesQuery(callsign); this->m_network->sendIcaoCodesQuery(callsign);
this->m_network->sendCapabilitiesQuery(callsign); this->m_network->sendCapabilitiesQuery(callsign);
this->m_network->sendServerQuery(callsign); this->m_network->sendServerQuery(callsign);
this->sendFsipirCustomPackage(callsign); // own aircraft model this->sendFsipirCustomPacket(callsign); // own aircraft model
} }
} }
else else

View File

@@ -73,7 +73,7 @@ namespace BlackCore
this->connect(this->m_network, &INetwork::frequencyReplyReceived, this, &CContextNetwork::psFsdFrequencyReceived); 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::textMessagesReceived, this, &CContextNetwork::psFsdTextMessageReceived);
this->connect(this->m_network, &INetwork::capabilitiesReplyReceived, this, &CContextNetwork::psFsdCapabilitiesReplyReceived); 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); this->connect(this->m_network, &INetwork::serverReplyReceived, this, &CContextNetwork::psFsdServerReplyReceived);
if (this->getIContextApplication()) this->connect(this->m_network, &INetwork::statusMessage, this->getIContextApplication(), &IContextApplication::sendStatusMessage); 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 (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 // Request of other client, I can get the other's model from that
// FsInn response is usually my model // FsInn response is usually my model
@@ -423,12 +423,12 @@ namespace BlackCore
CIndexVariantMap vm(CClient::IndexQueriedModelString, QVariant(model)); CIndexVariantMap vm(CClient::IndexQueriedModelString, QVariant(model));
if (!this->m_otherClients.contains(&CClient::getCallsign, callsign)) if (!this->m_otherClients.contains(&CClient::getCallsign, callsign))
{ {
// with custom packages it can happen, // with custom packets it can happen,
//the package is received before any other package //the packet is received before any other packet
this->m_otherClients.push_back(CClient(callsign)); this->m_otherClients.push_back(CClient(callsign));
} }
this->m_otherClients.applyIf(&CClient::getCallsign, callsign, vm); 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); 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); this->m_network->sendCustomPacket(recipientCallsign.asString(), "FSIPIR", data);
} }
QStringList CContextNetwork::createFsipiCustomPackageData() const QStringList CContextNetwork::createFsipiCustomPacketData() const
{ {
CAircraft me = this->ownAircraft(); CAircraft me = this->ownAircraft();
CAircraftIcao icao = me.getIcaoInfo(); CAircraftIcao icao = me.getIcaoInfo();
@@ -495,7 +495,7 @@ namespace BlackCore
if (this->getIContextSimulator()->isConnected()) modelString = this->getIContextSimulator()->getOwnAircraftModel().getQueriedModelString(); if (this->getIContextSimulator()->isConnected()) modelString = this->getIContextSimulator()->getOwnAircraftModel().getQueriedModelString();
} }
if (modelString.isEmpty()) modelString = CProject::systemNameAndVersion(); if (modelString.isEmpty()) modelString = CProject::systemNameAndVersion();
QStringList data = CNetworkVatlib::createFsipiCustomPackageData( QStringList data = CNetworkVatlib::createFsipiCustomPacketData(
"0", icao.getAirlineDesignator(), icao.getAircraftDesignator(), "0", icao.getAirlineDesignator(), icao.getAircraftDesignator(),
"", "", "", "", "", "", "", "",
icao.getAircraftCombinedType(), modelString); icao.getAircraftCombinedType(), modelString);

View File

@@ -155,14 +155,14 @@ namespace BlackCore
return this->getRuntime()->getIContextSettings()->getNetworkSettings(); return this->getRuntime()->getIContextSettings()->getNetworkSettings();
} }
//! Send FsInn custom package //! Send FsInn custom packet
void sendFsipiCustomPackage(const BlackMisc::Aviation::CCallsign &recipientCallsign) const; void sendFsipiCustomPacket(const BlackMisc::Aviation::CCallsign &recipientCallsign) const;
//! Send FsInn custom package //! Send FsInn custom packet
void sendFsipirCustomPackage(const BlackMisc::Aviation::CCallsign &recipientCallsign) const; void sendFsipirCustomPacket(const BlackMisc::Aviation::CCallsign &recipientCallsign) const;
//! Custom package data based on own aircraft / model //! Custom packet data based on own aircraft / model
QStringList createFsipiCustomPackageData() const; QStringList createFsipiCustomPacketData() const;
//! Own aircraft //! Own aircraft
const BlackMisc::Aviation::CAircraft &ownAircraft() const; const BlackMisc::Aviation::CAircraft &ownAircraft() const;
@@ -237,8 +237,8 @@ namespace BlackCore
//! Capabilities received //! Capabilities received
void psFsdCapabilitiesReplyReceived(const BlackMisc::Aviation::CCallsign &callsign, quint32 flags); void psFsdCapabilitiesReplyReceived(const BlackMisc::Aviation::CCallsign &callsign, quint32 flags);
//! Custom package //! Custom packet
void psFsdCustomPackageReceived(const BlackMisc::Aviation::CCallsign &callsign, const QString &package, const QStringList &data); void psFsdCustomPacketReceived(const BlackMisc::Aviation::CCallsign &callsign, const QString &package, const QStringList &data);
//! Server reply received //! Server reply received
void psFsdServerReplyReceived(const BlackMisc::Aviation::CCallsign &callsign, const QString &host); void psFsdServerReplyReceived(const BlackMisc::Aviation::CCallsign &callsign, const QString &host);

View File

@@ -779,7 +779,7 @@ namespace BlackCore
catch (...) { exceptionDispatcher(Q_FUNC_INFO); } 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; QStringList data;

View File

@@ -81,7 +81,7 @@ namespace BlackCore
// some helper methods // 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 * \details FSIPI(R) queries
* <BLOCKQUOTE> * <BLOCKQUOTE>
* index 0 .. 0/1 ??? * index 0 .. 0/1 ???
@@ -94,10 +94,10 @@ namespace BlackCore
* 7 .. 3-letter combined L2J * 7 .. 3-letter combined L2J
* 8 .. Model string * 8 .. Model string
* </BLOCKQUOTE> * </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 * 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 &magicNumber1, const QString &magicNumber2, const QString &magicNumber3, const QString &magicNumber4,
const QString &combinedType, const QString &modelString); const QString &combinedType, const QString &modelString);