Nasal security: make directory() use fgValidatePath
Being able to list arbitrary directories is a privacy violation;
existing in-fgdata uses of this are all permitted paths
(i.e. not Terrasync; FileSelector doesn't use it)
James Turner [Tue, 2 Feb 2016 20:44:46 +0000 (20:44 +0000)]
Defensive handling of locales.
- Use setlocale() to ensure consistent handling of locales and
string handling irrespective of whether or not QCoreApplication
is invoked. Forces a the C locale for numerics and collation,
since many pieces of FG assume this.
James Turner [Sun, 17 Jan 2016 19:10:22 +0000 (13:10 -0600)]
Improved fg-root control from the Qt Launcher
- add a button to the main dialog, explaining how to adjust the
fg-root path via the GUI
- tweak the GUI flow to support explicitly changing the path even
when the default path is acceptable.
Fixed the initialization process for JSBSim models: the error message "FGTrim::calcRotation DistPlane^2 larger than sqrRadius" should no longer be issued
James Turner [Tue, 12 Jan 2016 18:50:31 +0000 (12:50 -0600)]
Fix many clang errors in UIUC code
- because uiuc_warning_error always called exit(-1), it can be marked
no return, so Clang realises that when it’s used in the ‘else’
side of a parsing test, uninitialised variables in the enclosing
call site are safe.
(Requires Simgear update to define SG_NO_RETURN helper)
James Turner [Mon, 11 Jan 2016 19:01:05 +0000 (13:01 -0600)]
Fix a potential use-after-free in ATC code
- when dynamics shuts down the ATC controllers, they clear their
traffic vectors (destroying the records), but we didn’t notify
the AI aircraft of this. Ensure the controller is cleared so
the AI aircraft shutdown doesn’t crash.
Torsten Dreyer [Tue, 12 Jan 2016 10:19:26 +0000 (11:19 +0100)]
Fix a bug for allowed paths
Under some conditions on my system
aircraft_paths.begin() was equal to scenery_paths.end()
This resulted in neither of them being added to read_allowed_paths
followed by failure to load Nasal scripts from the aircraft directory.
This might happen, if scenery_paths gets allocated just before aircraft_paths
in memory.
Better loop across the desired lists instead of using fancy tricks with
the iterator.
James Turner [Mon, 11 Jan 2016 04:10:10 +0000 (22:10 -0600)]
Current time of day (warp) fixes:
- sim-speed-up (a/A keys) offsets warp correctly. This means at 4x speed
up the warp will increase by 3 seconds for one elapsed real second.
In practice this means simulation elements timed using sim ‘current time’
will be correctly synchronised with those using simulated elapsed time.
(AI traffic being a prime example of this)
- warp-delta (t/T keys) is independent of frame rate, and works when
paused. The warp-delta values in the keybindings / GUI dialog
will need to be updated since warp-delta in now seconds-per-second,
as opposed to seconds-per-frame.
James Turner [Sat, 9 Jan 2016 16:07:16 +0000 (10:07 -0600)]
Fallback for runway assignment logic
- when no runway use preferences XML exists, be smarter about using
available runways. Makes the common case of using two parallel
runways for arrivals and departures work, greatly improving AI
traffic behaviour.
James Turner [Wed, 6 Jan 2016 04:04:19 +0000 (22:04 -0600)]
Apply /sim/speed-up to general subsystem dt
- consistent with pause (freeze), /sim/speed-up is now applied to the
dt value for all subsystems, not just the FDM and some instruments.
For example AI traffic can now be sped-up or slowed down.
- requires both an FGData and Simgear update.
James Turner [Wed, 30 Dec 2015 20:27:54 +0000 (14:27 -0600)]
Avoid view-manager returning default SGGeod
- when switching views, force an update() to ensure view position
is valid. Otherwise various subsystems such as AI traffic and the
tile manager see a request for a 0,0 location.
- when switching to model view, we still generate a 0,0
location initially - to be fixed.
Erik Hofman [Thu, 24 Dec 2015 12:44:34 +0000 (13:44 +0100)]
Do not call setIsPushback, it causes a segmentation fault after about 10 minutes. I did commit this change in 6b9a28a568dee493dc76be76a2d8eb106133d4e4 to fix a warning, but it night not have been the wisest thing to do.
James Turner [Sat, 19 Dec 2015 06:00:37 +0000 (22:00 -0800)]
Stop OSG threading earlier on shutdown.
Avoid intermittent race conditions on shutdown when the OSG
pager/Db thread is running. Ensure the OSG threads are stopped before
we start tearing down any scene graph nodes.
James Turner [Fri, 11 Dec 2015 18:11:46 +0000 (12:11 -0600)]
ATC/Traffic doesn’t crash reset.
- remove some global headers from AI headers, to avoid pollution
- change how ATC owns the ‘player’ FGAIAircraft so reset works
- ensure AIAircraft controllers are cleared on unbind for reset
James Turner [Wed, 9 Dec 2015 13:01:24 +0000 (14:01 +0100)]
Split GroundNetwork class down the middle
- ATC functions move to GroundController, which layers above
remaining GroundNetwork functionality
- dynamics owns both the groundNetwork and the ground controller.