mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-28 11:45:40 +08:00
Fall back to observer mode login in case no simulator is available
refs #860
This commit is contained in:
committed by
Mathew Sutcliffe
parent
f5058574d0
commit
372e92072c
@@ -179,6 +179,14 @@ namespace BlackCore
|
|||||||
this->getIContextOwnAircraft()->updateOwnAircraftPilot(server.getUser());
|
this->getIContextOwnAircraft()->updateOwnAircraftPilot(server.getUser());
|
||||||
const CSimulatedAircraft ownAircraft(this->ownAircraft());
|
const CSimulatedAircraft ownAircraft(this->ownAircraft());
|
||||||
this->m_network->presetServer(server);
|
this->m_network->presetServer(server);
|
||||||
|
|
||||||
|
// Fall back to observer mode, if no simulator is available or not simulating
|
||||||
|
if(!this->getIContextSimulator()->isSimulatorSimulating())
|
||||||
|
{
|
||||||
|
CLogMessage(this).info("No simulator connected or connected simulator not simulating. Falling back to observer mode");
|
||||||
|
mode = INetwork::LoginAsObserver;
|
||||||
|
}
|
||||||
|
|
||||||
this->m_network->presetLoginMode(mode);
|
this->m_network->presetLoginMode(mode);
|
||||||
this->m_network->presetCallsign(ownAircraft.getCallsign());
|
this->m_network->presetCallsign(ownAircraft.getCallsign());
|
||||||
this->m_network->presetIcaoCodes(ownAircraft);
|
this->m_network->presetIcaoCodes(ownAircraft);
|
||||||
|
|||||||
@@ -437,7 +437,6 @@ namespace BlackGui
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
model = this->getPrefillModel();
|
model = this->getPrefillModel();
|
||||||
ui->gbp_LoginMode->setLoginMode(INetwork::LoginNormal); //! \todo Set observer mode without simulator, currently not working in OBS mode
|
|
||||||
ui->le_SimulatorModel->setText("");
|
ui->le_SimulatorModel->setText("");
|
||||||
this->highlightModelField();
|
this->highlightModelField();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user