对于我正在努力解决的问题,标题可能非常不正确。
我试图以我理解的方式解释我从赛车游戏中收到的数据包,但老实说,我真的不知道我在看什么,或者搜索什么来理解它。我在这里收到的数据包信息: https ://forums.codemasters.com/topic/54423-f1%C2%AE-2020-udp-specification/?tab=comments#comment-532560
我正在使用 python 来打印数据包,这是输出的一个片段,我不明白如何解释。
收到消息:b'\xe4\x07\x01\x03\x01\x07O\x90.\xea\xc2!7\x16\xa5\xbb\x02C\xda\n\x00\x00\x00\xff\x01\x00 \x03:\x00\x00\x00 A\x00\x00\xdcB\xb5+\xc1@\xc82\xcc\x10\t\x00\xd9\x00\x00\x00\x00\x00\x12\x10\x00\ x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00$tJ\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ x00\x00\x00\x01
我对编码很陌生,不确定下一步是什么,所以朝着正确的方向轻推将有助于加载,谢谢。
这是python代码:
import socket
UDP_IP = "127.0.0.1"
UDP_PORT = 20777
sock = socket.socket(socket.AF_INET, # Internet
socket.SOCK_DGRAM) # UDP
sock.bind((UDP_IP, UDP_PORT))
while True:
data, addr = sock.recvfrom(4096)
print ("received message:", data)