mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
Ref T401, server info also when not connected
This commit is contained in:
committed by
Mat Sutcliffe
parent
16dd6d7451
commit
bae7680e59
@@ -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);
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user