Multiplayer protocol: Difference between revisions

Jump to navigation Jump to search
Describe the byte sent as 4byte bug in the multiplayer protocol
m (+cat: Multiplayer)
(Describe the byte sent as 4byte bug in the multiplayer protocol)
Line 101: Line 101:


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:
'''Important:''' This table is outdated. Please have a look in the flightgear sources at src/MultiPlayer/multiplaymgr.cxx
{| class="prettytable" border="1px" cellspacing="0" cellpadding="2"
{| class="prettytable" border="1px" cellspacing="0" cellpadding="2"
!ID  !!  Property                                                      || Type(*)
!ID  !!  Property                                                      || Type(*)
Line 418: Line 420:
  BOOL:  4 bytes, send unconditionally
  BOOL:  4 bytes, send unconditionally


  STRING [LEN|STR|PAD]: send only when length > 0
  STRING [LEN|STR|PAD]:
  LEN:    4 bytes, length of the string
  LEN:    4 bytes, length of the decoded string
  STR:    n bytes, string string itself
  STR:    LEN*4 bytes, encoded string.
  PAD:    n bytes, padding so the overall length is a multiple of 4
  PAD:    n*4 bytes, padding.
 
'''Important'''
Due to a bug, all bytes in the STRING field are sent as 4byte 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 != 0.


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

edits

Navigation menu