mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 19:35:32 +08:00
Ref T717, function to send parts/situation for testing and in the model browser
This commit is contained in:
committed by
Mat Sutcliffe
parent
73b9371c73
commit
f80e093a0a
@@ -348,8 +348,12 @@ namespace BlackSimPlugin
|
||||
|
||||
// Test only for successful position. FS9 requires constant positions
|
||||
if (!result.getInterpolationStatus().hasValidSituation()) { return; }
|
||||
this->sendMultiplayerPosition(result.getInterpolatedSituation());
|
||||
}
|
||||
|
||||
MPPositionSlewMode positionSlewMode = aircraftSituationToFS9(result.getInterpolatedSituation());
|
||||
void CFs9Client::sendMultiplayerPosition(const CAircraftSituation &situation)
|
||||
{
|
||||
MPPositionSlewMode positionSlewMode = aircraftSituationToFS9(situation);
|
||||
|
||||
QByteArray positionMessage;
|
||||
MultiPlayerPacketParser::writeType(positionMessage, CFs9Sdk::MULTIPLAYER_PACKET_ID_POSITION_SLEWMODE);
|
||||
|
||||
@@ -61,7 +61,9 @@ namespace BlackSimPlugin
|
||||
//! \copydoc BlackMisc::Simulation::CInterpolator::getInterpolationMessages
|
||||
BlackMisc::CStatusMessageList getInterpolationMessages(BlackMisc::Simulation::CInterpolationAndRenderingSetupBase::InterpolatorMode mode) const;
|
||||
|
||||
public slots:
|
||||
//! Send a situtaion (position)
|
||||
void sendMultiplayerPosition(const BlackMisc::Aviation::CAircraftSituation &situation);
|
||||
|
||||
//! Send new text message
|
||||
void sendTextMessage(const QString &textMessage);
|
||||
|
||||
|
||||
@@ -298,6 +298,22 @@ namespace BlackSimPlugin
|
||||
return client->getInterpolationMessages(setup.getInterpolatorMode());
|
||||
}
|
||||
|
||||
bool CSimulatorFs9::testSendSituationAndParts(const CCallsign &callsign, const CAircraftSituation &situation, const CAircraftParts &parts)
|
||||
{
|
||||
if (!m_hashFs9Clients.contains(callsign)) { return false; }
|
||||
CFs9Client *client = m_hashFs9Clients[callsign].data();
|
||||
if (!client) { return false; }
|
||||
|
||||
Q_UNUSED(parts);
|
||||
int u = 0;
|
||||
if (situation.isNull())
|
||||
{
|
||||
u++;
|
||||
client->sendMultiplayerPosition(situation);
|
||||
}
|
||||
return u > 0;
|
||||
}
|
||||
|
||||
bool CSimulatorFs9::isPhysicallyRenderedAircraft(const CCallsign &callsign) const
|
||||
{
|
||||
return m_hashFs9Clients.contains(callsign);
|
||||
|
||||
@@ -64,6 +64,7 @@ namespace BlackSimPlugin
|
||||
virtual void displayStatusMessage(const BlackMisc::CStatusMessage &message) const override;
|
||||
virtual void displayTextMessage(const BlackMisc::Network::CTextMessage &message) const override;
|
||||
virtual BlackMisc::CStatusMessageList getInterpolationMessages(const BlackMisc::Aviation::CCallsign &callsign) const override;
|
||||
virtual bool testSendSituationAndParts(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Aviation::CAircraftSituation &situation, const BlackMisc::Aviation::CAircraftParts &parts) override;
|
||||
//! \@}
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user