Skip to content

bug: GameSpy 3 parsing breaks if server info is split across packets #708

@cetteup

Description

@cetteup

Describe the bug
If the server info (basic key-value pairs) is split across multiple packets, only the first packet is parsed correctly.

Steps To Reproduce
Using the latest version, query a GameSpy 3 server which splits the server info across multiple packets. This can e.g. be forced by using a long sv.sponsorText for a Battlefield 2 server. I'll keep an example running at 202.61.196.80:29902.

Expected behavior
Handle the split packets exactly like the library would handle a single one (parse all server info key-value pairs to state.raw).

Screenshots or Data

Details
Q#0 Starting
Q#0 Protocol: gamespy3
Q#0 Options: {
  socketTimeout: 2000,
  attemptTimeout: 10000,
  maxRetries: 1,
  stripColors: true,
  portCache: true,
  noBreadthOrder: false,
  ipFamily: 0,
  requestPlayers: true,
  port: 29902,
  protocol: 'gamespy3',
  type: 'battlefield2',
  host: '202.61.196.80',
  givenPortOnly: true,
  debug: true
}
Q#0 DNS Lookup: 202.61.196.80
Q#0 Raw IP Address: 202.61.196.80
202.61.196.80:29902 UDP(57795)-->
Buffer length: 11 bytes
fe fd 09 00 00 00 01 00 00 00 00 
                                 

202.61.196.80:29902 <--UDP(57795)
Buffer length: 7 bytes
09 00 00 00 01 30 00 
               0     

Q#0 Registered RTT: 64ms
Q#0 UDP send finished by callback
Q#0 Received challenge key: 0
202.61.196.80:29902 UDP(57795)-->
Buffer length: 11 bytes
fe fd 00 00 00 00 01 ff ff ff 01 
                                 

202.61.196.80:29902 <--UDP(57795)
Buffer length: 432 bytes
00 00 00 00 01 73 70 6c 69 74 6e 75 6d 00 81 00 62 66 32 5f 73 
               s  p  l  i  t  n  u  m           b  f  2  _  s  
70 6f 6e 73 6f 72 6c 6f 67 6f 5f 75 72 6c 00 00 62 66 32 5f 63 
p  o  n  s  o  r  l  o  g  o  _  u  r  l        b  f  2  _  c  
6f 6d 6d 75 6e 69 74 79 6c 6f 67 6f 5f 75 72 6c 00 00 62 66 32 
o  m  m  u  n  i  t  y  l  o  g  o  _  u  r  l        b  f  2  
5f 73 63 6f 72 65 6c 69 6d 69 74 00 30 00 62 66 32 5f 74 69 63 
_  s  c  o  r  e  l  i  m  i  t     0     b  f  2  _  t  i  c  
6b 65 74 72 61 74 69 6f 00 31 30 30 00 62 66 32 5f 74 65 61 6d 
k  e  t  r  a  t  i  o     1  0  0     b  f  2  _  t  e  a  m  
72 61 74 69 6f 00 31 30 30 2e 30 30 30 30 30 30 00 62 66 32 5f 
r  a  t  i  o     1  0  0  .  0  0  0  0  0  0     b  f  2  _  
74 65 61 6d 31 00 4d 45 43 00 62 66 32 5f 74 65 61 6d 32 00 55 
t  e  a  m  1     M  E  C     b  f  2  _  t  e  a  m  2     U  
53 00 62 66 32 5f 62 6f 74 73 00 30 00 62 66 32 5f 70 75 72 65 
S     b  f  2  _  b  o  t  s     0     b  f  2  _  p  u  r  e  
00 31 00 62 66 32 5f 6d 61 70 73 69 7a 65 00 33 32 00 62 66 32 
   1     b  f  2  _  m  a  p  s  i  z  e     3  2     b  f  2  
5f 67 6c 6f 62 61 6c 75 6e 6c 6f 63 6b 73 00 31 00 62 66 32 5f 
_  g  l  o  b  a  l  u  n  l  o  c  k  s     1     b  f  2  _  
66 70 73 00 33 36 2e 30 30 30 30 30 30 00 62 66 32 5f 70 6c 61 
f  p  s     3  6  .  0  0  0  0  0  0     b  f  2  _  p  l  a  
73 6d 61 00 31 00 62 66 32 5f 72 65 73 65 72 76 65 64 73 6c 6f 
s  m  a     1     b  f  2  _  r  e  s  e  r  v  e  d  s  l  o  
74 73 00 30 00 62 66 32 5f 63 6f 6f 70 62 6f 74 72 61 74 69 6f 
t  s     0     b  f  2  _  c  o  o  p  b  o  t  r  a  t  i  o  
00 00 62 66 32 5f 63 6f 6f 70 62 6f 74 63 6f 75 6e 74 00 00 62 
      b  f  2  _  c  o  o  p  b  o  t  c  o  u  n  t        b  
66 32 5f 63 6f 6f 70 62 6f 74 64 69 66 66 00 00 62 66 32 5f 6e 
f  2  _  c  o  o  p  b  o  t  d  i  f  f        b  f  2  _  n  
6f 76 65 68 69 63 6c 65 73 00 30 00 00 01 70 6c 61 79 65 72 5f 
o  v  e  h  i  c  l  e  s     0           p  l  a  y  e  r  _  
00 00 00 73 63 6f 72 65 5f 00 00 00 70 69 6e 67 5f 00 00 00 74 
         s  c  o  r  e  _           p  i  n  g  _           t  
65 61 6d 5f 00 00 00 64 65 61 74 68 73 5f 00 00 00 70 69 64 5f 
e  a  m  _           d  e  a  t  h  s  _           p  i  d  _  
00 00 00 73 6b 69 6c 6c 5f 00 00 00 41 49 42 6f 74 5f 00 00 00 
         s  k  i  l  l  _           A  I  B  o  t  _           
00 02 74 65 61 6d 5f 74 00 00 4d 45 43 00 55 53 00 00 73 63 6f 
      t  e  a  m  _  t        M  E  C     U  S        s  c  o  
72 65 5f 74 00 00 30 00 30 00 00 00 
r  e  _  t        0     0           

Q#0 Registered RTT: 67ms
202.61.196.80:29902 <--UDP(57795)
Buffer length: 1400 bytes
00 00 00 00 01 73 70 6c 69 74 6e 75 6d 00 00 00 68 6f 73 74 6e 
               s  p  l  i  t  n  u  m           h  o  s  t  n  
61 6d 65 00 54 65 73 74 20 4d 63 54 65 73 74 66 61 63 65 20 5b 
a  m  e     T  e  s  t     M  c  T  e  s  t  f  a  c  e     [  
4f 70 65 6e 53 70 79 5d 00 67 61 6d 65 6e 61 6d 65 00 62 61 74 
O  p  e  n  S  p  y  ]     g  a  m  e  n  a  m  e     b  a  t  
74 6c 65 66 69 65 6c 64 32 00 67 61 6d 65 76 65 72 00 31 2e 35 
t  l  e  f  i  e  l  d  2     g  a  m  e  v  e  r     1  .  5  
2e 33 31 35 33 2d 38 30 32 2e 30 00 6d 61 70 6e 61 6d 65 00 53 
.  3  1  5  3  -  8  0  2  .  0     m  a  p  n  a  m  e     S  
74 72 69 6b 65 20 41 74 20 4b 61 72 6b 61 6e 64 00 67 61 6d 65 
t  r  i  k  e     A  t     K  a  r  k  a  n  d     g  a  m  e  
74 79 70 65 00 67 70 6d 5f 63 71 00 67 61 6d 65 76 61 72 69 61 
t  y  p  e     g  p  m  _  c  q     g  a  m  e  v  a  r  i  a  
6e 74 00 62 66 32 00 6e 75 6d 70 6c 61 79 65 72 73 00 30 00 6d 
n  t     b  f  2     n  u  m  p  l  a  y  e  r  s     0     m  
61 78 70 6c 61 79 65 72 73 00 36 34 00 67 61 6d 65 6d 6f 64 65 
a  x  p  l  a  y  e  r  s     6  4     g  a  m  e  m  o  d  e  
00 6f 70 65 6e 70 6c 61 79 69 6e 67 00 70 61 73 73 77 6f 72 64 
   o  p  e  n  p  l  a  y  i  n  g     p  a  s  s  w  o  r  d  
00 30 00 74 69 6d 65 6c 69 6d 69 74 00 30 00 72 6f 75 6e 64 74 
   0     t  i  m  e  l  i  m  i  t     0     r  o  u  n  d  t  
69 6d 65 00 33 00 68 6f 73 74 70 6f 72 74 00 31 36 35 36 39 00 
i  m  e     3     h  o  s  t  p  o  r  t     1  6  5  6  9     
62 66 32 5f 64 65 64 69 63 61 74 65 64 00 31 00 62 66 32 5f 72 
b  f  2  _  d  e  d  i  c  a  t  e  d     1     b  f  2  _  r  
61 6e 6b 65 64 00 30 00 62 66 32 5f 61 6e 74 69 63 68 65 61 74 
a  n  k  e  d     0     b  f  2  _  a  n  t  i  c  h  e  a  t  
00 30 00 62 66 32 5f 6f 73 00 6c 69 6e 75 78 2d 36 34 00 62 66 
   0     b  f  2  _  o  s     l  i  n  u  x  -  6  4     b  f  
32 5f 61 75 74 6f 72 65 63 00 30 00 62 66 32 5f 64 5f 69 64 78 
2  _  a  u  t  o  r  e  c     0     b  f  2  _  d  _  i  d  x  
00 68 74 74 70 3a 2f 2f 00 62 66 32 5f 64 5f 64 6c 00 68 74 74 
   h  t  t  p  :  /  /     b  f  2  _  d  _  d  l     h  t  t  
70 3a 2f 2f 00 62 66 32 5f 76 6f 69 70 00 31 00 62 66 32 5f 61 
p  :  /  /     b  f  2  _  v  o  i  p     1     b  f  2  _  a  
75 74 6f 62 61 6c 61 6e 63 65 64 00 30 00 62 66 32 5f 66 72 69 
u  t  o  b  a  l  a  n  c  e  d     0     b  f  2  _  f  r  i  
65 6e 64 6c 79 66 69 72 65 00 31 00 62 66 32 5f 74 6b 6d 6f 64 
e  n  d  l  y  f  i  r  e     1     b  f  2  _  t  k  m  o  d  
65 00 50 75 6e 69 73 68 00 62 66 32 5f 73 74 61 72 74 64 65 6c 
e     P  u  n  i  s  h     b  f  2  _  s  t  a  r  t  d  e  l  
61 79 00 31 35 00 62 66 32 5f 73 70 61 77 6e 74 69 6d 65 00 31 
a  y     1  5     b  f  2  _  s  p  a  w  n  t  i  m  e     1  
35 2e 30 30 30 30 30 30 00 62 66 32 5f 73 70 6f 6e 73 6f 72 74 
5  .  0  0  0  0  0  0     b  f  2  _  s  p  o  n  s  o  r  t  
65 78 74 00 4c 6f 72 65 6d 20 69 70 73 75 6d 20 64 6f 6c 6f 72 
e  x  t     L  o  r  e  m     i  p  s  u  m     d  o  l  o  r  
20 73 69 74 20 61 6d 65 74 2c 20 63 6f 6e 73 65 63 74 65 74 75 
   s  i  t     a  m  e  t  ,     c  o  n  s  e  c  t  e  t  u  
72 20 61 64 69 70 69 73 63 69 6e 67 20 65 6c 69 74 2c 20 73 65 
r     a  d  i  p  i  s  c  i  n  g     e  l  i  t  ,     s  e  
64 20 64 6f 20 65 69 75 73 6d 6f 64 20 74 65 6d 70 6f 72 20 69 
d     d  o     e  i  u  s  m  o  d     t  e  m  p  o  r     i  
6e 63 69 64 69 64 75 6e 74 20 75 74 20 6c 61 62 6f 72 65 20 65 
n  c  i  d  i  d  u  n  t     u  t     l  a  b  o  r  e     e  
74 20 64 6f 6c 6f 72 65 20 6d 61 67 6e 61 20 61 6c 69 71 75 61 
t     d  o  l  o  r  e     m  a  g  n  a     a  l  i  q  u  a  
2e 20 55 74 20 65 6e 69 6d 20 61 64 20 6d 69 6e 69 6d 20 76 65 
.     U  t     e  n  i  m     a  d     m  i  n  i  m     v  e  
6e 69 61 6d 2c 20 71 75 69 73 20 6e 6f 73 74 72 75 64 20 65 78 
n  i  a  m  ,     q  u  i  s     n  o  s  t  r  u  d     e  x  
65 72 63 69 74 61 74 69 6f 6e 20 75 6c 6c 61 6d 63 6f 20 6c 61 
e  r  c  i  t  a  t  i  o  n     u  l  l  a  m  c  o     l  a  
62 6f 72 69 73 20 6e 69 73 69 20 75 74 20 61 6c 69 71 75 69 70 
b  o  r  i  s     n  i  s  i     u  t     a  l  i  q  u  i  p  
20 65 78 20 65 61 20 63 6f 6d 6d 6f 64 6f 20 63 6f 6e 73 65 71 
   e  x     e  a     c  o  m  m  o  d  o     c  o  n  s  e  q  
75 61 74 2e 20 44 75 69 73 20 61 75 74 65 20 69 72 75 72 65 20 
u  a  t  .     D  u  i  s     a  u  t  e     i  r  u  r  e     
64 6f 6c 6f 72 20 69 6e 20 72 65 70 72 65 68 65 6e 64 65 72 69 
d  o  l  o  r     i  n     r  e  p  r  e  h  e  n  d  e  r  i  
74 20 69 6e 20 76 6f 6c 75 70 74 61 74 65 20 76 65 6c 69 74 20 
t     i  n     v  o  l  u  p  t  a  t  e     v  e  l  i  t     
65 73 73 65 20 63 69 6c 6c 75 6d 20 64 6f 6c 6f 72 65 20 65 75 
e  s  s  e     c  i  l  l  u  m     d  o  l  o  r  e     e  u  
20 66 75 67 69 61 74 20 6e 75 6c 6c 61 20 70 61 72 69 61 74 75 
   f  u  g  i  a  t     n  u  l  l  a     p  a  r  i  a  t  u  
72 2e 20 45 78 63 65 70 74 65 75 72 20 73 69 6e 74 20 6f 63 63 
r  .     E  x  c  e  p  t  e  u  r     s  i  n  t     o  c  c  
61 65 63 61 74 20 63 75 70 69 64 61 74 61 74 20 6e 6f 6e 20 70 
a  e  c  a  t     c  u  p  i  d  a  t  a  t     n  o  n     p  
72 6f 69 64 65 6e 74 2c 20 73 75 6e 74 20 69 6e 20 63 75 6c 70 
r  o  i  d  e  n  t  ,     s  u  n  t     i  n     c  u  l  p  
61 20 71 75 69 20 6f 66 66 69 63 69 61 20 64 65 73 65 72 75 6e 
a     q  u  i     o  f  f  i  c  i  a     d  e  s  e  r  u  n  
74 20 6d 6f 6c 6c 69 74 20 61 6e 69 6d 20 69 64 20 65 73 74 20 
t     m  o  l  l  i  t     a  n  i  m     i  d     e  s  t     
6c 61 62 6f 72 75 6d 2e 20 4c 6f 72 65 6d 20 69 70 73 75 6d 20 
l  a  b  o  r  u  m  .     L  o  r  e  m     i  p  s  u  m     
64 6f 6c 6f 72 20 73 69 74 20 61 6d 65 74 2c 20 63 6f 6e 73 65 
d  o  l  o  r     s  i  t     a  m  e  t  ,     c  o  n  s  e  
63 74 65 74 75 72 20 61 64 69 70 69 73 63 69 6e 67 20 65 6c 69 
c  t  e  t  u  r     a  d  i  p  i  s  c  i  n  g     e  l  i  
74 2c 20 73 65 64 20 64 6f 20 65 69 75 73 6d 6f 64 20 74 65 6d 
t  ,     s  e  d     d  o     e  i  u  s  m  o  d     t  e  m  
70 6f 72 20 69 6e 63 69 64 69 64 75 6e 74 20 75 74 20 6c 61 62 
p  o  r     i  n  c  i  d  i  d  u  n  t     u  t     l  a  b  
6f 72 65 20 65 74 20 64 6f 6c 6f 72 65 20 6d 61 67 6e 61 20 61 
o  r  e     e  t     d  o  l  o  r  e     m  a  g  n  a     a  
6c 69 71 75 61 2e 20 55 74 20 65 6e 69 6d 20 61 64 20 6d 69 6e 
l  i  q  u  a  .     U  t     e  n  i  m     a  d     m  i  n  
69 6d 20 76 65 6e 69 61 6d 2c 20 71 75 69 73 20 6e 6f 73 74 72 
i  m     v  e  n  i  a  m  ,     q  u  i  s     n  o  s  t  r  
75 64 20 65 78 65 72 63 69 74 61 74 69 6f 6e 20 75 6c 6c 61 6d 
u  d     e  x  e  r  c  i  t  a  t  i  o  n     u  l  l  a  m  
63 6f 20 6c 61 62 6f 72 69 73 20 6e 69 73 69 20 75 74 20 61 6c 
c  o     l  a  b  o  r  i  s     n  i  s  i     u  t     a  l  
69 71 75 69 70 20 65 78 20 65 61 20 63 6f 6d 6d 6f 64 6f 20 63 
i  q  u  i  p     e  x     e  a     c  o  m  m  o  d  o     c  
6f 6e 73 65 71 75 61 74 2e 20 44 75 69 73 20 61 75 74 65 20 69 
o  n  s  e  q  u  a  t  .     D  u  i  s     a  u  t  e     i  
72 75 72 65 20 64 6f 6c 6f 72 20 69 6e 20 72 65 70 72 65 68 65 
r  u  r  e     d  o  l  o  r     i  n     r  e  p  r  e  h  e  
6e 64 65 72 69 74 20 69 6e 20 76 6f 6c 75 70 74 61 74 65 20 76 
n  d  e  r  i  t     i  n     v  o  l  u  p  t  a  t  e     v  
65 6c 69 74 20 65 73 73 65 20 63 69 6c 6c 75 6d 20 64 6f 6c 6f 
e  l  i  t     e  s  s  e     c  i  l  l  u  m     d  o  l  o  
72 65 20 65 75 20 66 75 67 69 61 74 20 6e 75 6c 6c 61 20 70 61 
r  e     e  u     f  u  g  i  a  t     n  u  l  l  a     p  a  
72 69 61 74 75 72 2e 20 45 78 63 65 70 74 65 75 72 20 73 69 6e 
r  i  a  t  u  r  .     E  x  c  e  p  t  e  u  r     s  i  n  
74 20 6f 63 63 61 65 63 61 74 20 63 75 70 69 64 61 74 61 74 20 
t     o  c  c  a  e  c  a  t     c  u  p  i  d  a  t  a  t     
6e 6f 6e 20 70 72 6f 69 64 65 6e 74 2c 20 73 75 6e 74 20 69 6e 
n  o  n     p  r  o  i  d  e  n  t  ,     s  u  n  t     i  n  
20 63 75 6c 70 61 20 71 75 69 20 6f 66 66 69 63 69 61 20 64 65 
   c  u  l  p  a     q  u  i     o  f  f  i  c  i  a     d  e  
73 65 72 75 6e 74 20 6d 6f 6c 6c 69 74 20 61 6e 69 6d 20 69 64 
s  e  r  u  n  t     m  o  l  l  i  t     a  n  i  m     i  d  
20 65 73 74 20 6c 61 62 6f 72 75 6d 2e 20 4c 6f 72 65 6d 2e 00 
   e  s  t     l  a  b  o  r  u  m  .     L  o  r  e  m  .     
62 66 32 5f 73 70 6f 6e 73 6f 72 6c 6f 00 
b  f  2  _  s  p  o  n  s  o  r  l  o     

Q#0 Registered RTT: 74ms
Q#0 UDP send finished by callback
Q#0 Parsing packet #0
Q#0 Buffer length: 1384 bytes
68 6f 73 74 6e 61 6d 65 00 54 65 73 74 20 4d 63 54 65 73 74 66 
h  o  s  t  n  a  m  e     T  e  s  t     M  c  T  e  s  t  f  
61 63 65 20 5b 4f 70 65 6e 53 70 79 5d 00 67 61 6d 65 6e 61 6d 
a  c  e     [  O  p  e  n  S  p  y  ]     g  a  m  e  n  a  m  
65 00 62 61 74 74 6c 65 66 69 65 6c 64 32 00 67 61 6d 65 76 65 
e     b  a  t  t  l  e  f  i  e  l  d  2     g  a  m  e  v  e  
72 00 31 2e 35 2e 33 31 35 33 2d 38 30 32 2e 30 00 6d 61 70 6e 
r     1  .  5  .  3  1  5  3  -  8  0  2  .  0     m  a  p  n  
61 6d 65 00 53 74 72 69 6b 65 20 41 74 20 4b 61 72 6b 61 6e 64 
a  m  e     S  t  r  i  k  e     A  t     K  a  r  k  a  n  d  
00 67 61 6d 65 74 79 70 65 00 67 70 6d 5f 63 71 00 67 61 6d 65 
   g  a  m  e  t  y  p  e     g  p  m  _  c  q     g  a  m  e  
76 61 72 69 61 6e 74 00 62 66 32 00 6e 75 6d 70 6c 61 79 65 72 
v  a  r  i  a  n  t     b  f  2     n  u  m  p  l  a  y  e  r  
73 00 30 00 6d 61 78 70 6c 61 79 65 72 73 00 36 34 00 67 61 6d 
s     0     m  a  x  p  l  a  y  e  r  s     6  4     g  a  m  
65 6d 6f 64 65 00 6f 70 65 6e 70 6c 61 79 69 6e 67 00 70 61 73 
e  m  o  d  e     o  p  e  n  p  l  a  y  i  n  g     p  a  s  
73 77 6f 72 64 00 30 00 74 69 6d 65 6c 69 6d 69 74 00 30 00 72 
s  w  o  r  d     0     t  i  m  e  l  i  m  i  t     0     r  
6f 75 6e 64 74 69 6d 65 00 33 00 68 6f 73 74 70 6f 72 74 00 31 
o  u  n  d  t  i  m  e     3     h  o  s  t  p  o  r  t     1  
36 35 36 39 00 62 66 32 5f 64 65 64 69 63 61 74 65 64 00 31 00 
6  5  6  9     b  f  2  _  d  e  d  i  c  a  t  e  d     1     
62 66 32 5f 72 61 6e 6b 65 64 00 30 00 62 66 32 5f 61 6e 74 69 
b  f  2  _  r  a  n  k  e  d     0     b  f  2  _  a  n  t  i  
63 68 65 61 74 00 30 00 62 66 32 5f 6f 73 00 6c 69 6e 75 78 2d 
c  h  e  a  t     0     b  f  2  _  o  s     l  i  n  u  x  -  
36 34 00 62 66 32 5f 61 75 74 6f 72 65 63 00 30 00 62 66 32 5f 
6  4     b  f  2  _  a  u  t  o  r  e  c     0     b  f  2  _  
64 5f 69 64 78 00 68 74 74 70 3a 2f 2f 00 62 66 32 5f 64 5f 64 
d  _  i  d  x     h  t  t  p  :  /  /     b  f  2  _  d  _  d  
6c 00 68 74 74 70 3a 2f 2f 00 62 66 32 5f 76 6f 69 70 00 31 00 
l     h  t  t  p  :  /  /     b  f  2  _  v  o  i  p     1     
62 66 32 5f 61 75 74 6f 62 61 6c 61 6e 63 65 64 00 30 00 62 66 
b  f  2  _  a  u  t  o  b  a  l  a  n  c  e  d     0     b  f  
32 5f 66 72 69 65 6e 64 6c 79 66 69 72 65 00 31 00 62 66 32 5f 
2  _  f  r  i  e  n  d  l  y  f  i  r  e     1     b  f  2  _  
74 6b 6d 6f 64 65 00 50 75 6e 69 73 68 00 62 66 32 5f 73 74 61 
t  k  m  o  d  e     P  u  n  i  s  h     b  f  2  _  s  t  a  
72 74 64 65 6c 61 79 00 31 35 00 62 66 32 5f 73 70 61 77 6e 74 
r  t  d  e  l  a  y     1  5     b  f  2  _  s  p  a  w  n  t  
69 6d 65 00 31 35 2e 30 30 30 30 30 30 00 62 66 32 5f 73 70 6f 
i  m  e     1  5  .  0  0  0  0  0  0     b  f  2  _  s  p  o  
6e 73 6f 72 74 65 78 74 00 4c 6f 72 65 6d 20 69 70 73 75 6d 20 
n  s  o  r  t  e  x  t     L  o  r  e  m     i  p  s  u  m     
64 6f 6c 6f 72 20 73 69 74 20 61 6d 65 74 2c 20 63 6f 6e 73 65 
d  o  l  o  r     s  i  t     a  m  e  t  ,     c  o  n  s  e  
63 74 65 74 75 72 20 61 64 69 70 69 73 63 69 6e 67 20 65 6c 69 
c  t  e  t  u  r     a  d  i  p  i  s  c  i  n  g     e  l  i  
74 2c 20 73 65 64 20 64 6f 20 65 69 75 73 6d 6f 64 20 74 65 6d 
t  ,     s  e  d     d  o     e  i  u  s  m  o  d     t  e  m  
70 6f 72 20 69 6e 63 69 64 69 64 75 6e 74 20 75 74 20 6c 61 62 
p  o  r     i  n  c  i  d  i  d  u  n  t     u  t     l  a  b  
6f 72 65 20 65 74 20 64 6f 6c 6f 72 65 20 6d 61 67 6e 61 20 61 
o  r  e     e  t     d  o  l  o  r  e     m  a  g  n  a     a  
6c 69 71 75 61 2e 20 55 74 20 65 6e 69 6d 20 61 64 20 6d 69 6e 
l  i  q  u  a  .     U  t     e  n  i  m     a  d     m  i  n  
69 6d 20 76 65 6e 69 61 6d 2c 20 71 75 69 73 20 6e 6f 73 74 72 
i  m     v  e  n  i  a  m  ,     q  u  i  s     n  o  s  t  r  
75 64 20 65 78 65 72 63 69 74 61 74 69 6f 6e 20 75 6c 6c 61 6d 
u  d     e  x  e  r  c  i  t  a  t  i  o  n     u  l  l  a  m  
63 6f 20 6c 61 62 6f 72 69 73 20 6e 69 73 69 20 75 74 20 61 6c 
c  o     l  a  b  o  r  i  s     n  i  s  i     u  t     a  l  
69 71 75 69 70 20 65 78 20 65 61 20 63 6f 6d 6d 6f 64 6f 20 63 
i  q  u  i  p     e  x     e  a     c  o  m  m  o  d  o     c  
6f 6e 73 65 71 75 61 74 2e 20 44 75 69 73 20 61 75 74 65 20 69 
o  n  s  e  q  u  a  t  .     D  u  i  s     a  u  t  e     i  
72 75 72 65 20 64 6f 6c 6f 72 20 69 6e 20 72 65 70 72 65 68 65 
r  u  r  e     d  o  l  o  r     i  n     r  e  p  r  e  h  e  
6e 64 65 72 69 74 20 69 6e 20 76 6f 6c 75 70 74 61 74 65 20 76 
n  d  e  r  i  t     i  n     v  o  l  u  p  t  a  t  e     v  
65 6c 69 74 20 65 73 73 65 20 63 69 6c 6c 75 6d 20 64 6f 6c 6f 
e  l  i  t     e  s  s  e     c  i  l  l  u  m     d  o  l  o  
72 65 20 65 75 20 66 75 67 69 61 74 20 6e 75 6c 6c 61 20 70 61 
r  e     e  u     f  u  g  i  a  t     n  u  l  l  a     p  a  
72 69 61 74 75 72 2e 20 45 78 63 65 70 74 65 75 72 20 73 69 6e 
r  i  a  t  u  r  .     E  x  c  e  p  t  e  u  r     s  i  n  
74 20 6f 63 63 61 65 63 61 74 20 63 75 70 69 64 61 74 61 74 20 
t     o  c  c  a  e  c  a  t     c  u  p  i  d  a  t  a  t     
6e 6f 6e 20 70 72 6f 69 64 65 6e 74 2c 20 73 75 6e 74 20 69 6e 
n  o  n     p  r  o  i  d  e  n  t  ,     s  u  n  t     i  n  
20 63 75 6c 70 61 20 71 75 69 20 6f 66 66 69 63 69 61 20 64 65 
   c  u  l  p  a     q  u  i     o  f  f  i  c  i  a     d  e  
73 65 72 75 6e 74 20 6d 6f 6c 6c 69 74 20 61 6e 69 6d 20 69 64 
s  e  r  u  n  t     m  o  l  l  i  t     a  n  i  m     i  d  
20 65 73 74 20 6c 61 62 6f 72 75 6d 2e 20 4c 6f 72 65 6d 20 69 
   e  s  t     l  a  b  o  r  u  m  .     L  o  r  e  m     i  
70 73 75 6d 20 64 6f 6c 6f 72 20 73 69 74 20 61 6d 65 74 2c 20 
p  s  u  m     d  o  l  o  r     s  i  t     a  m  e  t  ,     
63 6f 6e 73 65 63 74 65 74 75 72 20 61 64 69 70 69 73 63 69 6e 
c  o  n  s  e  c  t  e  t  u  r     a  d  i  p  i  s  c  i  n  
67 20 65 6c 69 74 2c 20 73 65 64 20 64 6f 20 65 69 75 73 6d 6f 
g     e  l  i  t  ,     s  e  d     d  o     e  i  u  s  m  o  
64 20 74 65 6d 70 6f 72 20 69 6e 63 69 64 69 64 75 6e 74 20 75 
d     t  e  m  p  o  r     i  n  c  i  d  i  d  u  n  t     u  
74 20 6c 61 62 6f 72 65 20 65 74 20 64 6f 6c 6f 72 65 20 6d 61 
t     l  a  b  o  r  e     e  t     d  o  l  o  r  e     m  a  
67 6e 61 20 61 6c 69 71 75 61 2e 20 55 74 20 65 6e 69 6d 20 61 
g  n  a     a  l  i  q  u  a  .     U  t     e  n  i  m     a  
64 20 6d 69 6e 69 6d 20 76 65 6e 69 61 6d 2c 20 71 75 69 73 20 
d     m  i  n  i  m     v  e  n  i  a  m  ,     q  u  i  s     
6e 6f 73 74 72 75 64 20 65 78 65 72 63 69 74 61 74 69 6f 6e 20 
n  o  s  t  r  u  d     e  x  e  r  c  i  t  a  t  i  o  n     
75 6c 6c 61 6d 63 6f 20 6c 61 62 6f 72 69 73 20 6e 69 73 69 20 
u  l  l  a  m  c  o     l  a  b  o  r  i  s     n  i  s  i     
75 74 20 61 6c 69 71 75 69 70 20 65 78 20 65 61 20 63 6f 6d 6d 
u  t     a  l  i  q  u  i  p     e  x     e  a     c  o  m  m  
6f 64 6f 20 63 6f 6e 73 65 71 75 61 74 2e 20 44 75 69 73 20 61 
o  d  o     c  o  n  s  e  q  u  a  t  .     D  u  i  s     a  
75 74 65 20 69 72 75 72 65 20 64 6f 6c 6f 72 20 69 6e 20 72 65 
u  t  e     i  r  u  r  e     d  o  l  o  r     i  n     r  e  
70 72 65 68 65 6e 64 65 72 69 74 20 69 6e 20 76 6f 6c 75 70 74 
p  r  e  h  e  n  d  e  r  i  t     i  n     v  o  l  u  p  t  
61 74 65 20 76 65 6c 69 74 20 65 73 73 65 20 63 69 6c 6c 75 6d 
a  t  e     v  e  l  i  t     e  s  s  e     c  i  l  l  u  m  
20 64 6f 6c 6f 72 65 20 65 75 20 66 75 67 69 61 74 20 6e 75 6c 
   d  o  l  o  r  e     e  u     f  u  g  i  a  t     n  u  l  
