1
0
Fork 0
Commit graph

9771 commits

Author SHA1 Message Date
Richard Harrison
b020db5ce7 Multiplayer: ensure that avionics sounds are null for MP models. 2017-04-02 13:54:03 +02:00
Richard Harrison
5d2e596043 Multiplayer protocol enhancements (MP2017.2 V2)
/sim/multiplay/protocol-version is either 1 or 2 and controls how packets are sent. V2 packets will only have the (motioninfo) basic properties visible to older clients.

New string encoding that is efficient.
Support short int encoding (pack a property and value into 4 bytes).
Allow properties to be transmitted using a different encoding to the property type in the tree.
Support scaled floats; most of the floats we transmit are small and thus can fit into a scaled short.
V2 protocol uses transmit so most properties are either scaled floats or short ints.

Allow the client to request a larger visibility range by setting /sim/multiplay/visibility-range-nm. This will transmit in the repurposed header field ReplyAddress - which has been renamed to RequestedRangeNm. This will require support from fgms to actually do anything.

Extra debugging options. The most useful (for aircraft developers) is the loopback bit, as this allows model multiplay testing without running two instances.
Update property /sim/multiplay/last-xmit-packet-len with the size of the packet transmitted

Debug level bits in property /sim/multiplay/debug-level
  bit 1 - loopback (show your own model as an MP model)
  bit 2 - dump outgoing packets
  bit 3 - dump incoming packets
  bit 4 - hexdump outgoing packets
2017-04-02 13:52:43 +02:00
Richard Harrison
8494462a96 Fixed another crash in MP interpolation when data isn't available. 2017-04-02 02:22:52 +02:00
Richard Harrison
48b93ff982 Fix comments in message header to identify the reuse of an obsolete field 2017-04-02 02:22:51 +02:00
Richard Harrison
239334f4d1 The conditions were swapped for the total output and the hexdump 2017-04-02 02:22:50 +02:00
Richard Harrison
c5cc666288 Merge branch 'next-2' into multiplayer-dev 2017-04-02 02:22:48 +02:00
Richard Harrison
5d23fa71ff OSG 3.5.x compatibility fix
OSG 3.5 (and maybe before) declares that ThreadSafeRefenceCounting is no longer required and it has been removed.
2017-04-02 02:09:38 +02:00
James Turner
f6f2c3b89a Merge /u/jsb1685/flightgear/ branch yasim into next
https://sourceforge.net/p/flightgear/flightgear/merge-requests/84/
2017-03-29 15:49:16 +00:00
James Turner
6cd39818c6 Whoops, missed a file. 2017-03-27 16:05:45 +01:00
James Turner
58a7f2c5c2 Unit-test for initPosition.
Only basic, but can be expanded incrementally now
2017-03-27 15:38:05 +01:00
Stuart Buchanan
feb5d599d0 Replace "tile-manager" with "scenery" 2017-03-26 21:49:26 +01:00
James Turner
31e933d836 Kill the Aircraft/foo path warning.
We probably need a warning for cross-aircraft paths, but leaving that
for a separate change since I’m worried it will warn on MP aircraft.

Maybe better checked in the Python scripts than in the app?
2017-03-25 15:40:11 +00:00
James Turner
9e122eaf81 Partial testing framework.
Compile a useful subset of FG as a shared library, and add two basic
uses of this to exercise some Flightplan / RoutePath / navaid
functions.

The test framework can/will be expanded incrementally from here, this
is just a starting point.
2017-03-25 15:35:26 +00:00
James Turner
7adb2fa851 RoutePath fixes.
Should fix:

https://sourceforge.net/p/flightgear/codetickets/1703/
https://sourceforge.net/p/flightgear/codetickets/1939/

