Skip to content

Commit

Permalink
Merge pull request #1 from scenix007/Fix-aircraft_icao-decode-patch-1
Browse files Browse the repository at this point in the history
Fix aircraft_icao decode for some old FSD servers
  • Loading branch information
scenix007 authored Feb 18, 2019
2 parents 1befdd1 + b8715e0 commit 4b99ede
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions scripts/daemon-spotter.php
Original file line number Diff line number Diff line change
Expand Up @@ -976,9 +976,13 @@ function connect_all($hosts) {
//$data['arrival_airport_time'] = ;
if ($line[9] != '') {
$aircraft_data = explode('/',$line[9]);
if (isset($aircraft_data[1])) {
$data['aircraft_icao'] = $aircraft_data[1];
}
if (count($aircraft_data) == 2) {
//line[9] may equal to something like 'B738/L' in old FSD server's whazzup.txt file
$data['aircraft_icao'] = $aircraft_data[0];
} else if (count($aircraft_data) > 2) {
//line[9] may equal to something like 'H/B748/L'
$data['aircraft_icao'] = $aircraft_data[1];
}
}
/*
if ($value === 'whazzup') $data['format_source'] = 'whazzup';
Expand Down

0 comments on commit 4b99ede

Please sign in to comment.