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

@@ -57,9 +57,38 @@ var (
{Name: "deaths", Type: field.TypeInt},
{Name: "assists", Type: field.TypeInt},
{Name: "headshot", Type: field.TypeInt},
{Name: "mvp", Type: field.TypeInt},
{Name: "mvp", Type: field.TypeUint},
{Name: "score", Type: field.TypeInt},
{Name: "extended", Type: field.TypeJSON, Nullable: true},
{Name: "rank_new", Type: field.TypeInt, Nullable: true},
{Name: "rank_old", Type: field.TypeInt, Nullable: true},
{Name: "mk_2", Type: field.TypeUint, Nullable: true},
{Name: "mk_3", Type: field.TypeUint, Nullable: true},
{Name: "mk_4", Type: field.TypeUint, Nullable: true},
{Name: "mk_5", Type: field.TypeUint, Nullable: true},
{Name: "dmg_enemy", Type: field.TypeUint, Nullable: true},
{Name: "dmg_team", Type: field.TypeUint, Nullable: true},
{Name: "ud_he", Type: field.TypeUint, Nullable: true},
{Name: "ud_flames", Type: field.TypeUint, Nullable: true},
{Name: "ud_flash", Type: field.TypeUint, Nullable: true},
{Name: "ud_decoy", Type: field.TypeUint, Nullable: true},
{Name: "ud_smoke", Type: field.TypeUint, Nullable: true},
{Name: "hit_group_head", Type: field.TypeUint, Nullable: true},
{Name: "hit_group_chest", Type: field.TypeUint, Nullable: true},
{Name: "hit_group_stomach", Type: field.TypeUint, Nullable: true},
{Name: "hit_group_left_arm", Type: field.TypeUint, Nullable: true},
{Name: "hit_group_right_arm", Type: field.TypeUint, Nullable: true},
{Name: "hit_group_left_leg", Type: field.TypeUint, Nullable: true},
{Name: "hit_group_right_leg", Type: field.TypeUint, Nullable: true},
{Name: "hit_group_gear", Type: field.TypeUint, Nullable: true},
{Name: "crosshair", Type: field.TypeString, Nullable: true},
{Name: "color", Type: field.TypeEnum, Nullable: true, Enums: []string{"green", "yellow", "purple", "blue", "orange"}},
{Name: "kast", Type: field.TypeInt, Nullable: true},
{Name: "flash_duration_self", Type: field.TypeFloat32, Nullable: true},
{Name: "flash_duration_team", Type: field.TypeFloat32, Nullable: true},
{Name: "flash_duration_enemy", Type: field.TypeFloat32, Nullable: true},
{Name: "flash_total_self", Type: field.TypeUint, Nullable: true},
{Name: "flash_total_team", Type: field.TypeUint, Nullable: true},
{Name: "flash_total_enemy", Type: field.TypeUint, Nullable: true},
{Name: "match_stats", Type: field.TypeUint64, Nullable: true},
{Name: "player_stats", Type: field.TypeUint64, Nullable: true},
}
@@ -71,18 +100,41 @@ var (
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "stats_matches_stats",
Columns: []*schema.Column{StatsColumns[9]},
Columns: []*schema.Column{StatsColumns[38]},
RefColumns: []*schema.Column{MatchesColumns[0]},
OnDelete: schema.SetNull,
},
{
Symbol: "stats_players_stats",
Columns: []*schema.Column{StatsColumns[10]},
Columns: []*schema.Column{StatsColumns[39]},
RefColumns: []*schema.Column{PlayersColumns[0]},
OnDelete: schema.SetNull,
},
},
}
// WeaponStatsColumns holds the columns for the "weapon_stats" table.
WeaponStatsColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "victim", Type: field.TypeUint64},
{Name: "dmg", Type: field.TypeUint},
{Name: "eq_type", Type: field.TypeInt},
{Name: "hit_group", Type: field.TypeInt},
{Name: "stats_weapon_stats", Type: field.TypeInt, Nullable: true},
}
// WeaponStatsTable holds the schema information for the "weapon_stats" table.
WeaponStatsTable = &schema.Table{
Name: "weapon_stats",
Columns: WeaponStatsColumns,
PrimaryKey: []*schema.Column{WeaponStatsColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "weapon_stats_stats_weapon_stats",
Columns: []*schema.Column{WeaponStatsColumns[5]},
RefColumns: []*schema.Column{StatsColumns[0]},
OnDelete: schema.SetNull,
},
},
}
// PlayerMatchesColumns holds the columns for the "player_matches" table.
PlayerMatchesColumns = []*schema.Column{
{Name: "player_id", Type: field.TypeUint64},
@@ -113,6 +165,7 @@ var (
MatchesTable,
PlayersTable,
StatsTable,
WeaponStatsTable,
PlayerMatchesTable,
}
)
@@ -120,6 +173,7 @@ var (
func init() {
StatsTable.ForeignKeys[0].RefTable = MatchesTable
StatsTable.ForeignKeys[1].RefTable = PlayersTable
WeaponStatsTable.ForeignKeys[0].RefTable = StatsTable
PlayerMatchesTable.ForeignKeys[0].RefTable = PlayersTable
PlayerMatchesTable.ForeignKeys[1].RefTable = MatchesTable
}