get5loader
get5loader copied to clipboard
Support PUG match
// PugMatchData Struct for match table.
type PugMatchData struct {
// Original columns...
ID int `gorm:"primary_key;column:id" json:"id"`
UserID int `gorm:"column:user_id" json:"user_id"`
ServerID int `gorm:"column:server_id" json:"server_id"`
Winner sql.NullInt32 `gorm:"column:winner" json:"winner"`
Cancelled bool `gorm:"column:cancelled" json:"cancelled"`
StartTime sql.NullTime `gorm:"column:start_time" json:"start_time"`
EndTime sql.NullTime `gorm:"column:end_time" json:"end_time"`
MaxMaps int `gorm:"column:max_maps" json:"max_maps"`
Title string `gorm:"column:title" json:"title"`
SkipVeto bool `gorm:"column:skip_veto" json:"skip_veto"`
APIKey string `gorm:"column:api_key" json:"-"`
VetoMapPool string `gorm:"column:veto_mappool" json:"-"`
VetoMapPoolJSON []string `gorm:"-" json:"veto_mappool"`
Team1Score int `gorm:"column:team1_score" json:"team1_score"`
Team2Score int `gorm:"column:team2_score" json:"team2_score"`
Team1String string `gorm:"column:team1_string" json:"team1_string"`
Team2String string `gorm:"column:team2_string" json:"team2_string"`
Forfeit bool `gorm:"column:forfeit" json:"forfeit"`
PluginVersion string `gorm:"column:plugin_version" json:"-"`
// get5-web-go columns...
CvarsJSON map[string]string `gorm:"-" json:"cvars"`
Cvars string `gorm:"column:cvars" json:"-"`
SideType string `gorm:"column:side_type" json:"side_type"`
MapStats []MapStatsData `gorm:"ForeignKey:MatchID" json:"-"`
Server GameServerData `json:"-"`
}
also should implement features below:
- Match List(scrim only/pug only/both). Both list may need "JOIN" Query.
- Pug create endpoint
- API should identify request from SRCDS is for scrim or pug.
- Winner should be string("team1" | "team2" | "none" )
- I need to add migration file,and delete "is_pug" column in match table
NOTE. If implementing it with "JOIN" query goes ugly, I'll do "1st way" that is described at #127 . e.g. FACEIT uses "TEAM_{CAPTAIN-NAME}" team.