Documentation ¶
Index ¶
- func RegisterRoutes(r *gin.RouterGroup, service *MatchesService, memoryStore *persist.MemoryStore)
- type AggregatedPlayerStats
- type FilterMatchesRequest
- type FilterMatchesResponse
- type GetLiveMatchesResponse
- type GetMatchAggregatedStatsResponse
- type GetMatchLiveDataResponse
- type GetMatchLiveDataResponsePlayer
- type GetMatchPlayerStatsResponse
- type GetMatchWaveStatsResponse
- type GetMatchWavesResponse
- type Match
- type MatchMap
- type MatchPlayer
- type MatchServer
- type MatchSession
- type MatchWave
- type MatchWavePlayer
- type MatchWavePlayerStats
- type MatchesService
- func (s *MatchesService) Filter(req FilterMatchesRequest) (*FilterMatchesResponse, error)
- func (s *MatchesService) GetById(id int) (*Match, error)
- func (s *MatchesService) GetLastServerMatch(id int) (*Match, error)
- func (s *MatchesService) GetMatchAggregatedStats(sessionId int) (*GetMatchAggregatedStatsResponse, error)
- func (s *MatchesService) GetMatchLiveData(sessionId int) (*GetMatchLiveDataResponse, error)
- func (s *MatchesService) GetMatchPlayerStats(sessionId, userId int) (*GetMatchPlayerStatsResponse, error)
- func (s *MatchesService) GetMatchWaves(sessionId int) (*GetMatchWavesResponse, error)
- func (s *MatchesService) Inject(userService *users.UserService, sessionService *session.SessionService, ...)
- type PlayerWaveStats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterRoutes ¶
func RegisterRoutes( r *gin.RouterGroup, service *MatchesService, memoryStore *persist.MemoryStore, )
Types ¶
type AggregatedPlayerStats ¶
type AggregatedPlayerStats struct { UserId int `json:"user_id"` // in seconds PlayTime int `json:"play_time"` ShotsFired int `json:"shots_fired"` ShotsHit int `json:"shots_hit"` ShotsHS int `json:"shots_hs"` DoshEarned int `json:"dosh_earned"` HealsGiven int `json:"heals_given"` HealsReceived int `json:"heals_recv"` DamageDealt int `json:"damage_dealt"` DamageTaken int `json:"damage_taken"` ZedTimeCount int `json:"zedtime_count"` ZedTimeLength float32 `json:"zedtime_length"` Kills int `json:"kills"` LargeKills int `json:"large_kills"` HuskRages int `json:"husk_r"` }
type FilterMatchesRequest ¶
type FilterMatchesRequest struct { ServerId []int `json:"server_id"` MapId []int `json:"map_id"` Status []models.GameStatus `json:"status"` Mode *models.GameMode `json:"mode"` Length *models.GameLength `json:"length"` Difficulty *models.GameDifficulty `json:"diff"` IncludeServer *bool `json:"include_server"` IncludeMap *bool `json:"include_map"` IncludeGameData *bool `json:"include_game_data"` IncludeCDData *bool `json:"include_cd_data"` IncludePlayers *bool `json:"include_players"` ReverseOrder *bool `json:"reverse_order"` Pager models.PaginationRequest `json:"pager"` }
type FilterMatchesResponse ¶
type FilterMatchesResponse struct { Items []*Match `json:"items"` Metadata models.PaginationResponse `json:"metadata"` }
type GetLiveMatchesResponse ¶
type GetLiveMatchesResponse struct {
Items []Match `json:"items"`
}
type GetMatchAggregatedStatsResponse ¶
type GetMatchAggregatedStatsResponse struct {
Players []AggregatedPlayerStats `json:"players"`
}
type GetMatchLiveDataResponse ¶
type GetMatchLiveDataResponse struct { Status models.GameStatus `json:"status"` GameData models.GameData `json:"game_data"` CDData *models.CDGameData `json:"cd_data"` Players []*GetMatchLiveDataResponsePlayer `json:"players"` Spectators []*GetMatchLiveDataResponsePlayer `json:"spectators"` }
type GetMatchLiveDataResponsePlayer ¶
type GetMatchLiveDataResponsePlayer struct { Id int `json:"id"` Name string `json:"name"` ProfileUrl *string `json:"profile_url"` Avatar *string `json:"avatar"` Perk models.Perk `json:"perk"` Level int `json:"level"` Prestige int `json:"prestige"` Health int `json:"health"` Armor int `json:"armor"` AuthId string `json:"-"` AuthType models.AuthType `json:"-"` IsSpectator bool `json:"-"` }
type GetMatchPlayerStatsResponse ¶
type GetMatchPlayerStatsResponse struct {
Waves []PlayerWaveStats `json:"waves"`
}
type GetMatchWaveStatsResponse ¶
type GetMatchWaveStatsResponse struct {
Players []PlayerWaveStats `json:"players"`
}
type GetMatchWavesResponse ¶
type GetMatchWavesResponse struct { Waves []*MatchWave `json:"waves"` Users []*models.UserProfile `json:"users"` }
type Match ¶
type Match struct { Session MatchSession `json:"session"` Map *MatchMap `json:"map"` Server *MatchServer `json:"server"` GameData *models.GameData `json:"game_data"` CDData *models.CDGameData `json:"cd_data"` Players []*MatchPlayer `json:"players"` Spectators []*MatchPlayer `json:"spectators"` }
type MatchPlayer ¶
type MatchServer ¶
type MatchSession ¶
type MatchSession struct { SessionId int `json:"session_id"` ServerId int `json:"server_id"` MapId int `json:"map_id"` Mode models.GameMode `json:"mode"` Length int `json:"length"` Difficulty models.GameDifficulty `json:"diff"` Status models.GameStatus `json:"status"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` StartedAt *time.Time `json:"started_at"` CompletedAt *time.Time `json:"completed_at"` }
type MatchWavePlayer ¶
type MatchWavePlayerStats ¶
type MatchWavePlayerStats struct { ShotsFired int `json:"shots_fired"` ShotsHit int `json:"shots_hit"` ShotsHS int `json:"shots_hs"` DoshEarned int `json:"dosh_earned"` HealsGiven int `json:"heals_given"` HealsReceived int `json:"heals_recv"` DamageDealt int `json:"damage_dealt"` DamageTaken int `json:"damage_taken"` ZedTimeCount int `json:"zedtime_count"` ZedTimeLength float32 `json:"zedtime_length"` Kills stats.ZedCounter `json:"kills"` HuskBackpackKills int `json:"husk_b"` HuskRages int `json:"husk_r"` }
type MatchesService ¶
type MatchesService struct {
// contains filtered or unexported fields
}
func NewMatchesService ¶
func NewMatchesService(db *sql.DB) *MatchesService
func (*MatchesService) Filter ¶
func (s *MatchesService) Filter(req FilterMatchesRequest) (*FilterMatchesResponse, error)
func (*MatchesService) GetLastServerMatch ¶
func (s *MatchesService) GetLastServerMatch(id int) (*Match, error)
func (*MatchesService) GetMatchAggregatedStats ¶
func (s *MatchesService) GetMatchAggregatedStats(sessionId int) (*GetMatchAggregatedStatsResponse, error)
func (*MatchesService) GetMatchLiveData ¶
func (s *MatchesService) GetMatchLiveData(sessionId int) (*GetMatchLiveDataResponse, error)
Deprecated, needs rework
func (*MatchesService) GetMatchPlayerStats ¶
func (s *MatchesService) GetMatchPlayerStats(sessionId, userId int) (*GetMatchPlayerStatsResponse, error)
func (*MatchesService) GetMatchWaves ¶
func (s *MatchesService) GetMatchWaves(sessionId int) (*GetMatchWavesResponse, error)
func (*MatchesService) Inject ¶
func (s *MatchesService) Inject( userService *users.UserService, sessionService *session.SessionService, mapsService *maps.MapsService, serverService *server.ServerService, steamApiService *steamapi.SteamApiUserService, )
type PlayerWaveStats ¶
type PlayerWaveStats struct { PlayerStatsId int `json:"player_stats_id"` ShotsFired int `json:"shots_fired"` ShotsHit int `json:"shots_hit"` ShotsHS int `json:"shots_hs"` DoshEarned int `json:"dosh_earned"` HealsGiven int `json:"heals_given"` HealsReceived int `json:"heals_recv"` DamageDealt int `json:"damage_dealt"` DamageTaken int `json:"damage_taken"` ZedTimeCount int `json:"zedtime_count"` ZedTimeLength float32 `json:"zedtime_length"` Kills stats.ZedCounter `json:"kills"` HuskBackpackKills int `json:"husk_b"` HuskRages int `json:"husk_r"` }
Click to show internal directories.
Click to hide internal directories.