-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtelemetry_objects.go
More file actions
145 lines (132 loc) · 5.65 KB
/
telemetry_objects.go
File metadata and controls
145 lines (132 loc) · 5.65 KB
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
package pubg
type telemetryObjectBlueZoneCustomOptions struct {
PhaseNum int `json:"phaseNum"`
StartDelay int `json:"startDelay"`
WarningDuration int `json:"warningDuration"`
ReleaseDuration int `json:"releaseDuration"`
PoisonGasDamagePerSecond float64 `json:"poisonGasDamagePerSecond"`
RadiusRate float64 `json:"radiusRate"`
SpreadRatio float64 `json:"spreadRatio"`
LandRatio float64 `json:"landRatio"`
CircleAlgorithm int `json:"circleAlgorithm"`
}
type telemetryObjectCharacter struct {
Name string `json:"name"`
TeamID int `json:"teamId"`
Health float64 `json:"health"`
Location telemetryObjectLocation `json:"location"`
Ranking int `json:"ranking"`
AccountID string `json:"accountId"`
IsInBlueZone bool `json:"isInBlueZone"`
IsInRedZone bool `json:"isInRedZone"`
Zone []string `json:"zone"`
}
type telemetryObjectCharacterWrapper struct {
Character telemetryObjectCharacter `json:"character"`
PrimaryWeaponFirst string `json:"primaryWeaponFirst"`
PrimaryWeaponSecond string `json:"primaryWeaponSecond"`
SecondaryWeapon string `json:"secondaryWeapon"`
SpawnKitIndex int `json:"spawnKitIndex"`
}
// IsGame represents the phase of the game defined by the status of bluezone and safezone
// isGame = 0 -> Before lift off
//
// isGame = 0.1 -> On airplane
//
// isGame = 0.5 -> When there’s no ‘zone’ on map(before game starts)
//
// isGame = 1.0 -> First safezone and bluezone appear
//
// isGame = 1.5 -> First bluezone shrinks
//
// isGame = 2.0 -> Second bluezone appears
//
// isGame = 2.5 -> Second bluezone shrinks
//
// …
type telemetryObjectCommon struct {
IsGame float64 `json:"isGame"`
}
type telemetryObjectDamageInfo struct {
DamageReason string `json:"damageReason"`
DamageTypeCategory string `json:"damageTypeCategory"`
DamageCauserName string `json:"damageCauserName"`
AdditionalInfo []string `json:"additionalInfo"`
Distance float64 `json:"distance"`
IsThroughPenetrableWall bool `json:"isThroughPenetrableWall"`
}
type telemetryObjectGameResult struct {
Rank int `json:"rank"`
GameResult string `json:"gameResult"`
TeamID int `json:"teamId"`
Stats telemetryObjectStats `json:"stats"`
AccountID string `json:"accountId"`
}
// Shows winning players only
type telemetryObjectGameResultOnFinished struct {
Results []telemetryObjectGameResult `json:"results"`
}
type telemetryObjectGameState struct {
ElapsedTime int `json:"elapsedTime"`
NumAliveTeams int `json:"numAliveTeams"`
NumJoinPlayers int `json:"numJoinPlayers"`
NumStartPlayers int `json:"numStartPlayers"`
NumAlivePlayers int `json:"numAlivePlayers"`
SafetyZonePosition telemetryObjectLocation `json:"safetyZonePosition"`
SafetyZoneRadius float64 `json:"safetyZoneRadius"`
PoisonGasWarningPosition telemetryObjectLocation `json:"poisonGasWarningPosition"`
PoisonGasWarningRadius float64 `json:"poisonGasWarningRadius"`
RedZonePosition telemetryObjectLocation `json:"redZonePosition"`
RedZoneRadius float64 `json:"redZoneRadius"`
BlackZonePosition telemetryObjectLocation `json:"blackZonePosition"`
BlackZoneRadius float64 `json:"blackZoneRadius"`
}
type telemetryObjectItem struct {
ItemID string `json:"itemId"`
StackCount int `json:"stackCount"`
Category string `json:"category"`
SubCategory string `json:"subCategory"`
AttachedItems []string `json:"attachedItems"`
}
// ItemPackage structure.
type ItemPackage struct {
ItemPackageID string `json:"itemPackageId"`
Location telemetryObjectLocation `json:"location"`
Items []telemetryObjectItem `json:"items"`
}
//Location values are measured in centimeters. (0,0) is at the top-left of each map.
//
//The range for the X and Y axes is 0 - 816,000 for Erangel and Miramar.
//
//The range for the X and Y axes is 0 - 408,000 for Sanhok.
//
//The range for the X and Y axes is 0 - 612,000 for Vikendi.
//
//The range for the X and Y axes is 0 - 204,000 for Range.
type telemetryObjectLocation struct {
X float64 `json:"x"`
Y float64 `json:"y"`
Z float64 `json:"z"`
}
type telemetryObjectStats struct {
KillCount int `json:"killCount"`
DistanceOnFoot float64 `json:"distanceOnFoot"`
DistanceOnSwim float64 `json:"distanceOnSwim"`
DistanceOnVehicle float64 `json:"distanceOnVehicle"`
DistanceOnParachute float64 `json:"distanceOnParachute"`
DistanceOnFreefall float64 `json:"distanceOnFreefall"`
}
type telemetryObjectVehicle struct {
VehicleType string `json:"vehicleType"`
VehicleID string `json:"vehicleId"`
VehicleUniqueID int `json:"vehicleUniqueId"`
HealthPercent float64 `json:"healthPercent"`
FeulPercent float64 `json:"feulPercent"`
AltitudeAbs float64 `json:"altitudeAbs"`
AltitudeRel float64 `json:"altitudeRel"`
Velocity float64 `json:"velocity"`
SeatIndex int `json:"seatIndex"`
IsWheelsInAir bool `json:"isWheelsInAir"`
IsInWaterVolume bool `json:"isInWaterVolume"`
IsEngineOn bool `json:"isEngineOn"`
}