Although both of these I had trouble reproducing directly.
2017-03-25 15:34:10 +00:00
James Turner
c2da881010 Fix a crash in NavList
(Tests are good)
2017-03-25 15:34:10 +00:00
James Turner
4f020602e6 Missing config.h includes
This is about to become much more important.
2017-03-25 15:34:10 +00:00
Stuart Buchanan
43a2b6fdac Rotate through tips based on execution count. 2017-03-23 21:11:46 +00:00
James Turner
74e2849293 Move some commands to a separate file.
This simplifies building a subset of the code for testing.
2017-03-22 21:13:40 +01:00
Henning Stahlke
50110b0cd6 YASIM: minor change to allow RigidBody addMass and setMass to trigger aggregation correctly. (not a problem up to now, just to be safe in future) 2017-03-21 22:47:07 +01:00
Henning Stahlke
f7359d9699 YASim: add bug warning messages. 2017-03-21 22:46:33 +01:00
Henning Stahlke
53103ac15e YASim: update CLI usage message. 2017-03-21 22:43:01 +01:00
Stuart Buchanan
3135d87218 Stop TTS from playing over itself.
Simple blocking of the SGSubsystem until the current
TTS sample has finished playing, allowing a 0.5s
gap between transmissions.  Good radio comms!
2017-03-20 22:27:10 +00:00
James Turner
63d8c2fd83 Enable —-metar runway selection.
Thanks to Florent for the catch.
2017-03-19 22:41:07 +00:00
James Turner
b1fa31fa09 Restore METAR-based runway selection.
As part of this, add the ability to distinguish default vs explicit
airport selection via a new /sim/presets/airport-requested flag. This
enables us to more cleanly handle different combinations of startup,
especially the case where the user requests an airport but no runway
(wants auto selection), ensuring we don’t look for the default airport’s
runway (from location-presets.xml) in that case.
2017-03-19 11:55:10 +00:00
James Turner
962ede1c43 Fix how launcher resets heading-deg.
This ensures finalisePosition logic runs as expected, ensuring
real-world METAR usage kicks in.
2017-03-19 11:55:10 +00:00
Erik Hofman
2393fd647d Merge /u/jsb1685/flightgear/ branch yasim into next
https://sourceforge.net/p/flightgear/flightgear/merge-requests/78/
2017-03-19 07:49:26 +00:00
Henning Stahlke
dc63307965 YASim: fix segmentation fault in yasim CLI tool 2017-03-18 23:17:19 +01:00
Henning Stahlke
0f472efe9b YASim parser: add support for metric and imperial attibutes, e.g. mass-lbs, mass-kg 2017-03-18 21:28:26 +01:00
Henning Stahlke
cecdfd0832 YASim FGFDM.hpp correction of pointer declarations. 2017-03-18 21:19:24 +01:00
James Turner
6880761f7b Launcher diagram: faster boundary computation.
No need to completely rebuild in these cases.
2017-03-16 22:42:58 +00:00
James Turner
a1bc99ec84 Fix slow launcher diagram with bad airport data. 2017-03-16 22:41:59 +00:00
James Turner
b13dd05aca Fix bug on Windows, time() is UTC there also.
This renders sgGMTime obsolete, it will go away shortly. Thanks to 
Ron H for help tracking this down and Richard Harrison for his
knowledge of Windows APIs in confirming the issue.
2017-03-16 21:26:43 +00:00
James Turner
29fe9316af Generic protocol fix for integer-factors.
Read all values as floating point before applying a factor, then
convert to the target type (int, byte or short). Suggested and
implemented by Oliver Kroth.
2017-03-16 15:54:38 +00:00
Henning Stahlke
c61730db92 YASim Wing method name clarification (SMC is not MAC). 2017-03-16 09:43:41 +01:00
Henning Stahlke
bb9a8a1850 YASim backward compatibility fix for ground effect calculation (added if isVersionOrNewer). 2017-03-16 09:39:58 +01:00
Henning Stahlke
1c932b3d79 YASim Model.cpp to avoid performance problems with getNode() add variables for properties that are written at FDM rate.
getNode() is slow, setValue() is ok
2017-03-16 09:36:15 +01:00
James Turner
06c6e994a5 Merge /u/accek/flightgear/ branch build-with-gdal into next
https://sourceforge.net/p/flightgear/flightgear/merge-requests/83/
2017-03-15 18:57:11 +00:00
James Turner
c7f29699d3 Allow XML control over splash logo position.
As suggested by Chris, these are normalised and account for the logo
size after scaling, so 0.5 will centre, 1.0 is the right/bottom edge.

