mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 15:45:46 +08:00
refs #334 FS9 DirectPlay peer classes using CContinuousWorker.
This commit is contained in:
committed by
Roland Winklmeier
parent
2a1541786a
commit
195c909ca0
@@ -17,6 +17,7 @@
|
||||
#include "blackmisc/coordinategeodetic.h"
|
||||
#include <QScopedArrayPointer>
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Aviation;
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
|
||||
@@ -24,8 +25,8 @@ namespace BlackSimPlugin
|
||||
{
|
||||
namespace Fs9
|
||||
{
|
||||
CFs9Client::CFs9Client(const QString &callsign, const CTime &updateInterval, QObject *parent) :
|
||||
CDirectPlayPeer(callsign, parent),
|
||||
CFs9Client::CFs9Client(QObject *owner, const QString &callsign, const CTime &updateInterval) :
|
||||
CDirectPlayPeer(owner, callsign),
|
||||
m_updateInterval(updateInterval)
|
||||
{
|
||||
}
|
||||
@@ -36,14 +37,6 @@ namespace BlackSimPlugin
|
||||
m_hostAddress = nullptr;
|
||||
}
|
||||
|
||||
void CFs9Client::init()
|
||||
{
|
||||
initDirectPlay();
|
||||
createDeviceAddress();
|
||||
//enumDirectPlayHosts();
|
||||
connectToSession(m_callsign);
|
||||
}
|
||||
|
||||
void CFs9Client::sendTextMessage(const QString &textMessage)
|
||||
{
|
||||
MPChatText mpChatText;
|
||||
@@ -55,11 +48,6 @@ namespace BlackSimPlugin
|
||||
sendMessage(message);
|
||||
}
|
||||
|
||||
void CFs9Client::disconnectFrom()
|
||||
{
|
||||
closeConnection();
|
||||
}
|
||||
|
||||
void CFs9Client::setHostAddress(const QString &hostAddress)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
@@ -120,6 +108,19 @@ namespace BlackSimPlugin
|
||||
}
|
||||
}
|
||||
|
||||
void CFs9Client::initialize()
|
||||
{
|
||||
initDirectPlay();
|
||||
createDeviceAddress();
|
||||
//enumDirectPlayHosts();
|
||||
connectToSession(m_callsign);
|
||||
}
|
||||
|
||||
void CFs9Client::cleanup()
|
||||
{
|
||||
closeConnection();
|
||||
}
|
||||
|
||||
HRESULT CFs9Client::enumDirectPlayHosts()
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
@@ -251,6 +252,7 @@ namespace BlackSimPlugin
|
||||
MultiPlayerPacketParser::writeType(message, CFs9Sdk::MULTIPLAYER_PACKET_ID_CHANGE_PLAYER_PLANE);
|
||||
MultiPlayerPacketParser::writeSize(message, mpChangePlayerPlane.size());
|
||||
message = MultiPlayerPacketParser::writeMessage(message, mpChangePlayerPlane);
|
||||
CLogMessage(this).debug() << m_callsign << " connected to session.";
|
||||
sendMessage(message);
|
||||
|
||||
m_timerId = startTimer(m_updateInterval.value(CTimeUnit::ms()));
|
||||
|
||||
Reference in New Issue
Block a user