Ref T272, network can add as ECO system provider (the server connected knows its ECO system)

This commit is contained in:
Klaus Basan
2018-05-28 12:12:06 +02:00
parent 4eeaf1adc4
commit 776a096168
2 changed files with 8 additions and 2 deletions

View File

@@ -20,6 +20,7 @@
#include "blackmisc/network/rawfsdmessage.h"
#include "blackmisc/network/serverlist.h"
#include "blackmisc/network/clientprovider.h"
#include "blackmisc/network/ecosystemprovider.h"
#include "blackmisc/network/clientlist.h"
#include "blackmisc/network/textmessagelist.h"
#include "blackmisc/aviation/informationmessage.h"
@@ -59,11 +60,13 @@ namespace BlackCore
*/
class BLACKCORE_EXPORT INetwork :
public QObject,
public BlackMisc::Network::CClientAware, // network vatlib consumes own aircraft data and sets ICAO/callsign data
public BlackMisc::Simulation::COwnAircraftAware, // network vatlib consumes own aircraft data and sets ICAO/callsign data
public BlackMisc::Network::IEcosystemProvider, // provide info about used ecosystem
public BlackMisc::Network::CClientAware, // network can set client information
public BlackMisc::Simulation::COwnAircraftAware, // network vatlib consumes own aircraft data and sets ICAO/callsign data
public BlackMisc::Simulation::CSimulationEnvironmentAware // allows to consume ground elevations
{
Q_OBJECT
Q_INTERFACES(BlackMisc::Network::IEcosystemProvider)
protected:
//! Constructor

View File

@@ -277,6 +277,7 @@ namespace BlackCore
if (m_status == vatStatusConnected)
{
m_server.setConnectedSinceNow();
this->setCurrentEcosystem(m_server.getEcosystem());
}
else
{
@@ -287,6 +288,8 @@ namespace BlackCore
{
this->stopPositionTimers();
this->clearState();
this->setLastEcosystem(m_server.getEcosystem());
this->setCurrentEcosystem(CEcosystem::NoSystem);
}
emit this->connectionStatusChanged(convertConnectionStatus(status), convertConnectionStatus(m_status));