Ref T401, server info also when not connected

This commit is contained in:
Klaus Basan
2019-02-21 00:23:25 +01:00
committed by Mat Sutcliffe
parent 16dd6d7451
commit bae7680e59
4 changed files with 8 additions and 7 deletions

View File

@@ -703,7 +703,7 @@ namespace BlackCore
BLACK_VERIFY_X(this->getIContextNetwork(), Q_FUNC_INFO, "Missing network context");
if (to == INetwork::Connected && this->getIContextNetwork())
{
m_networkSessionId = this->getIContextNetwork()->getConnectedServer().getServerSessionId();
m_networkSessionId = this->getIContextNetwork()->getConnectedServer().getServerSessionId(false);
if (m_simulatorPlugin.second) // check in case the plugin has been unloaded
{
m_simulatorPlugin.second->setFlightNetworkConnected(true);

View File

@@ -314,7 +314,7 @@ namespace BlackGui
sGui->setExtraWindowTitle(QStringLiteral("[%1]").arg(ownAircraft.getCallsignAsString()));
sGui->crashAndLogInfoUserName(currentServer.getUser().getRealNameAndId());
sGui->crashAndLogInfoFlightNetwork(currentServer.getEcosystem().toQString(true));
sGui->crashAndLogAppendInfo(currentServer.getServerSessionId());
sGui->crashAndLogAppendInfo(currentServer.getServerSessionId(false));
m_networkSetup.setLastServer(currentServer);
m_lastAircraftModel.set(ownAircraft.getModel());
ui->le_LoginCallsign->setText(ownAircraft.getCallsignAsString());

View File

@@ -186,11 +186,12 @@ namespace BlackMisc
return msgs;
}
QString CServer::getServerSessionId() const
QString CServer::getServerSessionId(bool onlyConnected) const
{
if (!this->isConnected()) { return {}; }
static const QString session("%1 %2:%3 [%4] %5 %6");
return session.arg(this->getName(), this->getAddress()).arg(this->getPort()).arg(this->getEcosystem().getSystemString(), this->getUser().getRealName(), this->getFormattedUtcTimestampHms());
const bool isConnected = this->isConnected();
if (onlyConnected && !isConnected) { return {}; }
static const QString session("%1 %2 %3:%4 [%5] %6 %7");
return session.arg(isConnected ? u"connected" : u"disconnected").arg(this->getName(), this->getAddress()).arg(this->getPort()).arg(this->getEcosystem().getSystemString(), this->getUser().getRealName(), this->getFormattedUtcTimestampHms());
}
CVariant CServer::propertyByIndex(const CPropertyIndex &index) const

View File

@@ -203,7 +203,7 @@ namespace BlackMisc
CStatusMessageList validate() const;
//! Identifying a session, if not connected empty
QString getServerSessionId() const;
QString getServerSessionId(bool onlyConnected) const;
//! \copydoc BlackMisc::Mixin::Index::propertyByIndex
CVariant propertyByIndex(const CPropertyIndex &index) const;