mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-11 08:23:45 +00:00
feat(multiplayer): expose ranked season countdown
This commit is contained in:
+13
-8
@@ -931,13 +931,14 @@ func assignmentChangedEvent(view AssignmentView, now time.Time) ControlPlaneEven
|
||||
}
|
||||
|
||||
type rankedProfileResponse struct {
|
||||
Rating float64 `json:"rating"`
|
||||
RD float64 `json:"rd"`
|
||||
Volatility float64 `json:"volatility"`
|
||||
RankedGames int `json:"ranked_games"`
|
||||
Tier string `json:"tier"`
|
||||
Provisional bool `json:"provisional"`
|
||||
SeasonID string `json:"season_id,omitempty"`
|
||||
Rating float64 `json:"rating"`
|
||||
RD float64 `json:"rd"`
|
||||
Volatility float64 `json:"volatility"`
|
||||
RankedGames int `json:"ranked_games"`
|
||||
Tier string `json:"tier"`
|
||||
Provisional bool `json:"provisional"`
|
||||
SeasonID string `json:"season_id,omitempty"`
|
||||
SeasonEndsAt string `json:"season_ends_at,omitempty"`
|
||||
}
|
||||
|
||||
func (s *Service) profile(w http.ResponseWriter, r *http.Request) {
|
||||
@@ -1000,7 +1001,11 @@ func (s *Service) rankedProfile(w http.ResponseWriter, r *http.Request) {
|
||||
if seasonID == "" {
|
||||
seasonID = profile.LastSeasonID
|
||||
}
|
||||
writeJSON(w, http.StatusOK, rankedProfileResponse{Rating: profile.Value, RD: profile.RD, Volatility: profile.Volatility, RankedGames: profile.RankedGames, Tier: string(tier), Provisional: domain.RankedIsProvisional(profile), SeasonID: seasonID})
|
||||
seasonEndsAt := ""
|
||||
if profile.CurrentSeasonID != "" && !profile.CurrentSeasonEndsAt.IsZero() {
|
||||
seasonEndsAt = profile.CurrentSeasonEndsAt.UTC().Format(time.RFC3339)
|
||||
}
|
||||
writeJSON(w, http.StatusOK, rankedProfileResponse{Rating: profile.Value, RD: profile.RD, Volatility: profile.Volatility, RankedGames: profile.RankedGames, Tier: string(tier), Provisional: domain.RankedIsProvisional(profile), SeasonID: seasonID, SeasonEndsAt: seasonEndsAt})
|
||||
}
|
||||
|
||||
type probeRequest struct {
|
||||
|
||||
Reference in New Issue
Block a user