Busiest hours count players; fewer descriptions; no Verified badges
Busiest hours and the heatmap count the different players on T or CT in each hour, open segments included, instead of averaging player-hours, so one player for part of an hour is 1, not 0.38. Their descriptions end in the span covered (Last 30 days, or Since <date>). Side-by-side chart panels match heights, and Players per day notes its busiest day. Dropped the page descriptions on Bans, Gags & mutes, Staff and Playtime, and the Verified badges on the staff Overview scoreboard and drawer header; the Verification page and the drawer's Verification section still show it. The GroupVerify DB test now checks the staff drawer, since the public site says nothing about verification.
This commit is contained in:
parent
2516759fa9
commit
ba61708bed
11 changed files with 88 additions and 81 deletions
|
|
@ -87,38 +87,6 @@ func (s *Server) verifyInfo(ctx context.Context) (verifyInfo, error) {
|
|||
return verifyInfo{Tables: tables, Settings: settings, Plugin: state, Version: version}, nil
|
||||
}
|
||||
|
||||
// verifiedSet returns which of these players are verified, or nil when verification isn't shown.
|
||||
// Errors are logged and treated as not shown: verification is extra, never worth failing a page.
|
||||
func (s *Server) verifiedSet(ctx context.Context, steamids []string) map[string]store.VerifyStatus {
|
||||
info, err := s.verifyInfo(ctx)
|
||||
if err == nil && info.Shown() {
|
||||
var st map[string]store.VerifyStatus
|
||||
if st, err = s.st.VerifyStatuses(ctx, info.Settings.Location, steamids); err == nil {
|
||||
return st
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
slog.Warn("GroupVerify status unavailable", "err", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// markVerified sets Verified on the live players who are.
|
||||
func (s *Server) markVerified(ctx context.Context, players []livePlayer) {
|
||||
var ids []string
|
||||
for _, p := range players {
|
||||
if !p.Bot {
|
||||
ids = append(ids, p.SteamID)
|
||||
}
|
||||
}
|
||||
set := s.verifiedSet(ctx, ids)
|
||||
for i, p := range players {
|
||||
if st, ok := set[p.SteamID]; ok && st.Verified() {
|
||||
players[i].Verified = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------- Staff API
|
||||
|
||||
type verifyStatusView struct {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue