added spray patterns

This commit is contained in:
2021-10-31 08:40:02 +01:00
parent 268793f0e5
commit 978232dd0a
66 changed files with 16805 additions and 11903 deletions

View File

@@ -30,54 +30,8 @@ var (
Columns: MatchesColumns,
PrimaryKey: []*schema.Column{MatchesColumns[0]},
}
// PlayersColumns holds the columns for the "players" table.
PlayersColumns = []*schema.Column{
{Name: "id", Type: field.TypeUint64, Increment: true},
{Name: "name", Type: field.TypeString, Nullable: true},
{Name: "avatar", Type: field.TypeString, Nullable: true},
{Name: "vanity_url", Type: field.TypeString, Nullable: true},
{Name: "vanity_url_real", Type: field.TypeString, Nullable: true},
{Name: "vac_date", Type: field.TypeTime, Nullable: true},
{Name: "vac_count", Type: field.TypeInt, Nullable: true},
{Name: "game_ban_date", Type: field.TypeTime, Nullable: true},
{Name: "game_ban_count", Type: field.TypeInt, Nullable: true},
{Name: "steam_updated", Type: field.TypeTime},
{Name: "sharecode_updated", Type: field.TypeTime, Nullable: true},
{Name: "auth_code", Type: field.TypeString, Nullable: true},
{Name: "profile_created", Type: field.TypeTime, Nullable: true},
{Name: "oldest_sharecode_seen", Type: field.TypeString, Nullable: true},
}
// PlayersTable holds the schema information for the "players" table.
PlayersTable = &schema.Table{
Name: "players",
Columns: PlayersColumns,
PrimaryKey: []*schema.Column{PlayersColumns[0]},
}
// RoundStatsColumns holds the columns for the "round_stats" table.
RoundStatsColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "round", Type: field.TypeUint},
{Name: "bank", Type: field.TypeUint},
{Name: "equipment", Type: field.TypeUint},
{Name: "spent", Type: field.TypeUint},
{Name: "stats_round_stats", Type: field.TypeInt, Nullable: true},
}
// RoundStatsTable holds the schema information for the "round_stats" table.
RoundStatsTable = &schema.Table{
Name: "round_stats",
Columns: RoundStatsColumns,
PrimaryKey: []*schema.Column{RoundStatsColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "round_stats_stats_round_stats",
Columns: []*schema.Column{RoundStatsColumns[5]},
RefColumns: []*schema.Column{StatsColumns[0]},
OnDelete: schema.SetNull,
},
},
}
// StatsColumns holds the columns for the "stats" table.
StatsColumns = []*schema.Column{
// MatchPlayersColumns holds the columns for the "match_players" table.
MatchPlayersColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "team_id", Type: field.TypeInt},
{Name: "kills", Type: field.TypeInt},
@@ -108,48 +62,119 @@ var (
{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: "flash_assists", Type: field.TypeInt, Nullable: true},
{Name: "match_stats", Type: field.TypeUint64, Nullable: true},
{Name: "player_stats", Type: field.TypeUint64, Nullable: true},
}
// StatsTable holds the schema information for the "stats" table.
StatsTable = &schema.Table{
Name: "stats",
Columns: StatsColumns,
PrimaryKey: []*schema.Column{StatsColumns[0]},
// MatchPlayersTable holds the schema information for the "match_players" table.
MatchPlayersTable = &schema.Table{
Name: "match_players",
Columns: MatchPlayersColumns,
PrimaryKey: []*schema.Column{MatchPlayersColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "stats_matches_stats",
Columns: []*schema.Column{StatsColumns[30]},
Symbol: "match_players_matches_stats",
Columns: []*schema.Column{MatchPlayersColumns[31]},
RefColumns: []*schema.Column{MatchesColumns[0]},
OnDelete: schema.SetNull,
},
{
Symbol: "stats_players_stats",
Columns: []*schema.Column{StatsColumns[31]},
Symbol: "match_players_players_stats",
Columns: []*schema.Column{MatchPlayersColumns[32]},
RefColumns: []*schema.Column{PlayersColumns[0]},
OnDelete: schema.SetNull,
},
},
}
// WeaponStatsColumns holds the columns for the "weapon_stats" table.
WeaponStatsColumns = []*schema.Column{
// PlayersColumns holds the columns for the "players" table.
PlayersColumns = []*schema.Column{
{Name: "id", Type: field.TypeUint64, Increment: true},
{Name: "name", Type: field.TypeString, Nullable: true},
{Name: "avatar", Type: field.TypeString, Nullable: true},
{Name: "vanity_url", Type: field.TypeString, Nullable: true},
{Name: "vanity_url_real", Type: field.TypeString, Nullable: true},
{Name: "vac_date", Type: field.TypeTime, Nullable: true},
{Name: "vac_count", Type: field.TypeInt, Nullable: true},
{Name: "game_ban_date", Type: field.TypeTime, Nullable: true},
{Name: "game_ban_count", Type: field.TypeInt, Nullable: true},
{Name: "steam_updated", Type: field.TypeTime},
{Name: "sharecode_updated", Type: field.TypeTime, Nullable: true},
{Name: "auth_code", Type: field.TypeString, Nullable: true},
{Name: "profile_created", Type: field.TypeTime, Nullable: true},
{Name: "oldest_sharecode_seen", Type: field.TypeString, Nullable: true},
{Name: "wins", Type: field.TypeInt, Nullable: true},
{Name: "looses", Type: field.TypeInt, Nullable: true},
{Name: "ties", Type: field.TypeInt, Nullable: true},
}
// PlayersTable holds the schema information for the "players" table.
PlayersTable = &schema.Table{
Name: "players",
Columns: PlayersColumns,
PrimaryKey: []*schema.Column{PlayersColumns[0]},
}
// RoundStatsColumns holds the columns for the "round_stats" table.
RoundStatsColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "round", Type: field.TypeUint},
{Name: "bank", Type: field.TypeUint},
{Name: "equipment", Type: field.TypeUint},
{Name: "spent", Type: field.TypeUint},
{Name: "match_player_round_stats", Type: field.TypeInt, Nullable: true},
}
// RoundStatsTable holds the schema information for the "round_stats" table.
RoundStatsTable = &schema.Table{
Name: "round_stats",
Columns: RoundStatsColumns,
PrimaryKey: []*schema.Column{RoundStatsColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "round_stats_match_players_round_stats",
Columns: []*schema.Column{RoundStatsColumns[5]},
RefColumns: []*schema.Column{MatchPlayersColumns[0]},
OnDelete: schema.SetNull,
},
},
}
// SpraysColumns holds the columns for the "sprays" table.
SpraysColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "weapon", Type: field.TypeInt},
{Name: "spray", Type: field.TypeBytes},
{Name: "match_player_spray", Type: field.TypeInt, Nullable: true},
}
// SpraysTable holds the schema information for the "sprays" table.
SpraysTable = &schema.Table{
Name: "sprays",
Columns: SpraysColumns,
PrimaryKey: []*schema.Column{SpraysColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "sprays_match_players_spray",
Columns: []*schema.Column{SpraysColumns[3]},
RefColumns: []*schema.Column{MatchPlayersColumns[0]},
OnDelete: schema.SetNull,
},
},
}
// WeaponsColumns holds the columns for the "weapons" table.
WeaponsColumns = []*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},
{Name: "match_player_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]},
// WeaponsTable holds the schema information for the "weapons" table.
WeaponsTable = &schema.Table{
Name: "weapons",
Columns: WeaponsColumns,
PrimaryKey: []*schema.Column{WeaponsColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "weapon_stats_stats_weapon_stats",
Columns: []*schema.Column{WeaponStatsColumns[5]},
RefColumns: []*schema.Column{StatsColumns[0]},
Symbol: "weapons_match_players_weapon_stats",
Columns: []*schema.Column{WeaponsColumns[5]},
RefColumns: []*schema.Column{MatchPlayersColumns[0]},
OnDelete: schema.SetNull,
},
},
@@ -182,19 +207,21 @@ var (
// Tables holds all the tables in the schema.
Tables = []*schema.Table{
MatchesTable,
MatchPlayersTable,
PlayersTable,
RoundStatsTable,
StatsTable,
WeaponStatsTable,
SpraysTable,
WeaponsTable,
PlayerMatchesTable,
}
)
func init() {
RoundStatsTable.ForeignKeys[0].RefTable = StatsTable
StatsTable.ForeignKeys[0].RefTable = MatchesTable
StatsTable.ForeignKeys[1].RefTable = PlayersTable
WeaponStatsTable.ForeignKeys[0].RefTable = StatsTable
MatchPlayersTable.ForeignKeys[0].RefTable = MatchesTable
MatchPlayersTable.ForeignKeys[1].RefTable = PlayersTable
RoundStatsTable.ForeignKeys[0].RefTable = MatchPlayersTable
SpraysTable.ForeignKeys[0].RefTable = MatchPlayersTable
WeaponsTable.ForeignKeys[0].RefTable = MatchPlayersTable
PlayerMatchesTable.ForeignKeys[0].RefTable = PlayersTable
PlayerMatchesTable.ForeignKeys[1].RefTable = MatchesTable
}