added detailed parsing of player hurt events

This commit is contained in:
2021-10-11 21:37:10 +02:00
parent 3ff65bc5d7
commit 4b7851da83
28 changed files with 14660 additions and 978 deletions

View File

@@ -19,63 +19,48 @@ func (Stats) Fields() []ent.Field {
field.Int("deaths"),
field.Int("assists"),
field.Int("headshot"),
field.Int("mvp"),
field.Uint("mvp"),
field.Int("score"),
field.JSON("extended", struct {
MultiKills struct {
Duo int `json:"duo,omitempty"`
Triple int `json:"triple,omitempty"`
Quad int `json:"quad,omitempty"`
Pent int `json:"pent,omitempty"`
} `json:"multi_kills,omitempty"`
Dmg struct {
Enemy int `json:"enemy,omitempty"`
Team int `json:"team,omitempty"`
UD struct {
HE int `json:"he,omitempty"`
Flames int `json:"flames,omitempty"`
Flash int `json:"flash,omitempty"`
Decoy int `json:"decoy,omitempty"`
Smoke int `json:"smoke,omitempty"`
} `json:"ud,omitempty"`
HitGroup struct {
Head int `json:"head,omitempty"`
Chest int `json:"chest,omitempty"`
Stomach int `json:"stomach,omitempty"`
LeftArm int `json:"left_arm,omitempty"`
RightArm int `json:"right_arm,omitempty"`
LeftLeg int `json:"left_leg,omitempty"`
RightLeg int `json:"right_leg,omitempty"`
Gear int `json:"gear,omitempty"`
} `json:"hit_group,omitempty"`
} `json:"dmg,omitempty"`
Crosshair string `json:"crosshair,omitempty"`
Color string `json:"color,omitempty"`
KAST int `json:"kast,omitempty"`
Rank struct {
Old int `json:"old,omitempty"`
New int `json:"new,omitempty"`
} `json:"rank,omitempty"`
Flash struct {
Duration struct {
Self float32 `json:"self,omitempty"`
Team float32 `json:"team,omitempty"`
Enemy float32 `json:"enemy,omitempty"`
} `json:"duration,omitempty"`
Total struct {
Team int `json:"team,omitempty"`
Enemy int `json:"enemy,omitempty"`
Self int `json:"self,omitempty"`
} `json:"total,omitempty"`
} `json:"flash,omitempty"`
}{}).Optional(),
field.Int("rank_new").Optional(),
field.Int("rank_old").Optional(),
field.Uint("mk_2").Optional(),
field.Uint("mk_3").Optional(),
field.Uint("mk_4").Optional(),
field.Uint("mk_5").Optional(),
field.Uint("dmg_enemy").Optional(),
field.Uint("dmg_team").Optional(),
field.Uint("ud_he").Optional(),
field.Uint("ud_flames").Optional(),
field.Uint("ud_flash").Optional(),
field.Uint("ud_decoy").Optional(),
field.Uint("ud_smoke").Optional(),
field.Uint("hit_group_head").Optional(),
field.Uint("hit_group_chest").Optional(),
field.Uint("hit_group_stomach").Optional(),
field.Uint("hit_group_left_arm").Optional(),
field.Uint("hit_group_right_arm").Optional(),
field.Uint("hit_group_left_leg").Optional(),
field.Uint("hit_group_right_leg").Optional(),
field.Uint("hit_group_gear").Optional(),
field.String("crosshair").Optional(),
field.Enum("color").Optional().Values("green", "yellow", "purple", "blue", "orange"),
field.Int("kast").Optional(),
field.Float32("flash_duration_self").Optional(),
field.Float32("flash_duration_team").Optional(),
field.Float32("flash_duration_enemy").Optional(),
field.Uint("flash_total_self").Optional(),
field.Uint("flash_total_team").Optional(),
field.Uint("flash_total_enemy").Optional(),
field.Uint64("match_stats").Optional(),
field.Uint64("player_stats").Optional(),
}
}
// Edges of the Stats.
func (Stats) Edges() []ent.Edge {
return []ent.Edge{
edge.From("matches", Match.Type).Ref("stats").Unique(),
edge.From("players", Player.Type).Ref("stats").Unique(),
edge.From("matches", Match.Type).Ref("stats").Unique().Field("match_stats"),
edge.From("players", Player.Type).Ref("stats").Unique().Field("player_stats"),
edge.To("weapon_stats", WeaponStats.Type),
}
}