No Verified tags on the public site
The public scoreboard and player pages no longer show or receive whether a player is verified. The staff panel still does.
This commit is contained in:
parent
7004945d49
commit
f659859d66
3 changed files with 11 additions and 13 deletions
|
|
@ -42,7 +42,7 @@ async function server() {
|
|||
<thead><tr><th>Player</th><th class="num">Kills</th><th class="num">Deaths</th><th class="num hide-sm">Ping</th></tr></thead>
|
||||
<tbody>
|
||||
${list.map((p) => `<tr ${p.bot ? "" : `class="clickable" data-player="${esc(p.steamid)}"`}>
|
||||
<td><div class="who"><div><b>${esc(p.name)}</b>${p.verified ? ` ${VERIFIED_TAG}` : ""}${p.bot ? '<span class="sid">Bot</span>' : p.rank ? rankTag(p.rank) : ""}</div></div></td>
|
||||
<td><div class="who"><div><b>${esc(p.name)}</b>${p.bot ? '<span class="sid">Bot</span>' : p.rank ? rankTag(p.rank) : ""}</div></div></td>
|
||||
<td class="num">${p.kills}</td>
|
||||
<td class="num">${p.deaths}</td>
|
||||
<td class="num hide-sm muted">${p.bot ? "" : p.ping}</td>
|
||||
|
|
@ -243,8 +243,8 @@ async function openPlayer(sid) {
|
|||
<div><h2>${esc(name)}</h2><span class="sid">${esc(p.steamid)} · <a href="${steamProfile(p.steamid)}" target="_blank" rel="noopener">Steam profile</a></span>${p.rank ? `<div>${rankTag(p.rank)}</div>` : ""}</div>
|
||||
<button class="close" type="button" data-close aria-label="Close">×</button>
|
||||
</div>
|
||||
${now.length || p.online || p.verified ? `<section>
|
||||
<div class="chips">${p.verified ? VERIFIED_TAG : ""}${p.online ? '<span class="tag">On the server</span>' : ""}${now.map((h) => `<span class="tag ${h.kind === "ban" ? "red" : "amber"}">${h.kind === "ban" ? "Banned" : COMM_HELP[h.type]}${h.duration ? `, ${fmtLeft(served(h).left)}` : ", permanently"}</span>`).join("")}</div>
|
||||
${now.length || p.online ? `<section>
|
||||
<div class="chips">${p.online ? '<span class="tag">On the server</span>' : ""}${now.map((h) => `<span class="tag ${h.kind === "ban" ? "red" : "amber"}">${h.kind === "ban" ? "Banned" : COMM_HELP[h.type]}${h.duration ? `, ${fmtLeft(served(h).left)}` : ", permanently"}</span>`).join("")}</div>
|
||||
</section>` : ""}
|
||||
${ptDrawer(p.playtime, p.online)}
|
||||
<section>
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ func toPublic(ps []store.Penalty) []publicPenalty {
|
|||
type livePlayer struct {
|
||||
live.Player
|
||||
Rank *rankView `json:"rank,omitempty"`
|
||||
// Verified by GroupVerify, when that's shown at all (see verifyInfo.Shown).
|
||||
// Verified by GroupVerify, when that's shown at all (see verifyInfo.Shown). Staff overview only.
|
||||
Verified bool `json:"verified,omitempty"`
|
||||
// Staff-only fields, left empty on the public page.
|
||||
Tags []string `json:"tags,omitempty"`
|
||||
|
|
@ -84,9 +84,8 @@ func (s *Server) publicServer(w http.ResponseWriter, r *http.Request) {
|
|||
internal(w, r, err)
|
||||
return
|
||||
}
|
||||
view := s.serverView(x, s.poll.Current())
|
||||
s.markVerified(r.Context(), view.Players)
|
||||
writeJSON(w, http.StatusOK, view)
|
||||
// No Verified tags on the public scoreboard; the staff overview still marks them.
|
||||
writeJSON(w, http.StatusOK, s.serverView(x, s.poll.Current()))
|
||||
}
|
||||
|
||||
// penaltyQuery reads ?status=&q=&page= (and for comms, a type in place of the status).
|
||||
|
|
@ -290,11 +289,10 @@ func (s *Server) publicPlayer(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
_, online := s.poll.Current().Find(steamid)
|
||||
// Only whether they're verified: why, and overrides' expiry and who gave them, are for staff.
|
||||
st, verified := s.verifiedSet(r.Context(), []string{steamid})[steamid]
|
||||
// No verification on the public site: that's on the staff panel.
|
||||
resp := map[string]any{
|
||||
"steamid": steamid, "name": d.Name, "online": online, "rank": s.rankOf(x, steamid),
|
||||
"verified": verified && st.Verified(), "bans": toPublic(bans), "comms": toPublic(comms),
|
||||
"bans": toPublic(bans), "comms": toPublic(comms),
|
||||
}
|
||||
// Signed-in staff get the staff playtime figures here too, as on the staff panel.
|
||||
id, _, err := s.identity(r)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue