Fix connless data offset

This commit is contained in:
ChillerDragon 2023-05-10 11:43:19 +02:00
parent 994dde6a1b
commit 04945c770a
2 changed files with 10 additions and 9 deletions

View file

@ -107,19 +107,20 @@ def test_lis2_connless7():
msg: MsgList = packet.messages[0]
assert len(msg.servers) == 74 # no idea if this is correct
assert len(msg.servers) == 75 # no idea if this is correct
server: MastersrvAddr
# TODO: those ports seem wrong for sure
server = msg.servers[0]
assert server.port == 27136
assert server.port == 8298
server = msg.servers[1]
assert server.port == 27648
assert server.port == 8300
server = msg.servers[2]
assert server.port == 28416
assert server.port == 8303
server = msg.servers[3]
assert server.port == 28672
assert server.port == 8304
server = msg.servers[4]
assert server.port == 28928
assert server.port == 8305
# ..
server = msg.servers[74]
assert server.port == 8346

View file

@ -266,7 +266,7 @@ class PacketParser():
pck.messages.append(ctrl_msg)
return pck
if pck.header.flags.connless:
connless_msg: ConnlessMessage = match_connless7(data[9:17], data[18:])
connless_msg: ConnlessMessage = match_connless7(data[9:17], data[17:])
pck.messages.append(connless_msg)
return pck
if pck.header.flags.compression: