FGCOM server, or actually the phonebook generation, cannot handle airports below sea level.
When looking at phonebook.txt I found nothing (or incorrect manualy added entries) for EHAM. Studying gen_phonebook.pl showed me why. When outputing records in phonebook.txt it needs the ICAO name of the airport. This is taken from apt.dat records tagged '1'. For Amsterdam Airport this is:
- Code: Select all
1 -11 1 0 EHAM Schiphol
Notice the elevation -11 (yes it is below sea level, imagine that ).
The Perl code to parse (get your regexp cheatsheets out) the airport is this (where $z contains the line):
- Code: Select all
elsif($z=~/^1\s+\d+\s+[01]\s+[01]\s+([A-Z0-9]+)\s+(.+)$/)
This does not match for airports below sea level, hence an airport code is never fetched, hence no comm stations are written to phonebook.txt.
To solve this ammend the regexp like this:
- Code: Select all
elsif($z=~/^1\s+-?\d+\s+[01]\s+[01]\s+([A-Z0-9]+)\s+(.+)$/)
With the addition of the '-?' before the elevation it doesn't matter anymore if it's above or below sea level.
So, If anyone can pick this up or point me in the right direction where to have this fixed, much obliged.