Verification: clan tag setting, GroupVerify 0.3.0 wording
Root sets GroupVerify's clan_tag (the scoreboard tag CS2-Tags gives verified players without a rank) next to the Steam group. Validated like the plugin (12 UTF-16 units, no quotes, ; or \), saved to gv_settings and sent as css_gv_clantag when the plugin is loaded. Only changed fields are sent. GroupVerify 0.3.0 checks players with the Steam Web API as they join, so the group list is now "Confirmed group members" with first/last confirmed dates.
This commit is contained in:
parent
9e4bc63201
commit
3c62874f91
6 changed files with 102 additions and 17 deletions
|
|
@ -118,6 +118,20 @@ func TestVerifyDB(t *testing.T) {
|
|||
code, out = call("POST", "/api/admin/verify/settings", owner, map[string]any{"groupId": group})
|
||||
expect(200, code, out, "owner sets the group")
|
||||
|
||||
// The clan tag: Root only, at most 12 characters, nothing the console would mangle.
|
||||
code, out = call("POST", "/api/admin/verify/settings", mod, map[string]any{"clanTag": "zio"})
|
||||
expect(403, code, out, "mod sets the clan tag")
|
||||
for _, bad := range []string{`a"b`, "a;b", "thirteen char"} {
|
||||
code, out = call("POST", "/api/admin/verify/settings", owner, map[string]any{"clanTag": bad})
|
||||
expect(400, code, out, "clan tag "+bad)
|
||||
}
|
||||
code, out = call("POST", "/api/admin/verify/settings", owner, map[string]any{"clanTag": " zio.sh "})
|
||||
expect(200, code, out, "owner sets the clan tag")
|
||||
var clanTag string
|
||||
if err := db.QueryRow("SELECT value FROM gv_settings WHERE name = 'clan_tag'").Scan(&clanTag); err != nil || clanTag != "zio.sh" {
|
||||
t.Fatalf("clan_tag = %q (%v), want zio.sh", clanTag, err)
|
||||
}
|
||||
|
||||
// Overrides need @zio/verify.
|
||||
code, out = call("POST", "/api/admin/verify/overrides", mod, map[string]any{"steamid": charlie, "days": 7})
|
||||
expect(403, code, out, "mod without @zio/verify")
|
||||
|
|
@ -136,7 +150,7 @@ func TestVerifyDB(t *testing.T) {
|
|||
code, out = call("GET", "/api/admin/verify", mod, nil)
|
||||
expect(200, code, out, "verify page")
|
||||
status := out["status"].(map[string]any)
|
||||
if status["active"] != true || status["groupMembers"] != float64(1) || status["overrides"] != float64(1) || status["plugin"] != "unknown" {
|
||||
if status["active"] != true || status["groupMembers"] != float64(1) || status["overrides"] != float64(1) || status["plugin"] != "unknown" || status["clanTag"] != "zio.sh" {
|
||||
t.Fatalf("status %v", status)
|
||||
}
|
||||
items := out["list"].(map[string]any)["items"].([]any)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue