Multiplayer protocol: Difference between revisions

Jump to navigation Jump to search
Major cleanup
m (Rearrange order)
(Major cleanup)
Line 1: Line 1:
== Resources ==
The '''multiplayer protocol''' is the way FlightGear communicates between instances and the [[Howto:Multiplayer|multiplayer]] servers.


The routines for handling XDR are contained in $FG_SRC/Multiplayer/tiny_xdr.[h|c]xx:
The multiplayer protocol uses XDR encoded messages that are sent via UDP. All messages are composed of XDR (eXternal Data Representation) encoded data as per RFC 1832.


http://gitorious.org/fg/flightgear/blobs/next/src/MultiPlayer/tiny_xdr.cxx
XDR basically means that all data is in network byte order and aligned to the nearest multiple of 4 bytes. Strings are encoded as a zero-terminated array of characters, aligned to the nearest multiple of 4 bytes, and floating point numbers (32 or 64 bit) must be encoded as per the IEEE standard.


The different message types supported by the MP protocol are specified in $FG_SRC/MultiPlayer/mpmessages.hxx:
== Data types ==
The data is XDR encoded as the following types:


http://gitorious.org/fg/flightgear/blobs/next/src/MultiPlayer/mpmessages.hxx
{{Caution|Due to a bug, all bytes in the <tt>STRING</tt> field are sent as '''4-byte ints''' (not in the header or the position message). So STR has length (LEN * 4) bytes and padding ((4 - LEN%4) * 4) bytes, if LEN%4 is not 0.}}


The multiplayer system code:
{| class="wikitable"
! Type !! Size !! Remarks
|-
| int
| 4 bytes
| Send unconditionally
|-
| float
| 4 bytes
| Send unconditionally
|-
| bool
| 4 bytes
| Send unconditionally
|-
| string
| (LEN + STR + PAD) bytes
|
LEN: 4 bytes, length of the decoded string<br/>
STR: (LEN * 4) bytes, encoded string<br/>
PAD: (n * 4) bytes, padding<br/>
|}


https://gitorious.org/fg/flightgear/blobs/next/src/MultiPlayer/multiplaymgr.cxx
== Messages ==
 
=== Messages header ===
eXternal Data Representation (XDR):
 
http://en.wikipedia.org/wiki/External_Data_Representation
 
Multiplayer Forum Post (very helpful):
 
http://forum.flightgear.org/viewtopic.php?f=18&t=13510&hilit=development+help+xdr#p136501
 
== The messages ==
 
All messages are composed of XDR encoded data. (see [http://www.faqs.org/rfcs/rfc1832.html RFC 1832] for a complete description of XDR). XDR basically means: All data is in network byte order and aligned to the nearest multiple of 4 bytes. Strings are encoded as a zero-terminated array of characters,aligned to the nearest multiple of 4 bytes. Floating point numbers (32 or 64 bit) must be encode in the IEEE standard.
FlightGear uses XDR encoded messages that are sent via UDP.
 
== The header ==
The header is always 32 bytes long and contains the following fields in exactly that order:
The header is always 32 bytes long and contains the following fields in exactly that order:
|'''Magic'''|'''Version'''|'''MsgId'''|'''MsgLen'''|'''ReplyAddress'''|'''ReplyPort'''|'''Callsign'''|'''Data'''|


{| class="wikitable"
{| class="wikitable"
|Magic:
! Field !! Size !! Remarks
|4 bytes, always 0x46474653 ("FGFS")
|-
|-
|Version:
| Magic
|4 bytes, protocol version, currently 0x00010001 (1.1)
| 4 bytes
| Always 0x46474653 ("FGFS")
|-
|-
|MsgId:
| Version
|4 bytes, defines what data is appended to the header. Can be 0x00000001 for chat messages (deprecated) or<br />
| 4 bytes
0x00000007 for position data - all other values are outdated and ignored
| Protocol version, currently 0x00010001 (1.1)
|-
|-
|MsgLen:
| MsgId
|4 bytes, the length of the data. {{Caution|This is not in bytes, see the description of STRING field at the end for more information.}}
| 4 bytes
| Defines what data is appended to the header. Can be 0x00000001 for chat messages (deprecated) or 0x00000007 for position data - all other values are outdated and ignored.
|-
|-
|ReplyAddress:
| MsgLen
|4 bytes, deprecated and ignored
| 4 bytes
| Length of the data. {{Caution|This is '''not in bytes''', see the description of the STRING data type.}}
|-
|-
|ReplyPort:
| ReplyAddress
|4 bytes, deprecated and ignored
| 4 bytes
| Deprecated and ignored
|-
|-
|Callsign:
| ReplyPort
|8 bytes, zero terminated array of characters representing
| 4 bytes
the user callsign
| Deprecated and ignored
|-
| Callsign
| 8 bytes
| Zero terminated array of characters representing the user callsign
|}
|}


== Data of chat messages ==
=== Chat messages ===
The data for chat messages is a zero terminated array of characters. The MsgLen field in the header represents its length. The maximum length is defined to be 256 bytes.
The data for chat messages is a zero terminated array of characters. The MsgLen field in the header represents its length. The maximum length is defined to be 256 bytes.


== Data of position messages ==
=== Position messages ===
The data of position data is more complicated and looks like this:
The data of position message is more complicated and is composed of a two parts.  The first part contain information needed to place an aircraft model in the right position and orientation.  The second part contain property values used for animating the model, provided the user on the receiving end would have that aircraft installed.
 
==== First part ====
{{note|1=<br/>
* Positions are in with respect to the Earth centered frame
* Orientations are with respect to the X, Y and Z axis of the Earth centered frame, stored in the angle axis representation where the angle is coded into the axis length
* Velocities are along the X, Y and Z directions of the Earth centered frame
* Angular accelerations are in two parts of the three dimensional angular velocity vector with respect to the Earth centered frame measured in the Earth centered frame
* Linear accelerations are in two parts of the three dimensional linear acceleration vector with respect to the Earth centered frame measured in the Earth centered frame}}
 
The first part contain these fields in exactly that order:
{| class="wikitable"
{| class="wikitable"
|ModelName
! Field !! Size !! Remarks
|96 bytes, zero terminated array of characters representing the aircraft model used by the user
|-
|-
|time
| ModelName
|8 bytes, representing the time when this message was generated double
| 96 bytes
| Zero terminated array of characters representing the aircraft model (<code>/sim/model/path</code>) used by the user
|-
|-
|lag  || 8 bytes, time offset for network lag double
| time
| 8 bytes
| Representing the time when this message was generated double
|-
|-
|PosX || 8 bytes, XDR encoded double value, X-ccordinate of users<br />
| lag
position wrt the earth centered frame
| 8 bytes
| Time offset for network lag double
|-
|-
|PosY || 8 bytes, XDR encoded double value, Y-ccordinate of users<br />
| PosX
position wrt the earth centered frame
| 8 bytes
| XDR encoded double value, X-ccordinate of users position
|-
|-
|PosZ || 8 bytes, XDR encoded double value, z-ccordinate of users
| PosY
position wrt the earth centered frame
| 8 bytes
| XDR encoded double value, Y-ccordinate of users position
|-
|-
|OriX || 4 bytes, XDR encoded float value, X-orientation of the user wrt the earth centered frame, stored in the angle axis representation where the angle is coded into the axis length
| PosZ
| 8 bytes
| XDR encoded double value, z-ccordinate of users position
|-
|-
|OriY || 4 bytes, XDR encoded float value, Y-orientation of the user wrt the earth centered frame, stored in the angle axis representation where the angle is coded into the axis length
| OriX
| 4 bytes
| XDR encoded float value, X-orientation of the user
|-
|-
|OriZ || 4 bytes, XDR encoded float value, Z-orientation of the user wrt the earth centered frame, stored in the angle axis representation where the angle is coded into the axis length
| OriY
| 4 bytes
| XDR encoded float value, Y-orientation of the user
|-
|-
|VelX || 4 bytes, XDR encoded float value, velocity of the user in X direction wrt the earth centered frame measured in the earth centered frame
| OriZ
| 4 bytes
| XDR encoded float value, Z-orientation of the user
|-
|-
|VelY || 4 bytes, XDR encoded float value, velocity of the user in Y direction wrt the earth centered frame measured in the earth centered frame
| VelX
| 4 bytes
| XDR encoded float value, velocity of the user in X direction
|-
|-
|VelZ || 4 bytes, XDR encoded float value, velocity of the user in Z direction wrt the earth centered frame measured in the earth centered frame
| VelY
| 4 bytes
| XDR encoded float value, velocity of the user in Y direction
|-
|-
|AV1 || 4 bytes, XDR encoded float value, 1. part of the three dimensional angular velocity vector<br />
|VelZ
wrt the earth centered frame measured in the earth centered frame
| 4 bytes
| XDR encoded float value, velocity of the user in Z direction
|-
|-
|AV2 || 4 bytes, XDR encoded float value, 2. part of the three dimensional angular velocity vector<br />
| AV1
wrt the earth centered frame measured in the earth centered frame
| 4 bytes
| XDR encoded float value, 1. part of the three dimensional angular velocity vector
|-
|-
|AV3 || 4 bytes, XDR encoded float value, 3. part of the three dimensional angular velocity vector<br />
| AV2
wrt the earth centered frame measured in the earth centered frame
| 4 bytes
| XDR encoded float value, 2. part of the three dimensional angular velocity vector
|-
|-
|LA1 || 4 bytes, XDR encoded float value, 1. part of the three dimensional linear accelaration vector<br />
| AV3
wrt the earth centered frame measured in the earth centered frame
| 4 bytes
| XDR encoded float value, 3. part of the three dimensional angular velocity vector
|-
|-
|LA2 || 4 bytes, XDR encoded float value, 2. part of the three dimensional linear accelaration vector<br />
| LA1
wrt the earth centered frame measured in the earth centered frame
| 4 bytes
| XDR encoded float value, 1. part of the three dimensional linear accelaration vector
|-
|-
|LA3 || 4 bytes, XDR encoded float value, 3. part of the three dimensional linear accelaration vector<br />
| LA2
wrt the earth centered frame measured in the earth centered frame
| 4 bytes
| XDR encoded float value, 2. part of the three dimensional linear accelaration vector
|-
|-
|AA1 || 4 bytes, XDR encoded float value, 1. part of the three dimensional angular accelaration vector<br />
| LA3
wrt the earth centered frame measured in the earth centered frame
| 4 bytes
| XDR encoded float value, 3. part of the three dimensional linear accelaration vector
|-
|-
|AA2 || 4 bytes, XDR encoded float value, 2. part of the three dimensional angular accelaration vector<br />
| AA1
wrt the earth centered frame measured in the earth centered frame
| 4 bytes
| XDR encoded float value, 1. part of the three dimensional angular accelaration vector
|-
|-
|AA3 || 4 bytes, XDR encoded float value, 3. part of the three dimensional angular accelaration vector<br />
| AA2
wrt the earth centered frame measured in the earth centered frame
| 4 bytes
| XDR encoded float value, 2. part of the three dimensional angular accelaration vector
|-
|-
|pad || up to 8 bytes for padding the data to a multiple of 8 bytes
| AA3
| 4 bytes
| XDR encoded float value, 3. part of the three dimensional angular accelaration vector
|-
| pad
| up to 8 bytes
| For padding the data to a multiple of 8 bytes
|}
|}


This data is followed by '''property-values''', which are encoded in the form '''ID'''|'''Value'''
==== Second part ====
{{Note|This table is is current for FlightGear 3.2.0.  For the list in the development version, see {{Git link|gitorious|fg/flightgear|master|src/MultiPlayer/multiplaymgr.cxx|text=src/MultiPlayer/multiplaymgr.cxx}}.}}


{{Note|This table is is current for FlightGear 3.2.0.  For the list in the development version, see {{Git link|gitorious|fg/flightgear|master|src/MultiPlayer/multiplaymgr.cxx|text=src/MultiPlayer/multiplaymgr.cxx}}.}}
The fields of the second part are '''property values''' encoded in the form '''ID'''|'''Value'''.


The following properties are transmitted, but not necessarily all present and not in this order:
The following properties are transmitted, but not necessarily all present or in this order:


{| class="wikitable"
{| class="wikitable"
!ID  !! Property                                             || [[#Types|Types]]
! ID  !! Property !! Type
|-
|-
|100 || surface-positions/left-aileron-pos-norm                || float
| 100 || surface-positions/left-aileron-pos-norm                || float
|-
|-
|101 || surface-positions/right-aileron-pos-norm              || float
| 101 || surface-positions/right-aileron-pos-norm              || float
|-
|-
|102 || surface-positions/elevator-pos-norm                    || float
| 102 || surface-positions/elevator-pos-norm                    || float
|-
|-
|103 || surface-positions/rudder-pos-norm                      || float
| 103 || surface-positions/rudder-pos-norm                      || float
|-
|-
|104 || surface-positions/flap-pos-norm                        || float
| 104 || surface-positions/flap-pos-norm                        || float
|-
|-
|105 || surface-positions/speedbrake-pos-norm                  || float
| 105 || surface-positions/speedbrake-pos-norm                  || float
|-
|-
|106 || gear/tailhook/position-norm                            || float
| 106 || gear/tailhook/position-norm                            || float
|-
|-
|107 || gear/launchbar/position-norm                          || float
| 107 || gear/launchbar/position-norm                          || float
|-
|-
|108 || gear/launchbar/state                                  || string
| 108 || gear/launchbar/state                                  || string
|-
|-
|109 || gear/launchbar/holdback-position-norm                  || float
| 109 || gear/launchbar/holdback-position-norm                  || float
|-
|-
|110 || canopy/position-norm                                  || float
| 110 || canopy/position-norm                                  || float
|-
|-
|111 || surface-positions/wing-pos-norm                        || float
| 111 || surface-positions/wing-pos-norm                        || float
|-
|-
|112 || surface-positions/wing-fold-pos-norm                  || float
| 112 || surface-positions/wing-fold-pos-norm                  || float
|-
|-
|200 || gear/gear[0]/compression-norm                          || float
| 200 || gear/gear[0]/compression-norm                          || float
|-
|-
|201 || gear/gear[0]/position-norm                            || float
| 201 || gear/gear[0]/position-norm                            || float
|-
|-
|210 || gear/gear[1]/compression-norm                          || float
| 210 || gear/gear[1]/compression-norm                          || float
|-
|-
|211 || gear/gear[1]/position-norm                            || float
| 211 || gear/gear[1]/position-norm                            || float
|-
|-
|220 || gear/gear[2]/compression-norm                          || float
| 220 || gear/gear[2]/compression-norm                          || float
|-
|-
|221 || gear/gear[2]/position-norm                            || float
| 221 || gear/gear[2]/position-norm                            || float
|-
|-
|230 || gear/gear[3]/compression-norm                          || float
| 230 || gear/gear[3]/compression-norm                          || float
|-
|-
|231 || gear/gear[3]/position-norm                            || float
| 231 || gear/gear[3]/position-norm                            || float
|-
|-
|240 || gear/gear[4]/compression-norm                          || float
| 240 || gear/gear[4]/compression-norm                          || float
|-
|-
|241 || gear/gear[4]/position-norm                            || float
| 241 || gear/gear[4]/position-norm                            || float
|-
|-
|300 || engines/engine[0]/n1                                  || float
| 300 || engines/engine[0]/n1                                  || float
|-
|-
|301 || engines/engine[0]/n2                                  || float
| 301 || engines/engine[0]/n2                                  || float
|-
|-
|302 || engines/engine[0]/rpm                                  || float
| 302 || engines/engine[0]/rpm                                  || float
|-
|-
|310 || engines/engine[1]/n1                                  || float
| 310 || engines/engine[1]/n1                                  || float
|-
|-
|311 || engines/engine[1]/n2                                  || float
| 311 || engines/engine[1]/n2                                  || float
|-
|-
|312 || engines/engine[1]/rpm                                  || float
| 312 || engines/engine[1]/rpm                                  || float
|-
|-
|320 || engines/engine[2]/n1                                  || float
| 320 || engines/engine[2]/n1                                  || float
|-
|-
|321 || engines/engine[2]/n2                                  || float
| 321 || engines/engine[2]/n2                                  || float
|-
|-
|322 || engines/engine[2]/rpm                                  || float
| 322 || engines/engine[2]/rpm                                  || float
|-
|-
|330 || engines/engine[3]/n1                                  || float
| 330 || engines/engine[3]/n1                                  || float
|-
|-
|331 || engines/engine[3]/n2                                  || float
| 331 || engines/engine[3]/n2                                  || float
|-
|-
|332 || engines/engine[3]/rpm                                  || float
| 332 || engines/engine[3]/rpm                                  || float
|-
|-
|340 || engines/engine[4]/n1                                  || float
| 340 || engines/engine[4]/n1                                  || float
|-
|-
|341 || engines/engine[4]/n2                                  || float
| 341 || engines/engine[4]/n2                                  || float
|-
|-
|342 || engines/engine[4]/rpm                                  || float
| 342 || engines/engine[4]/rpm                                  || float
|-
|-
|350 || engines/engine[5]/n1                                  || float
| 350 || engines/engine[5]/n1                                  || float
|-
|-
|351 || engines/engine[5]/n2                                  || float
| 351 || engines/engine[5]/n2                                  || float
|-
|-
|352 || engines/engine[5]/rpm                                  || float
| 352 || engines/engine[5]/rpm                                  || float
|-
|-
|360 || engines/engine[6]/n1                                  || float
| 360 || engines/engine[6]/n1                                  || float
|-
|-
|361 || engines/engine[6]/n2                                  || float
| 361 || engines/engine[6]/n2                                  || float
|-
|-
|362 || engines/engine[6]/rpm                                  || float
| 362 || engines/engine[6]/rpm                                  || float
|-
|-
|370 || engines/engine[7]/n1                                  || float
| 370 || engines/engine[7]/n1                                  || float
|-
|-
|371 || engines/engine[7]/n2                                  || float
| 371 || engines/engine[7]/n2                                  || float
|-
|-
|372 || engines/engine[7]/rpm                                  || float
| 372 || engines/engine[7]/rpm                                  || float
|-
|-
|380 || engines/engine[8]/n1                                  || float
| 380 || engines/engine[8]/n1                                  || float
|-
|-
|381 || engines/engine[8]/n2                                  || float
| 381 || engines/engine[8]/n2                                  || float
|-
|-
|382 || engines/engine[8]/rpm                                  || float
| 382 || engines/engine[8]/rpm                                  || float
|-
|-
|390 || engines/engine[9]/n1                                  || float
| 390 || engines/engine[9]/n1                                  || float
|-
|-
|391 || engines/engine[9]/n2                                  || float
| 391 || engines/engine[9]/n2                                  || float
|-
|-
|392 || engines/engine[9]/rpm                                  || float
| 392 || engines/engine[9]/rpm                                  || float
|-
|-
|800 || rotors/main/rpm                                        || float
| 800 || rotors/main/rpm                                        || float
|-
|-
|801 || rotors/tail/rpm                                        || float
| 801 || rotors/tail/rpm                                        || float
|-
|-
|810 || rotors/main/blade[0]/position-deg                      || float
| 810 || rotors/main/blade[0]/position-deg                      || float
|-
|-
|811 || rotors/main/blade[1]/position-deg                      || float
| 811 || rotors/main/blade[1]/position-deg                      || float
|-
|-
|812 || rotors/main/blade[2]/position-deg                      || float
| 812 || rotors/main/blade[2]/position-deg                      || float
|-
|-
|813 || rotors/main/blade[3]/position-deg                      || float
| 813 || rotors/main/blade[3]/position-deg                      || float
|-
|-
|820 || rotors/main/blade[0]/flap-deg                          || float
| 820 || rotors/main/blade[0]/flap-deg                          || float
|-
|-
|821 || rotors/main/blade[1]/flap-deg                          || float
| 821 || rotors/main/blade[1]/flap-deg                          || float
|-
|-
|822 || rotors/main/blade[2]/flap-deg                          || float
| 822 || rotors/main/blade[2]/flap-deg                          || float
|-
|-
|823 || rotors/main/blade[3]/flap-deg                          || float
| 823 || rotors/main/blade[3]/flap-deg                          || float
|-
|-
|830 || rotors/tail/blade[0]/position-deg                      || float
| 830 || rotors/tail/blade[0]/position-deg                      || float
|-
|-
|831 || rotors/tail/blade[1]/position-deg                      || float
| 831 || rotors/tail/blade[1]/position-deg                      || float
|-
|-
|900 || sim/hitches/aerotow/tow/length                        || float
| 900 || sim/hitches/aerotow/tow/length                        || float
|-
|-
|901 || sim/hitches/aerotow/tow/elastic-constant              || float
| 901 || sim/hitches/aerotow/tow/elastic-constant              || float
|-
|-
|902 || sim/hitches/aerotow/tow/weight-per-m-kg-m              || float
| 902 || sim/hitches/aerotow/tow/weight-per-m-kg-m              || float
|-
|-
|903 || sim/hitches/aerotow/tow/dist                          || float
| 903 || sim/hitches/aerotow/tow/dist                          || float
|-
|-
|904 || sim/hitches/aerotow/tow/connected-to-property-node    || bool
| 904 || sim/hitches/aerotow/tow/connected-to-property-node    || bool
|-
|-
|905 || sim/hitches/aerotow/tow/connected-to-ai-or-mp-callsign || string
| 905 || sim/hitches/aerotow/tow/connected-to-ai-or-mp-callsign || string
|-
|-
|906 || sim/hitches/aerotow/tow/brake-force                    || float
| 906 || sim/hitches/aerotow/tow/brake-force                    || float
|-
|-
|907 || sim/hitches/aerotow/tow/end-force-x                    || float
| 907 || sim/hitches/aerotow/tow/end-force-x                    || float
|-
|-
|908 || sim/hitches/aerotow/tow/end-force-y                    || float
| 908 || sim/hitches/aerotow/tow/end-force-y                    || float
|-
|-
|909 || sim/hitches/aerotow/tow/end-force-z                    || float
| 909 || sim/hitches/aerotow/tow/end-force-z                    || float
|-
|-
|930 || sim/hitches/aerotow/is-slave                          || bool
| 930 || sim/hitches/aerotow/is-slave                          || bool
|-
|-
|931 || sim/hitches/aerotow/speed-in-tow-direction            || float
| 931 || sim/hitches/aerotow/speed-in-tow-direction            || float
|-
|-
|932 || sim/hitches/aerotow/open                              || bool
| 932 || sim/hitches/aerotow/open                              || bool
|-
|-
|933 || sim/hitches/aerotow/local-pos-x                        || float
| 933 || sim/hitches/aerotow/local-pos-x                        || float
|-
|-
|934 || sim/hitches/aerotow/local-pos-y                        || float
| 934 || sim/hitches/aerotow/local-pos-y                        || float
|-
|-
|935 || sim/hitches/aerotow/local-pos-z                        || float
| 935 || sim/hitches/aerotow/local-pos-z                        || float
|-
|-
|1001 || controls/flight/slats                                || float
| 1001 || controls/flight/slats                                || float
|-
|-
|1002 || controls/flight/speedbrake                            || float
| 1002 || controls/flight/speedbrake                            || float
|-
|-
|1003 || controls/flight/spoilers                              || float
| 1003 || controls/flight/spoilers                              || float
|-
|-
|1004 || controls/gear/gear-down                              || float
| 1004 || controls/gear/gear-down                              || float
|-
|-
|1005 || controls/lighting/nav-lights                          || float
| 1005 || controls/lighting/nav-lights                          || float
|-
|-
|1006 || controls/armament/station[0]/jettison-all            || bool
| 1006 || controls/armament/station[0]/jettison-all            || bool
|-
|-
|1100 || sim/model/variant                                    || int
| 1100 || sim/model/variant                                    || int
|-
|-
|1101 || sim/model/livery/file                                || string
| 1101 || sim/model/livery/file                                || string
|-
|-
|1200 || environment/wildfire/data                            || string
| 1200 || environment/wildfire/data                            || string
|-
|-
|1201 || environment/contrail                                  || int
| 1201 || environment/contrail                                  || int
|-
|-
|1300 || tanker                                                || int
| 1300 || tanker                                                || int
|-
|-
|1400 || scenery/events                                        || string
| 1400 || scenery/events                                        || string
|-
|-
|1500 || instrumentation/transponder/transmitted-id            || int
| 1500 || instrumentation/transponder/transmitted-id            || int
|-
|-
|1501 || instrumentation/transponder/altitude                  || int
| 1501 || instrumentation/transponder/altitude                  || int
|-
|-
|1502 || instrumentation/transponder/ident                    || bool
| 1502 || instrumentation/transponder/ident                    || bool
|-
|-
|1503 || instrumentation/transponder/inputs/mode              || int
| 1503 || instrumentation/transponder/inputs/mode              || int
|-
|-
|10001 || sim/multiplay/transmission-freq-hz                  || string
| 10001 || sim/multiplay/transmission-freq-hz                  || string
|-
|-
|10002 || sim/multiplay/chat                                  || string
| 10002 || sim/multiplay/chat                                  || string
|-
|-
|10100 || sim/multiplay/generic/string[0]                      || string
| 10100 || sim/multiplay/generic/string[0]                      || string
|-
|-
|10101 || sim/multiplay/generic/string[1]                      || string
| 10101 || sim/multiplay/generic/string[1]                      || string
|-
|-
|10102 || sim/multiplay/generic/string[2]                      || string
| 10102 || sim/multiplay/generic/string[2]                      || string
|-
|-
|10103 || sim/multiplay/generic/string[3]                      || string
| 10103 || sim/multiplay/generic/string[3]                      || string
|-
|-
|10104 || sim/multiplay/generic/string[4]                      || string
| 10104 || sim/multiplay/generic/string[4]                      || string
|-
|-
|10105 || sim/multiplay/generic/string[5]                      || string
| 10105 || sim/multiplay/generic/string[5]                      || string
|-
|-
|10106 || sim/multiplay/generic/string[6]                      || string
| 10106 || sim/multiplay/generic/string[6]                      || string
|-
|-
|10107 || sim/multiplay/generic/string[7]                      || string
| 10107 || sim/multiplay/generic/string[7]                      || string
|-
|-
|10108 || sim/multiplay/generic/string[8]                      || string
| 10108 || sim/multiplay/generic/string[8]                      || string
|-
|-
|10109 || sim/multiplay/generic/string[9]                      || string
| 10109 || sim/multiplay/generic/string[9]                      || string
|-
|-
|10110 || sim/multiplay/generic/string[10]                    || string
| 10110 || sim/multiplay/generic/string[10]                    || string
|-
|-
|10111 || sim/multiplay/generic/string[11]                    || string
| 10111 || sim/multiplay/generic/string[11]                    || string
|-
|-
|10112 || sim/multiplay/generic/string[12]                    || string
| 10112 || sim/multiplay/generic/string[12]                    || string
|-
|-
|10113 || sim/multiplay/generic/string[13]                    || string
| 10113 || sim/multiplay/generic/string[13]                    || string
|-
|-
|10114 || sim/multiplay/generic/string[14]                    || string
| 10114 || sim/multiplay/generic/string[14]                    || string
|-
|-
|10115 || sim/multiplay/generic/string[15]                    || string
| 10115 || sim/multiplay/generic/string[15]                    || string
|-
|-
|10116 || sim/multiplay/generic/string[16]                    || string
| 10116 || sim/multiplay/generic/string[16]                    || string
|-
|-
|10117 || sim/multiplay/generic/string[17]                    || string
| 10117 || sim/multiplay/generic/string[17]                    || string
|-
|-
|10118 || sim/multiplay/generic/string[18]                    || string
| 10118 || sim/multiplay/generic/string[18]                    || string
|-
|-
|10119 || sim/multiplay/generic/string[19]                    || string
| 10119 || sim/multiplay/generic/string[19]                    || string
|-
|-
|10200 || sim/multiplay/generic/float[0]                      || float
| 10200 || sim/multiplay/generic/float[0]                      || float
|-
|-
|10201 || sim/multiplay/generic/float[1]                      || float
| 10201 || sim/multiplay/generic/float[1]                      || float
|-
|-
|10202 || sim/multiplay/generic/float[2]                      || float
| 10202 || sim/multiplay/generic/float[2]                      || float
|-
|-
|10203 || sim/multiplay/generic/float[3]                      || float
| 10203 || sim/multiplay/generic/float[3]                      || float
|-
|-
|10204 || sim/multiplay/generic/float[4]                      || float
| 10204 || sim/multiplay/generic/float[4]                      || float
|-
|-
|10205 || sim/multiplay/generic/float[5]                      || float
| 10205 || sim/multiplay/generic/float[5]                      || float
|-
|-
|10206 || sim/multiplay/generic/float[6]                      || float
| 10206 || sim/multiplay/generic/float[6]                      || float
|-
|-
|10207 || sim/multiplay/generic/float[7]                      || float
| 10207 || sim/multiplay/generic/float[7]                      || float
|-
|-
|10208 || sim/multiplay/generic/float[8]                      || float
| 10208 || sim/multiplay/generic/float[8]                      || float
|-
|-
|10209 || sim/multiplay/generic/float[9]                      || float
| 10209 || sim/multiplay/generic/float[9]                      || float
|-
|-
|10210 || sim/multiplay/generic/float[10]                      || float
| 10210 || sim/multiplay/generic/float[10]                      || float
|-
|-
|10211 || sim/multiplay/generic/float[11]                      || float
| 10211 || sim/multiplay/generic/float[11]                      || float
|-
|-
|10212 || sim/multiplay/generic/float[12]                      || float
| 10212 || sim/multiplay/generic/float[12]                      || float
|-
|-
|10213 || sim/multiplay/generic/float[13]                      || float
| 10213 || sim/multiplay/generic/float[13]                      || float
|-
|-
|10214 || sim/multiplay/generic/float[14]                      || float
| 10214 || sim/multiplay/generic/float[14]                      || float
|-
|-
|10215 || sim/multiplay/generic/float[15]                      || float
| 10215 || sim/multiplay/generic/float[15]                      || float
|-
|-
|10216 || sim/multiplay/generic/float[16]                      || float
| 10216 || sim/multiplay/generic/float[16]                      || float
|-
|-
|10217 || sim/multiplay/generic/float[17]                      || float
| 10217 || sim/multiplay/generic/float[17]                      || float
|-
|-
|10218 || sim/multiplay/generic/float[18]                      || float
| 10218 || sim/multiplay/generic/float[18]                      || float
|-
|-
|10219 || sim/multiplay/generic/float[19]                      || float
| 10219 || sim/multiplay/generic/float[19]                      || float
|-
|-
|10300 || sim/multiplay/generic/int[0]                        || int
| 10300 || sim/multiplay/generic/int[0]                        || int
|-
|-
|10301 || sim/multiplay/generic/int[1]                        || int
| 10301 || sim/multiplay/generic/int[1]                        || int
|-
|-
|10302 || sim/multiplay/generic/int[2]                        || int
| 10302 || sim/multiplay/generic/int[2]                        || int
|-
|-
|10303 || sim/multiplay/generic/int[3]                        || int
| 10303 || sim/multiplay/generic/int[3]                        || int
|-
|-
|10304 || sim/multiplay/generic/int[4]                        || int
| 10304 || sim/multiplay/generic/int[4]                        || int
|-
|-
|10305 || sim/multiplay/generic/int[5]                        || int
| 10305 || sim/multiplay/generic/int[5]                        || int
|-
|-
|10306 || sim/multiplay/generic/int[6]                        || int
| 10306 || sim/multiplay/generic/int[6]                        || int
|-
|-
|10307 || sim/multiplay/generic/int[7]                        || int
| 10307 || sim/multiplay/generic/int[7]                        || int
|-
|-
|10308 || sim/multiplay/generic/int[8]                        || int
| 10308 || sim/multiplay/generic/int[8]                        || int
|-
|-
|10309 || sim/multiplay/generic/int[9]                        || int
| 10309 || sim/multiplay/generic/int[9]                        || int
|-
|-
|10310 || sim/multiplay/generic/int[10]                        || int
| 10310 || sim/multiplay/generic/int[10]                        || int
|-
|-
|10311 || sim/multiplay/generic/int[11]                        || int
| 10311 || sim/multiplay/generic/int[11]                        || int
|-
|-
|10312 || sim/multiplay/generic/int[12]                        || int
| 10312 || sim/multiplay/generic/int[12]                        || int
|-
|-
|10313 || sim/multiplay/generic/int[13]                        || int
| 10313 || sim/multiplay/generic/int[13]                        || int
|-
|-
|10314 || sim/multiplay/generic/int[14]                        || int
| 10314 || sim/multiplay/generic/int[14]                        || int
|-
|-
|10315 || sim/multiplay/generic/int[15]                        || int
| 10315 || sim/multiplay/generic/int[15]                        || int
|-
|-
|10316 || sim/multiplay/generic/int[16]                        || int
| 10316 || sim/multiplay/generic/int[16]                        || int
|-
|-
|10317 || sim/multiplay/generic/int[17]                        || int
| 10317 || sim/multiplay/generic/int[17]                        || int
|-
|-
|10318 || sim/multiplay/generic/int[18]                        || int
| 10318 || sim/multiplay/generic/int[18]                        || int
|-
|-
|10319 || sim/multiplay/generic/int[19]                        || int
| 10319 || sim/multiplay/generic/int[19]                        || int
|}
|}


== Types ==
== Related content ==
The types are XDR encoded as follows:
=== Wiki articles ===
* [[Aircraft properties reference]]
* [[Howto:Multiplayer]]
* [[Howto:Transmit properties over MP]]
* [[Howto:Using mp broadcast.nas]]
 
=== Forum topics ===
* [http://forum.flightgear.org/viewtopic.php?p=136501&sid=38acd29e73affe2a085eef43f0a184c9#p136501 Re: Development Help]


* <tt>INT</tt>:    4 bytes, send unconditionally
=== Source code ===
==== XDR handling ====
* {{flightgear file|src/MultiPlayer/tiny_xdr.hxx}}
* {{flightgear file|src/MultiPlayer/tiny_xdr.cxx}}


* <tt>FLOAT</tt>: 4 bytes, send unconditionally
==== Message types ====
* {{flightgear file|src/MultiPlayer/mpmessages.hxx}}


* <tt>BOOL</tt>:  4 bytes, send unconditionally
==== Multiplayer system ====
* {{flightgear file|src/MultiPlayer/multiplaymgr.hxx}}
* {{flightgear file|src/MultiPlayer/multiplaymgr.cxx}}


* <tt>STRING [LEN|STR|PAD]</tt>:
== External links ==
** <tt>LEN</tt>:    4 bytes, length of the decoded string
* {{Wikipedia|External Data Representation}} (XDR)
** <tt>STR</tt>:    LEN*4 bytes, encoded string.
* {{cite web
** <tt>PAD</tt>:   n*4 bytes, padding.
| url            = https://tools.ietf.org/html/rfc1832
{{Caution|Due to a bug, all bytes in the <tt>STRING</tt> field are sent as 4-byte ints (not in the header or the position message). So STR has length LEN*4 and padding (4-LEN%4)*4 bytes, if LEN%4 is not 0.}}
| title          = RFC 1832 – XDR: External Data Representation Standard
| author          = R. Srinivasan
| date            = August 1995
| publisher      = Internet Engineering Task Force (IETF)
}}


[[Category:Multiplayer]]
[[Category:Multiplayer]]

Navigation menu