Skip to content

Commit

Permalink
Merge branch 'hotfix/tsat' into release/1.0.x
Browse files Browse the repository at this point in the history
# Conflicts:
#	CMakeLists.txt
  • Loading branch information
svengcz committed Apr 21, 2023
2 parents 948c728 + 9c3ff88 commit 7e4f05d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
18 changes: 8 additions & 10 deletions com/Airport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ void Airport::updateExot(const std::string& callsign, const std::chrono::utc_clo
root["vacdm"] = Json::Value();
root["vacdm"]["exot"] = std::chrono::duration_cast<std::chrono::minutes>(exot.time_since_epoch()).count();
root["vacdm"]["tsat"] = Airport::timestampToIsoString(types::defaultTime);
root["vacdm"]["ttot"] = root["vacdm"]["tsat"].asString();
root["vacdm"]["asat"] = root["vacdm"]["tsat"].asString();
root["vacdm"]["aobt"] = root["vacdm"]["tsat"].asString();
root["vacdm"]["atot"] = root["vacdm"]["tsat"].asString();
root["vacdm"]["ttot"] = Airport::timestampToIsoString(types::defaultTime);
root["vacdm"]["asat"] = Airport::timestampToIsoString(types::defaultTime);
root["vacdm"]["aobt"] = Airport::timestampToIsoString(types::defaultTime);
root["vacdm"]["atot"] = Airport::timestampToIsoString(types::defaultTime);

it->second[FlightEuroscope].lastUpdate = std::chrono::utc_clock::now();
it->second[FlightConsolidated].tsat = types::defaultTime;
Expand Down Expand Up @@ -160,10 +160,10 @@ void Airport::updateTobt(const std::string& callsign, const std::chrono::utc_clo
root["vacdm"]["tsat"] = Airport::timestampToIsoString(types::defaultTime);
if (false == manualTobt)
root["vacdm"]["tobt_state"] = "CONFIRMED";
root["vacdm"]["ttot"] = root["vacdm"]["tsat"].asString();
root["vacdm"]["asat"] = root["vacdm"]["tsat"].asString();
root["vacdm"]["aobt"] = root["vacdm"]["tsat"].asString();
root["vacdm"]["atot"] = root["vacdm"]["tsat"].asString();
root["vacdm"]["ttot"] = Airport::timestampToIsoString(types::defaultTime);
root["vacdm"]["asat"] = Airport::timestampToIsoString(types::defaultTime);
root["vacdm"]["aobt"] = Airport::timestampToIsoString(types::defaultTime);
root["vacdm"]["atot"] = Airport::timestampToIsoString(types::defaultTime);

it->second[FlightEuroscope].lastUpdate = std::chrono::utc_clock::now();
it->second[FlightConsolidated].tobt = tobt;
Expand Down Expand Up @@ -260,7 +260,6 @@ void Airport::updateAsrt(const std::string& callsign, const std::chrono::utc_clo
root["vacdm"] = Json::Value();
root["vacdm"]["asrt"] = Airport::timestampToIsoString(asrt);


it->second[FlightEuroscope].lastUpdate = std::chrono::utc_clock::now();
it->second[FlightConsolidated].asrt = asrt;

Expand All @@ -283,7 +282,6 @@ void Airport::updateAort(const std::string& callsign, const std::chrono::utc_clo
root["vacdm"] = Json::Value();
root["vacdm"]["aort"] = Airport::timestampToIsoString(aort);


it->second[FlightEuroscope].lastUpdate = std::chrono::utc_clock::now();
it->second[FlightConsolidated].aort = aort;

Expand Down
6 changes: 3 additions & 3 deletions vACDM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ bool vACDM::OnCompileCommand(const char* sCommandLine) {
bool userIsObs = std::string_view(this->ControllerMyself().GetCallsign()).ends_with("_OBS") == true;
bool serverAllowsObsAsMaster = this->m_config.masterAsObserver;
bool serverAllowsSweatboxAsMaster = this->m_config.masterInSweatbox;

std::string userIsNotEligibleMessage;

if (!userConnected) {
Expand All @@ -677,9 +677,9 @@ bool vACDM::OnCompileCommand(const char* sCommandLine) {
userIsNotEligibleMessage = "You are logged in as Observer and Server does not allow Observers to be Master";
}
else if (userIsInSweatbox && !serverAllowsSweatboxAsMaster) {
userIsNotEligibleMessage = "You are logged in on a Sweatbox Server and Server does not allow Sweatbox connections " + std::to_string(this->GetConnectionType());
userIsNotEligibleMessage = "You are logged in on a Sweatbox Server and Server does not allow Sweatbox connections";
}
else {
else {
this->DisplayUserMessage("vACDM", PLUGIN_NAME, "Executing vACDM as the MASTER", true, true, true, true, false);
logging::Logger::instance().log("vACDM", logging::Logger::Level::Info, "Switched to MASTER");
com::Server::instance().setMaster(true);
Expand Down

0 comments on commit 7e4f05d

Please sign in to comment.