E.g. (in /sim/startup)
 <splash-logo-x-norm>0.5</splash-logo-x-norm>
 <splash-logo-y-norm>0.9</splash-logo-y-norm> 

Many values will overlap with other text, so use with care!
2017-03-15 12:01:29 +00:00
Florent Rougon
f4788cddb4 Qt launcher: accept scenery paths containing either of: Buildings, Roads, Pylons
When adding a scenery path in the built-in launcher, accept folders
containing any of the new directories populated by osm2city. Also try to
improve the message that is displayed when the sanity check conditions
for the added scenery path aren't met (cf. discussion around
<https://sourceforge.net/p/flightgear/mailman/message/35716946/>).
2017-03-15 00:42:36 +01:00
Bertrand Coconnier
40be2687f7 Restored the legacy behavior: the XML extension is mandatory and when it is not explicitely specified it is automatically added. 2017-03-14 21:59:14 +01:00
Henning Stahlke
dbf21b1ca8 YASim calculate max CG range (on x-axis) from gear positions, to implement checks later (a better guesstimate will follow). 2017-03-11 22:44:45 +01:00
Florent Rougon
6e44fb1015 Fix unsigned int vs. int problem in SplashScreen::manuallyResizeFBO()
Justified because:

  osg::Camera::getNumChildren() returns an unsigned int, and
  osg::Camera::getChild() takes an unsigned int
2017-03-11 21:53:24 +01:00
Henning Stahlke
e78a763eef YASim Airplane: move one-liners to header and remove unused code. 2017-03-11 21:29:05 +01:00
Henning Stahlke
60f5c97272 YASim Gear: move one-liners to header 2017-03-11 21:06:16 +01:00
Bertrand Coconnier
0d342f526e Exports the parameters of JSBSim ground reactions friction resolver to the property tree for debugging. 2017-03-11 14:00:20 +01:00
Szymon Acedański
93e68c001a Fixed building FG with GDAL 2017-03-11 13:34:19 +01:00
Bertrand Coconnier
579f215005 Sync w/ JSBSim:
* Propeller required power now accounts for the engine tilt
* Fixed a division by zero in FGLGear::GetSteerNorm for non steerable gears
* Fixed a bug reported by Ron H. and Rebecca N. Palmer on the FG mailing list: the 'length' parameter passed to gethostbyaddr in FGFdmSocket was erroneous.
2017-03-11 13:24:51 +01:00
Florent Rougon
dab68505bb Rename fgfs' option --log-file to --log-dir
This makes sense, since this option expects a directory parameter, or
the special value 'desktop', and computes the file's base name on its
own.

cf. <https://sourceforge.net/p/flightgear/mailman/message/35715817/>
and <https://sourceforge.net/p/flightgear/mailman/message/35715836/>
2017-03-11 09:51:16 +01:00
Florent Rougon
8372f086c1 Add the lists of fix.dat and nav.dat files to the output of --json-report
- Declare 'datTypeStr' and 'defaultDatFile' as public member variables
  of NavDataCache ('defaultDatFile' is not *required* for this commit,
  it just seems to make sense to treat both members the same way/keep
  them together in the source code).

- New keys under "navigation data" in the JSON report: "fix.dat files"
  and "nav.dat files".
2017-03-10 23:04:39 +01:00
Florent Rougon
99ebfcd368 Simplify reading of the frequency field from nav.dat files
The frequency field is always an integer, so reading it as a float to
convert it to int doesn't make sense. I've probably been confused by
field indices when I introduced this in commit a2bf424118.

This clarifies things, but shouldn't change the code behavior in any
way (unless with bogus nav.dat files, of course).
2017-03-10 16:53:39 +01:00
Szymon Acedański
14611e905e GUI: do not complain if only NavData is present in scenery folder 2017-03-09 00:10:26 +01:00
Szymon Acedański
bd0fa1fa5a Do not apply .ils.xml adjustments while building the cache 2017-03-09 00:10:26 +01:00
Szymon Acedański
e37fd6ea1f Minor comment fixes 2017-03-09 00:10:26 +01:00
Szymon Acedański
4403f22a8b Support multiple nav.dat and fix.dat files 2017-03-09 00:10:26 +01:00
Szymon Acedański
b9dbe9c9e7 nav.dat: support XP NAV1100 format
This allows using NavXP1100-formatted nav.dat from gateway.x-plane.com.

The skipped field types are:

14 Final approach path alignment point of an SBAS or GBAS approach path
15 GBAS differential ground station of a GLS
16 Landing threshold point or fictitious threshold point of an SBAS/GBAS
   approach

We don't have SBAS/GBAS in Flightgear.

This change also includes duplicate detection for multiple nav.dat files
support.
2017-03-09 00:10:26 +01:00
Szymon Acedański
2b2780bfca fix.dat: support XP FIX1101 format
Also: duplicates detection, in preparation for multiple fix.dat files
support.
2017-03-09 00:10:26 +01:00
Henning Stahlke
06ba4fe351 YASim wrap bugfix with version check to maintain compatibility with old aircraft config. 2017-03-07 20:47:43 +01:00
Henning Stahlke
1e92c33a9e YASim export config version used by aircraft to property tree.
Gives /fdm/yasim/config-version as integer (see enum in Version.hpp to decode).
2017-03-07 20:45:46 +01:00
Henning Stahlke
80462d23c5 YASim Wing: remove unnecessary local variable "root" (use _base);
calculate _tip in directly in one command
  clarify signature of Wing::interp()
2017-03-07 18:03:25 +01:00
Henning Stahlke
583ea27dd6 YASim Version: add tag for version 2017.2 2017-03-07 17:50:05 +01:00
Henning Stahlke
a56f85ac95 YASim removed unused include from Rotor.cpp 2017-03-07 17:50:05 +01:00
Henning Stahlke
6efa1ab821 YASim moved one liners 2017-03-07 17:50:05 +01:00
Henning Stahlke
ce4df326d7 YASim Airplane.cpp additional comments 2017-03-07 17:50:05 +01:00
Henning Stahlke
05f9fcfd10 comments 2017-03-07 17:50:04 +01:00
Henning Stahlke
dc66959b83 YASim comments 2017-03-07 17:50:04 +01:00
Henning Stahlke
1198f5a3ec YASim CLI tool: add print out of max lift and min drag
add drag(speed) print function
2017-03-07 17:50:04 +01:00
Henning Stahlke
cb7d2a1bc5 YASim Wing: add _aspectRatio and _meanChord.
(an some indent)
2017-03-07 17:50:04 +01:00
Henning Stahlke
a87442c6f3 YASim fix performance problem due to export to prop.tree. 2017-03-07 17:50:04 +01:00
Henning Stahlke
76a0ea96cc YASim clarification. Add const to method parameters in Math.hpp 2017-03-07 17:50:04 +01:00
Henning Stahlke
4cbe540bec YASim: convert local variables alpha and stallAlpha to members of Surface. 2017-03-07 17:50:03 +01:00
Henning Stahlke
5f78545961 only white spaces 2017-03-07 17:50:03 +01:00
Henning Stahlke
d4688d206a YASim: export surface data to property tree. 2017-03-07 17:50:03 +01:00
Henning Stahlke
d322ded552 YASim bugfix: ground effect did not calculate wingspan correctly;
Variable name clarification;
Add Wing::getWingArea, separate Wing::getWingSpan and Wing::getBase.
2017-03-07 17:50:03 +01:00
Henning Stahlke
559dcf4e32 YASim optimization: pre-calculate data for masses that do not change in flight to save CPU (RigidBody::recalc() runs at FDM rate).
export mass data to property tree.
2017-03-07 17:50:03 +01:00
Henning Stahlke
4e1be43f15 YASim: export wing data to property tree. 2017-03-07 17:50:03 +01:00
Henning Stahlke
021a9db9be YASim add surface id and export surface positions to prop tree after model compile. 2017-03-07 17:50:02 +01:00
Henning Stahlke
dd420c6ff4 YASim bugfix, correct an obvious copy-and-paste error 2017-03-07 17:50:02 +01:00
Henning Stahlke
41b18155a8 YASim: export FDM state (v, a, rot) to property tree. 2017-03-07 17:50:02 +01:00
Henning Stahlke
70dd3de3bb YASim: FGFDM convert local variable _yasimN into a class member 2017-03-07 17:50:02 +01:00
Henning Stahlke
2cac4e4671 YASim: Move variables and methods for input properties from FGFDM to ControlMap. 2017-03-07 17:50:01 +01:00
Henning Stahlke
f14cc3be33 Extend yasim-test.cpp; add print mass distribution, add plot with different configs 2017-03-07 17:47:51 +01:00
Henning Stahlke
6f1f850c11 YASim method name clarification Airplane::setWeight 2017-03-07 17:47:50 +01:00
Henning Stahlke
97a0511ce0 YASim method name clarification in class Surface 2017-03-07 17:47:50 +01:00
Henning Stahlke
91fd075796 YASim method name clarification Wind::setSlat 2017-03-07 17:47:50 +01:00
Henning Stahlke
91806861c6 YASim method name clarification Wind::setFlap1 2017-03-07 17:47:50 +01:00
Henning Stahlke
e69f6ba9ab YASim method name clarification Wind::setFlap0 2017-03-07 17:47:50 +01:00
Henning Stahlke
ce753c0382 YASim method name clarification Wing::setSpoiler 2017-03-07 17:47:50 +01:00
Henning Stahlke
b447bbdc5e Optimize YASim/RigidBody.cpp utilizing symmetry of tensor. 2017-03-07 17:47:49 +01:00
Torsten Dreyer
6257c29fd8 Merge /u/martymac/flightgear/ branch freebsd-fix into next
https://sourceforge.net/p/flightgear/flightgear/merge-requests/79/
2017-03-07 07:51:59 +00:00
James Turner
8d68741ee9 On-disk support for multiple primary aircraft.
Also add support for customised / per-variant thumbnails in on-disk
aircraft; equivalent support for catalog aircraft still to be done.
2017-03-05 22:02:25 +02:00
James Turner
41f875a729 Silence a warning about log levels.
These levels will never be set on the output side, so handle them
as default here.
2017-03-05 21:41:52 +02:00
James Turner
39b239957e Startup-tip system.
Replace the license / website text with a startup tip. Tips are shown
based on the day of the year, can be changed easily.
2017-03-03 23:21:18 +02:00
Ganael Laplanche
c91284b3e1 Link to execinfo to fix build on FreeBSD 2017-03-01 20:53:56 +00:00
James Turner
868ec1f500 Log a message when launcher is requested without Qt. 2017-03-01 15:27:33 +00:00
James Turner
3653508412 Build- and run-time concept of developer mode.
Make a single Cmake value to expose the build type to code, and use
this to default a run-time ‘developer-mode’ property, which can be
over-ridden from the command line.

Use this to drive the different warning levels. Policies subject to
review, especially whether nightly builds should default to 
developer mode or not.
2017-02-27 23:37:59 +00:00
James Turner
be0ede64be Make some warnings be developer-only. 2017-02-27 23:37:59 +00:00
James Turner
bd17a64487 Fix a typo in launcher console handling. 2017-02-27 23:31:08 +00:00
James Turner
ec8b55d3c5 Explicitly log nav-cache read-only flag. 2017-02-27 15:50:19 +00:00
James Turner
cad283b2ce Change Windows multi-app launch detection.
Instead of using a .pid file, use a named mutex. This avoids any chance of stale datacausing mis-detection.
2017-02-27 15:45:28 +00:00
Erik Hofman
706ce325d3 Do not forget to signal the proper signal number first 2017-02-27 11:50:51 +01:00
Erik Hofman
6179a8d8d7 Still generate a core file 2017-02-27 11:46:25 +01:00
James Turner
314844e3c8 Make —console work in the launcher.
As discussed on the ML, due to how this options is processed, the
launcher setting it doesn’t make it take effect, so deal with it
manually.
2017-02-27 00:06:41 +00:00
James Turner
e74ebabc36 Fix compilation with OSG 3.2 2017-02-26 23:58:41 +00:00
James Turner
c316bd4af8 Mark nightly builds visually on the splash.
Ensure testers are in no doubt what they’re getting from a nightly
build.
2017-02-26 23:58:36 +00:00
Peter Sadrozinski
ec4b9f8542 Alternative terrain engine based on pagedLOD
- remove TileMgr from sub systems - add to btg terrain engine
2017-02-26 10:17:15 -05:00
Bertrand Coconnier
6e9d4e8ae4 Linux/Unix are case sensitive. 2017-02-26 01:39:33 +01:00
James Turner
918db84ac4 New splash screen system.
Uses TTF fonts, and displays more information textually including
the application version and current aircraft.

Also rename FGRenderer::splashinit to preinit, as was suggested
a long time ago.
2017-02-25 21:47:58 +00:00
James Turner
17fe0460a9 Previews displayed in the launcher. 2017-02-25 21:47:58 +00:00
James Turner
38554f629f Merge /u/accek/flightgear/ branch ap-freed-pointers into next
https://sourceforge.net/p/flightgear/flightgear/merge-requests/75/
2017-02-25 16:41:02 +00:00
James Turner
5c0550b495 Merge /u/accek/flightgear/ branch fixlets-1 into next
https://sourceforge.net/p/flightgear/flightgear/merge-requests/74/
2017-02-25 16:40:01 +00:00
Bertrand Coconnier
7cbdc8b923 Sync w/ JSBSim (use SGPath to manage file names) 2017-02-25 16:22:23 +01:00
Szymon Acedański
28e9ba21f6 Fixed route manager returning freed char* pointers via tied properties
On Mac it was visible as random strings displayed in the route manager
dialog for selected SIDs and STARs.

Depends on a SimGear change which introduces SGStringValueMethods.
2017-02-25 15:17:03 +01:00
Szymon Acedański
e1668a2919 Fixed a number of use-after-free bugs with FGPositioneds
These were due to converting FGPositionedRef to FGPositioned*
and then again packing the pointer into another ref-counted
FGPositionedRef.
2017-02-25 15:10:17 +01:00
Szymon Acedański
d401a50e0a Fix crash on Mac OS X when FG does not finish input init 2017-02-25 15:05:09 +01:00
Szymon Acedański
f71c20600a Fixed erroreous reference to array instead of its element
net->master_{bat,alt} are arrays, but were mistakenly used as
values.

This correctly generated a compilation warning.
2017-02-25 15:05:09 +01:00
Szymon Acedański
4fd89b0b8f Fixed compilation warning on Mac
IOHIDManagerRegisterDeviceMatchingCallback must not be called with
nullptr as the second argument.
2017-02-25 15:05:09 +01:00
Richard Harrison
80dc810d15 MP2017.2 V2 protocol enhancements
1. Add support for scaled floats; most of the floats we transmit are small and thus can fit into a scaled short.
2. Change most properties to use scaled floats.
2017-02-23 22:33:33 +01:00
Richard Harrison
3fceba7a24 MP2017.2 changes
Support for short int encoded values (32 bits with 16 bit for ID and 16 bits for value)

Added extra debugging options
1. Debug level
  bit 1 - loopback (show your own model as an MP model)
  bit 2 - dump outgoing packets
  bit 3 - dump incoming packets
  bit 4 - hexdump outgoing packets

2. Update property (/simwith packet
- configurable debug (loopback, packet trace (in,out), packet dump)
- prevent properties from being visible to V1 clients - to ensure reliable compatibility, with just the basic position message being processed. This allows more changes to the V2 protocol whilst giving basic V1 support
- add debug
2017-02-23 00:46:01 +01:00
James Turner
006ca7186b Fix updating of add-on aircraft in the launcher.
Kick off a re-scan when adding or removing paths.
2017-02-22 17:09:24 +00:00
James Turner
72988a6bb7 Add the default hangar automatically on first-run.
Slightly ungainly but ensures we start with the default hangar
available. It can still be removed and re-added as normal.
2017-02-22 17:09:23 +00:00
Bertrand Coconnier
86d46ce79c Sync w/ JSBSim 2017-02-21 22:35:09 +01:00
James Turner
c04406d75a Clean shutdown+join of FLITE synthesis threads.
use a marker value to wake the blocking queue, and allow the thread
loop to terminate cleanly, before calling join() from the parent
thread.
2017-02-21 11:01:16 +00:00
Richard Harrison
4f04975508 Merge branch 'next-2' into multiplayer-dev
# Conflicts:
#	src/AIModel/AIMultiplayer.cxx
#	src/MultiPlayer/multiplaymgr.cxx
2017-02-20 03:38:51 +01:00
Richard Harrison
60eee7722d Another different fix for the pointer conversion issue.
Based on the comments in the list I think it is better to keep the type that was originally provided as a reference, take the address of it, and store that in a ref_ptr.

Possibly the problem was never compiler related rather OSG related; I'm using 3.5.x and it appears that there are better built in type conversions compared to the target version of 3.2 that we are currently using.
2017-02-17 17:56:32 +01:00
James Turner
478171b8db Testing a different fix for ref-ptr conversion.
This ‘should’ work, but might fail the same as Richard’s
original patch. Let’s find out.
2017-02-16 18:43:58 -08:00
Richard Harrison
2226428b85 AI Multiplayer interpolation.
Whilst debugging I had a cannot increment nextIt - because it was at end(). No idea if this could ever happen in flight but it still seems sensible to protect against it.
2017-02-16 20:53:44 +01:00
Richard Harrison
36fd6466b7 Multiplayer packet handling bugfix;
Unknown property ID causes break out of the loop to ensure that no further properties are processed from the incoming packet
2017-02-16 18:39:38 +01:00
Richard Harrison
4a156fe0b0 Temporary fix to the canvas replacement visitor
Use pointers to allow compilation on Linux/Mac until this is fixed properly as OSG elements should always be accessed via the reference counting mechanism.
2017-02-16 18:38:48 +01:00
Richard Harrison
cbb7915e49 Ensure to break out of the loop when an unrecognised incoming MP property id is encountered in a packet. 2017-02-16 18:30:17 +01:00
Richard Harrison
11778f595f Fixed exception caused when next is equal to end()
This happened whilst running under debug whilst spawning at a new location so it may be an edge case, but still worth checking for
2017-02-16 18:29:44 +01:00
Richard Harrison
bde3dd0644 Canvas texture replacement visitor compiler fix.
Change to use pointers rather than osg::ref_ptr<osg::Group> - based on http://andesengineering.com/OSG_ProducerArticles/RefPointers/RefPointers I think that it is not possible that the scenegraph can be modified between the visitor and the modify, provided that the methods are called after each other like this:

  ReplaceStaticTextureVisitor visitor(name, new_texture);
  branch->accept(visitor);
  visitor.modify_groups();
  return visitor.getPlacements();
2017-02-16 09:16:27 +01:00
Richard Harrison
41ecfd1972 Merge branch 'next-2' into multiplayer-dev
# Conflicts:
#	utils/fgqcanvas/CMakeLists.txt
2017-02-15 05:19:12 +01:00
Richard Harrison
e48a3d8b32 Replacement Texture visitor modified iterator whilst iterating
The visitor would modify the scenegraph during the traversal by inserting groups; this is not valid when using vectors, and MSVC2015 debug RTL throws an exception when this happens.

The fix is to simply make a list of the textures that need to be modified and modify once the scenegraph traversal has finished.
2017-02-14 18:56:38 +01:00
Richard Harrison
fa142c9464 Change log level for "prepare_ground_cache(): scenery_available returns false" message as the message occurs at a high rate and seems to be more suited at bulk rather than warn level 2017-02-14 16:08:05 +01:00
Richard Harrison
275d73d01f Multiplay: Improve log message handling for win32. 2017-02-14 16:08:04 +01:00
Richard Harrison
ecc38e76c2 ShortInts now transmit properly over MP.
I get a "unknown property ID" as we appear to transmit an extra 0 at the end; will investigate this next
2017-02-13 02:06:39 +01:00
Florent Rougon
8f24de831d Adapt includes according to relocation of SimGear's iostreams-related files
This change is the logical counterpart of SimGear's change from commit
79f869a7f32910197be72b21f6489fbbba02c836 that moved the following files
from simgear/misc to simgear/io/iostreams:

  gzcontainerfile.cxx
  gzcontainerfile.hxx
  gzfstream.cxx (formerly zfstream.cxx)
  gzfstream.hxx (formerly zfstream.hxx)
  sgstream.cxx
  sgstream.hxx
  sgstream_test.cxx
2017-02-12 21:30:51 +01:00
Richard Harrison
31e684b7e0 added support for short int encoding.
This is where the ID and the 16 bit value are transitted in the ID field; with no data field. The ID is in the highword - and this is detected by the client and processed as |ID  |VALU|
2017-02-12 20:14:02 +01:00
Richard Harrison
561087a30a Support for configurable MP Protocol Version 1.1.2
/sim/multiplay/protocol-version is either 1 or 2

The properties defined in multiplaymgr define which version they are related to; however if these are in a more recent protocol than selected they will be transmitted in the selected protocol version.

The id property list now defines a "transmit as" - however this is not yet implemented.

This commit is intended to be a WIP towards changes for 2017.1 that will ensure any future protocol changes are compatible with this version (so this 2017.1 would be able to see a protocl V3 FG if one ever existed), key to this is to stop processing the property list as soon as an unknown ID is encountered.
2017-02-12 16:57:24 +01:00
James Turner
a83947edbf Basic validation of added scenery paths.
Try to catch uses adding parent directories and hence missing
scenery.
2017-02-10 23:04:00 +00:00
Richard Harrison
ded4ec5ae3 merged 2017-02-07 00:37:14 +01:00
Richard Harrison
5b4e55a9a9 Should never happen; but I had a crash here. 2017-02-07 00:36:24 +01:00
Richard Harrison
efcb969c7f Merge remote-tracking branch 'main-source/topics/nasal-aircraft-offset' into multiplayer-dev 2017-02-05 12:44:10 +01:00
Richard Harrison
abd3e02d4d partitioned MP messages.
This moves certain properties into a second part of the buffer that isn't visible to the first with the intention of making a backwards compatible MP protocol that can have more efficient encoding in a second part that is after MsgLen.

Unfortunately this doesn't work because the code ensures that MsgLen in the header matches the received byte count.
2017-02-04 23:59:14 +01:00
Richard Harrison
78cfcbe466 Ensure avoinics sound totally disabled for AI craft 2017-02-04 23:57:26 +01:00
Richard Harrison
a896f4d20c Added new generic properties.
New string encoding that is efficient.
2017-02-04 06:11:12 +01:00
James Turner
d13a672698 Expose aircraft-relative offset to Nasal.
This allows easily computing offsets in aircraft-relative coordinates,
and converting to global cartesian (ECEF) reference frame.
2017-02-02 17:54:18 +01:00
Richard Harrison
9c3697e16d Revised f_get_cart_ground_intersection to take 2 parameters, start:vec3d(x,y,z) , direction:vec3d(x,y,z) and returns geod hash.
Revised logic of f_get_cart_ground_intersection to make it more readable by checking the parameter validity at the beginning of the function
2017-02-02 17:25:40 +01:00
James Turner
d05b934702 Revert "Fixes for HUD, model-manager listeners."
This reverts commit 831053bd04.

See if this fixes the problem deleting models which Denk reported.
2017-02-02 17:02:39 +01:00
Erik Hofman
05b2b6536b Make use of the Vector new interpolation function 2017-02-02 11:35:55 +01:00