-
Notifications
You must be signed in to change notification settings - Fork 3
/
gt_packet_definition.py
101 lines (99 loc) · 3.93 KB
/
gt_packet_definition.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
from struct import unpack
class GTDataPacket:
def __init__(self, data):
## Format string that allows unpack to process the data bytestream:
gt_format = '<ifffffffffffffffccccccccffffffffffiiiiihhhhhhbbbbffffffffffffffffbbbbbbbbfffbbbbbbbbbbbbbbbbi'
(self.magic, #int32
self.position_x, #single
self.position_y, #single
self.position_z, #single
self.velocity_x, #single
self.velocity_y, #single
self.velocity_z, #single
self.pitch, #single
self.yaw, #single
self.roll, #single
self.relative_orientation_north, #single
self.acceleration_x, #single
self.acceleration_y, #single
self.acceleration_z, #single
self.body_height, #single
self.rpm, #single
self.iv1, #char
self.iv2, #char
self.iv3, #char
self.iv4, #char
self.iv5, #char
self.iv6, #char
self.iv7, #char
self.iv8, #char
self.unknown_0x48, #single
self.speed, #single
self.turbo_boost, #single
self.oil_pressure_bar, #single
self.water_temperature, #single
self.oil_temperature, #single
self.tire_surface_temperature_FL, #single
self.tire_surface_temperature_FR, #single
self.tire_surface_temperature_RL, #single
self.tire_surface_temperature_RR, #single
self.total_time_ticks, #int32
self.current_lap, #int32
self.best_lap_time, #int32
self.last_lap_time, #int32
self.day_progression_ms, #int32
self.pre_race_start_position, #int16
self.num_cars_pre_race, #int16
self.min_alert_rpm, #int16
self.max_alert_rpm, #int16
self.calculated_max_speed, #int16
self.flags, #int16
self.bits, #byte
self.throttle, #byte
self.brake, #byte
self.unknown_byte9, #byte
self.tire_FL_unknown0x94_1, #single
self.tire_FR_unknown0x94_2, #single
self.tire_RL_unknown0x94_3, #single
self.tire_RR_unknown0x94_4, #single
self.tire_FL_accel, #single
self.tire_FR_accel, #single
self.tire_RL_accel, #single
self.tire_RR_accel, #single
self.tire_FL_tire_radius, #single
self.tire_FR_tire_radius, #single
self.tire_RL_tire_radius, #single
self.tire_RR_tire_radius, #single
self.tire_FL_unknown0xC4_1, #single
self.tire_FR_unknown0xC4_2, #single
self.tire_RL_unknown0xC4_3, #single
self.tire_RR_unknown0xC4_4, #single
self.unknown_byte9, #byte
self.unknown_byte10, #byte
self.unknown_byte11, #byte
self.unknown_byte12, #byte
self.unknown_byte13, #byte
self.unknown_byte14, #byte
self.unknown_byte15, #byte
self.unknown_byte16, #byte
self.clutch_pedal, #single
self.clutch_engagement, #single
self.rpm_clutch_gearbox, #single
self.unknown_byte17, #byte
self.unknown_byte18, #byte
self.unknown_byte19, #byte
self.unknown_byte20, #byte
self.unknown_byte21, #byte
self.unknown_byte22, #byte
self.unknown_byte23, #byte
self.unknown_byte24, #byte
self.unknown_byte25, #byte
self.unknown_byte26, #byte
self.unknown_byte27, #byte
self.unknown_byte28, #byte
self.unknown_byte29, #byte
self.unknown_byte30, #byte
self.unknown_byte31, #byte
self.unknown_byte32, #byte
self.car_code, #int32
) = unpack(gt_format, data)