2,733
edits
(time and lag are doubles!) |
Red Leader (talk | contribs) (Cleanup + Out of date) |
||
Line 1: | Line 1: | ||
{{Out of date}} | |||
== The messages == | == The messages == | ||
Line 8: | Line 11: | ||
|'''Magic'''|'''Version'''|'''MsgId'''|'''MsgLen'''|'''ReplyAddress'''|'''ReplyPort'''|'''Callsign'''|'''Data'''| | |'''Magic'''|'''Version'''|'''MsgId'''|'''MsgLen'''|'''ReplyAddress'''|'''ReplyPort'''|'''Callsign'''|'''Data'''| | ||
{| class=" | {| class="wikitable" | ||
|Magic: | |Magic: | ||
|4 bytes, always 0x46474653 ("FGFS") | |4 bytes, always 0x46474653 ("FGFS") | ||
Line 17: | Line 20: | ||
|MsgId: | |MsgId: | ||
|4 bytes, defines what data is appended to the header. Can be 0x00000001 for chat messages (deprecated) or<br /> | |4 bytes, defines what data is appended to the header. Can be 0x00000001 for chat messages (deprecated) or<br /> | ||
0x00000007 for position data | 0x00000007 for position data - all other values are outdated and ignored | ||
|- | |- | ||
|MsgLen: | |MsgLen: | ||
|4 bytes, the length of the data. | |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.}} | ||
|- | |- | ||
|ReplyAddress: | |ReplyAddress: | ||
Line 38: | Line 41: | ||
== Data of position messages == | == Data of position messages == | ||
The data of position data is more complicated and looks like this: | The data of position data is more complicated and looks like this: | ||
{| class=" | {| class="wikitable" | ||
|ModelName | |ModelName | ||
|96 bytes, zero terminated array of characters representing the aircraft model used by the user | |96 bytes, zero terminated array of characters representing the aircraft model used by the user | ||
Line 102: | Line 105: | ||
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 and not in this order: | ||
{{Note|This table is outdated. Please see {{Git link|gitorious|fg/flightgear|master|src/MultiPlayer/multiplaymgr.cxx|text=src/MultiPlayer/multiplaymgr.cxx}} for the current list.}} | |||
{| class=" | {| class="wikitable" | ||
!ID !! Property || | !ID !! Property || [[Multiplayer_protocol#Types|Types]] | ||
|- | |- | ||
|100 || "surface-positions/left-aileron-pos-norm" || FLOAT | |100 || "surface-positions/left-aileron-pos-norm" || FLOAT | ||
Line 411: | Line 414: | ||
|} | |} | ||
== Types == | |||
The types are XDR encoded as follows: | |||
* <tt>INT</tt>: 4 bytes, send unconditionally | |||
* <tt>FLOAT</tt>: 4 bytes, send unconditionally | |||
* <tt>BOOL</tt>: 4 bytes, send unconditionally | |||
* <tt>STRING [LEN|STR|PAD]</tt>: | |||
Due to a bug, all bytes in the STRING field are sent as | ** <tt>LEN</tt>: 4 bytes, length of the decoded string | ||
** <tt>STR</tt>: LEN*4 bytes, encoded string. | |||
** <tt>PAD</tt>: n*4 bytes, padding. | |||
{{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.}} | |||
[[Category:Multiplayer]] | [[Category:Multiplayer]] |