mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 21:15:33 +08:00
Move sending of positions and params to FS9 into own method
This commit is contained in:
committed by
Klaus Basan
parent
5ed95aee3d
commit
e2578dd63c
@@ -257,5 +257,31 @@ namespace BlackSimPlugin
|
||||
emit statusChanged(m_callsign, m_clientStatus);
|
||||
return hr;
|
||||
}
|
||||
|
||||
void CFs9Client::sendMultiplayerPosition(const CAircraftSituation &situation)
|
||||
{
|
||||
MPPositionSlewMode positionSlewMode = aircraftSituationToFS9(situation);
|
||||
|
||||
QByteArray positionMessage;
|
||||
MultiPlayerPacketParser::writeType(positionMessage, CFs9Sdk::MULTIPLAYER_PACKET_ID_POSITION_SLEWMODE);
|
||||
MultiPlayerPacketParser::writeSize(positionMessage, positionSlewMode.size());
|
||||
positionSlewMode.packet_index = m_packetIndex;
|
||||
++m_packetIndex;
|
||||
positionMessage = MultiPlayerPacketParser::writeMessage(positionMessage, positionSlewMode);
|
||||
|
||||
sendMessage(positionMessage);
|
||||
}
|
||||
|
||||
void CFs9Client::sendMultiplayerParamaters()
|
||||
{
|
||||
QByteArray paramMessage;
|
||||
MPParam param;
|
||||
MultiPlayerPacketParser::writeType(paramMessage, CFs9Sdk::MULTIPLAYER_PACKET_ID_PARAMS);
|
||||
MultiPlayerPacketParser::writeSize(paramMessage, param.size());
|
||||
param.packet_index = m_packetIndex;
|
||||
++m_packetIndex;
|
||||
paramMessage = MultiPlayerPacketParser::writeMessage(paramMessage, param);
|
||||
sendMessage(paramMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,7 +83,9 @@ namespace BlackSimPlugin
|
||||
|
||||
HRESULT closeConnection();
|
||||
|
||||
BlackMisc::Aviation::CAircraftSituation m_lastAircraftSituation;
|
||||
void sendMultiplayerPosition(const BlackMisc::Aviation::CAircraftSituation &situation);
|
||||
void sendMultiplayerParamaters();
|
||||
|
||||
BlackMisc::PhysicalQuantities::CTime m_updateInterval;
|
||||
BlackCore::IInterpolator *m_interpolator = nullptr;
|
||||
int m_timerId = 0;
|
||||
|
||||
Reference in New Issue
Block a user