6c 61 20 70 61 72 69 61 74 75 72 2e 20 45 78 63 65 70 74 65 75 
l  a     p  a  r  i  a  t  u  r  .     E  x  c  e  p  t  e  u  
72 20 73 69 6e 74 20 6f 63 63 61 65 63 61 74 20 63 75 70 69 64 
r     s  i  n  t     o  c  c  a  e  c  a  t     c  u  p  i  d  
61 74 61 74 20 6e 6f 6e 20 70 72 6f 69 64 65 6e 74 2c 20 73 75 
a  t  a  t     n  o  n     p  r  o  i  d  e  n  t  ,     s  u  
6e 74 20 69 6e 20 63 75 6c 70 61 20 71 75 69 20 6f 66 66 69 63 
n  t     i  n     c  u  l  p  a     q  u  i     o  f  f  i  c  
69 61 20 64 65 73 65 72 75 6e 74 20 6d 6f 6c 6c 69 74 20 61 6e 
i  a     d  e  s  e  r  u  n  t     m  o  l  l  i  t     a  n  
69 6d 20 69 64 20 65 73 74 20 6c 61 62 6f 72 75 6d 2e 20 4c 6f 
i  m     i  d     e  s  t     l  a  b  o  r  u  m  .     L  o  
72 65 6d 2e 00 62 66 32 5f 73 70 6f 6e 73 6f 72 6c 6f 00 
r  e  m  .     b  f  2  _  s  p  o  n  s  o  r  l  o     

Q#0 hostname = Test McTestface [OpenSpy]
Q#0 gamename = battlefield2
Q#0 gamever = 1.5.3153-802.0
Q#0 mapname = Strike At Karkand
Q#0 gametype = gpm_cq
Q#0 gamevariant = bf2
Q#0 numplayers = 0
Q#0 maxplayers = 64
Q#0 gamemode = openplaying
Q#0 password = 0
Q#0 timelimit = 0
Q#0 roundtime = 3
Q#0 hostport = 16569
Q#0 bf2_dedicated = 1
Q#0 bf2_ranked = 0
Q#0 bf2_anticheat = 0
Q#0 bf2_os = linux-64
Q#0 bf2_autorec = 0
Q#0 bf2_d_idx = http://
Q#0 bf2_d_dl = http://
Q#0 bf2_voip = 1
Q#0 bf2_autobalanced = 0
Q#0 bf2_friendlyfire = 1
Q#0 bf2_tkmode = Punish
Q#0 bf2_startdelay = 15
Q#0 bf2_spawntime = 15.000000
Q#0 bf2_sponsortext = Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem.
Q#0 bf2_sponsorlo = 
Q#0 Parsing packet #1
Q#0 Buffer length: 416 bytes
62 66 32 5f 73 70 6f 6e 73 6f 72 6c 6f 67 6f 5f 75 72 6c 00 00 
b  f  2  _  s  p  o  n  s  o  r  l  o  g  o  _  u  r  l        
62 66 32 5f 63 6f 6d 6d 75 6e 69 74 79 6c 6f 67 6f 5f 75 72 6c 
b  f  2  _  c  o  m  m  u  n  i  t  y  l  o  g  o  _  u  r  l  
00 00 62 66 32 5f 73 63 6f 72 65 6c 69 6d 69 74 00 30 00 62 66 
      b  f  2  _  s  c  o  r  e  l  i  m  i  t     0     b  f  
32 5f 74 69 63 6b 65 74 72 61 74 69 6f 00 31 30 30 00 62 66 32 
2  _  t  i  c  k  e  t  r  a  t  i  o     1  0  0     b  f  2  
5f 74 65 61 6d 72 61 74 69 6f 00 31 30 30 2e 30 30 30 30 30 30 
_  t  e  a  m  r  a  t  i  o     1  0  0  .  0  0  0  0  0  0  
00 62 66 32 5f 74 65 61 6d 31 00 4d 45 43 00 62 66 32 5f 74 65 
   b  f  2  _  t  e  a  m  1     M  E  C     b  f  2  _  t  e  
61 6d 32 00 55 53 00 62 66 32 5f 62 6f 74 73 00 30 00 62 66 32 
a  m  2     U  S     b  f  2  _  b  o  t  s     0     b  f  2  
5f 70 75 72 65 00 31 00 62 66 32 5f 6d 61 70 73 69 7a 65 00 33 
_  p  u  r  e     1     b  f  2  _  m  a  p  s  i  z  e     3  
32 00 62 66 32 5f 67 6c 6f 62 61 6c 75 6e 6c 6f 63 6b 73 00 31 
2     b  f  2  _  g  l  o  b  a  l  u  n  l  o  c  k  s     1  
00 62 66 32 5f 66 70 73 00 33 36 2e 30 30 30 30 30 30 00 62 66 
   b  f  2  _  f  p  s     3  6  .  0  0  0  0  0  0     b  f  
32 5f 70 6c 61 73 6d 61 00 31 00 62 66 32 5f 72 65 73 65 72 76 
2  _  p  l  a  s  m  a     1     b  f  2  _  r  e  s  e  r  v  
65 64 73 6c 6f 74 73 00 30 00 62 66 32 5f 63 6f 6f 70 62 6f 74 
e  d  s  l  o  t  s     0     b  f  2  _  c  o  o  p  b  o  t  
72 61 74 69 6f 00 00 62 66 32 5f 63 6f 6f 70 62 6f 74 63 6f 75 
r  a  t  i  o        b  f  2  _  c  o  o  p  b  o  t  c  o  u  
6e 74 00 00 62 66 32 5f 63 6f 6f 70 62 6f 74 64 69 66 66 00 00 
n  t        b  f  2  _  c  o  o  p  b  o  t  d  i  f  f        
62 66 32 5f 6e 6f 76 65 68 69 63 6c 65 73 00 30 00 00 01 70 6c 
b  f  2  _  n  o  v  e  h  i  c  l  e  s     0           p  l  
61 79 65 72 5f 00 00 00 73 63 6f 72 65 5f 00 00 00 70 69 6e 67 
a  y  e  r  _           s  c  o  r  e  _           p  i  n  g  
5f 00 00 00 74 65 61 6d 5f 00 00 00 64 65 61 74 68 73 5f 00 00 
_           t  e  a  m  _           d  e  a  t  h  s  _        
00 70 69 64 5f 00 00 00 73 6b 69 6c 6c 5f 00 00 00 41 49 42 6f 
   p  i  d  _           s  k  i  l  l  _           A  I  B  o  
74 5f 00 00 00 00 02 74 65 61 6d 5f 74 00 00 4d 45 43 00 55 53 
t  _                 t  e  a  m  _  t        M  E  C     U  S  
00 00 73 63 6f 72 65 5f 74 00 00 30 00 30 00 00 00 
      s  c  o  r  e  _  t        0     0           

Q#0 Parsing new field: itemType=sponsorlogo fieldName=bf2 startOffset=0
Q#0 * bf2_communitylogo_url
Q#0 Parsing new field: itemType=scorelimit fieldName=bf2 startOffset=48
Q#0 Parsing new field: itemType=ticketratio fieldName=bf2 startOffset=49
Q#0 * 00
Q#0 * bf2_teamratio
Q#0 * 100.000000
Q#0 * bf2_team1
Q#0 * MEC
Q#0 * bf2_team2
Q#0 * US
Q#0 * bf2_bots
Q#0 * 0
Q#0 * bf2_pure
Q#0 * 1
Q#0 * bf2_mapsize
Q#0 * 32
Q#0 * bf2_globalunlocks
Q#0 * 1
Q#0 * bf2_fps
Q#0 * 36.000000
Q#0 * bf2_plasma
Q#0 * 1
Q#0 * bf2_reservedslots
Q#0 * 0
Q#0 * bf2_coopbotratio
Q#0 Parsing new field: itemType=coopbotcount fieldName=bf2 startOffset=0
Q#0 * bf2_coopbotdiff
Q#0 Parsing new field: itemType=novehicles fieldName=bf2 startOffset=48
Q#0 Parsing new field: itemType= fieldName=player startOffset=0
Q#0 Parsing new field: itemType= fieldName=score startOffset=0
Q#0 Parsing new field: itemType= fieldName=ping startOffset=0
Q#0 Parsing new field: itemType= fieldName=team startOffset=0
Q#0 Parsing new field: itemType= fieldName=deaths startOffset=0
Q#0 Parsing new field: itemType= fieldName=pid startOffset=0
Q#0 Parsing new field: itemType= fieldName=skill startOffset=0
Q#0 Parsing new field: itemType= fieldName=AIBot startOffset=0
Q#0 Parsing new field: itemType=t fieldName=team startOffset=0
Q#0 * MEC
Q#0 * US
Q#0 Parsing new field: itemType=t fieldName=score startOffset=0
Q#0 * 0
Q#0 * 0
Q#0 Size of players array: 0
Q#0 Size of bots array: 0
Q#0 Query was successful

Additional context
GameDig wrongfully assumes that server info key-value pairs can only be found in the first packet.

// Parse raw server key/values
if (iPacket === 0) {
while (!reader.done()) {
const key = reader.string()
if (!key) break
let value = reader.string()
while (value.match(/^p[0-9]+$/)) {
// fix a weird ut3 bug where some keys don't have values
value = reader.string()
}
state.raw[key] = value
this.logger.debug(key + ' = ' + value)
}
}

Any following packet is parsed differently. In the query output above, you can see how the attributes from the second packet get parsed as player/team info (which get's messed up completely).

Details
{
  "playerTeamInfo": {
    "sponsorlogo": [
      {
        "bf2": "bf2_communitylogo_url"
      }
    ],
    "scorelimit": [],
    "ticketratio": [
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {
        "bf2": "00"
      },
      {
        "bf2": "bf2_teamratio"
      },
      {
        "bf2": "100.000000"
      },
      {
        "bf2": "bf2_team1"
      },
      {
        "bf2": "MEC"
      },
      {
        "bf2": "bf2_team2"
      },
      {
        "bf2": "US"
      },
      {
        "bf2": "bf2_bots"
      },
      {
        "bf2": "0"
      },
      {
        "bf2": "bf2_pure"
      },
      {
        "bf2": "1"
      },
      {
        "bf2": "bf2_mapsize"
      },
      {
        "bf2": "32"
      },
      {
        "bf2": "bf2_globalunlocks"
      },
      {
        "bf2": "1"
      },
      {
        "bf2": "bf2_fps"
      },
      {
        "bf2": "35.000000"
      },
      {
        "bf2": "bf2_plasma"
      },
      {
        "bf2": "1"
      },
      {
        "bf2": "bf2_reservedslots"
      },
      {
        "bf2": "0"
      },
      {
        "bf2": "bf2_coopbotratio"
      }
    ],
    "coopbotcount": [
      {
        "bf2": "bf2_coopbotdiff"
      }
    ],
    "novehicles": [],
    "": [],
    "t": [
      {
        "team": "MEC",
        "score": "0"
      },
      {
        "team": "US",
        "score": "0"
      }
    ]
  }
}

The above query output also displays another issue: At least for Battlefield 2 servers, the server does not properly split the data across packets. The first packet ends with a partial key (bf2_sponsorlo). In the following packet, the server then sends the complete key-value pair. In GameQ, this is cleaned up before parsing (source). Might be a topic for a separate issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions