mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 20:15:35 +08:00
Changed when m_updateTimer is started:
Now starts when connection is established, and stops when terminated. Also added an extra check in update, as the session check is not sufficient.
This commit is contained in:
@@ -120,7 +120,7 @@ namespace BlackCore
|
||||
{
|
||||
try
|
||||
{
|
||||
if (m_net->IsValid() && m_net->IsSessionExists())
|
||||
if (m_net->IsValid() && m_net->IsSessionExists() && isConnected())
|
||||
{
|
||||
if (this->m_loginMode == LoginAsObserver)
|
||||
{
|
||||
@@ -271,6 +271,10 @@ namespace BlackCore
|
||||
info);
|
||||
}
|
||||
m_net->ConnectAndLogon();
|
||||
if (! m_updateTimer.isActive())
|
||||
{
|
||||
m_updateTimer.start(c_updateIntervalMsec);
|
||||
}
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
@@ -283,6 +287,7 @@ namespace BlackCore
|
||||
{
|
||||
try
|
||||
{
|
||||
m_updateTimer.stop();
|
||||
m_net->LogoffAndDisconnect(c_logoffTimeoutSec);
|
||||
}
|
||||
catch (...) { exceptionDispatcher(Q_FUNC_INFO); }
|
||||
@@ -291,33 +296,17 @@ namespace BlackCore
|
||||
void CNetworkVatlib::setOwnAircraft(const BlackMisc::Aviation::CAircraft &aircraft)
|
||||
{
|
||||
m_ownAircraft = aircraft;
|
||||
|
||||
if (! m_updateTimer.isActive())
|
||||
{
|
||||
m_updateTimer.start(c_updateIntervalMsec);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void CNetworkVatlib::setOwnAircraftPosition(const BlackMisc::Geo::CCoordinateGeodetic &position, const BlackMisc::Aviation::CAltitude &altitude)
|
||||
{
|
||||
m_ownAircraft.setPosition(position);
|
||||
m_ownAircraft.setAltitude(altitude);
|
||||
|
||||
if (! m_updateTimer.isActive())
|
||||
{
|
||||
m_updateTimer.start(c_updateIntervalMsec);
|
||||
}
|
||||
}
|
||||
|
||||
void CNetworkVatlib::setOwnAircraftSituation(const BlackMisc::Aviation::CAircraftSituation &situation)
|
||||
{
|
||||
m_ownAircraft.setSituation(situation);
|
||||
|
||||
if (! m_updateTimer.isActive())
|
||||
{
|
||||
m_updateTimer.start(c_updateIntervalMsec);
|
||||
}
|
||||
}
|
||||
|
||||
void CNetworkVatlib::setOwnAircraftAvionics(const BlackMisc::Aviation::CComSystem &com1, const BlackMisc::Aviation::CComSystem &com2,
|
||||
|
||||
Reference in New Issue
Block a user