send the new sequence after every update
This commit is contained in:
@@ -680,25 +680,23 @@ void PlugIn::OnTimer(int counter) {
|
|||||||
for (auto& airport : this->m_updateQueue) {
|
for (auto& airport : this->m_updateQueue) {
|
||||||
aman::AircraftUpdate update;
|
aman::AircraftUpdate update;
|
||||||
update.set_airport(airport.first);
|
update.set_airport(airport.first);
|
||||||
bool inserted = false;
|
|
||||||
|
|
||||||
|
if (0 != airport.second.size()) {
|
||||||
for (auto target = this->RadarTargetSelectFirst(); true == target.IsValid(); target = this->RadarTargetSelectNext(target)) {
|
for (auto target = this->RadarTargetSelectFirst(); true == target.IsValid(); target = this->RadarTargetSelectNext(target)) {
|
||||||
auto it = std::find(airport.second.begin(), airport.second.end(), target.GetCallsign());
|
auto it = std::find(airport.second.begin(), airport.second.end(), target.GetCallsign());
|
||||||
if (airport.second.end() != it) {
|
if (airport.second.end() != it) {
|
||||||
auto report = update.add_reports();
|
auto report = update.add_reports();
|
||||||
this->generateAircraftReportMessage(target, report);
|
this->generateAircraftReportMessage(target, report);
|
||||||
inserted = true;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (true == inserted) {
|
|
||||||
/* send the report and request the current sequence */
|
/* send the report and request the current sequence */
|
||||||
auto sequence = Backend::instance().update(update);
|
auto sequence = Backend::instance().update(update);
|
||||||
if (nullptr == sequence)
|
if (nullptr == sequence)
|
||||||
this->DisplayUserMessage(PLUGIN_NAME, "ERROR", "Unable to send a new aircraft report update", true, true, true, true, true);
|
this->DisplayUserMessage(PLUGIN_NAME, "ERROR", "Unable to send a new aircraft report update", true, true, true, true, true);
|
||||||
else
|
else
|
||||||
this->updateSequence(sequence);
|
this->updateSequence(sequence);
|
||||||
}
|
|
||||||
|
|
||||||
airport.second.clear();
|
airport.second.clear();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user