ProfileJSON
func(addr string) stringProfileJSON is the profile of an address, or null when it has none yet: {"addr","name","rank","gamesPlayed","victoryPoints","createdAt"} name is the address's name in gno.land/r/sys/users, "" if none.
- OID
- 03175f…88e2:3
ProfileJSON details
PlayersJSON
func(offset int, count int) stringPlayersJSON is one page of the ranking, best first, count at most MaxPage: {"total","offset","players":[profile...]}
- OID
- 03175f…88e2:5
PlayersJSON details
writeProfile
func(b *strings.Builder, p *v0.Profile, rank int)- OID
- 03175f…88e2:6
writeProfile details
quote
func(s string) stringquote encodes s as a JSON string.
- OID
- 03175f…88e2:7
quote details
MaxPage
untyped bigintMaxPage bounds PlayersJSON and json/players/{offset}/{count}.
Value
(50 <untyped> bigint)
Profile
typeProfile is a player's record, created the first time the address creates or joins a game.
Value
v0.Profile
admin
.uverse.addressValue
<gnolang.StringValue>
profiles
*v0.Tree// address -> \*Profile
- OID
- 03175f…88e2:10
profiles details
ranking
*v0.Tree- OID
- 03175f…88e2:13
ranking details
games
*v0.Tree- OID
- 03175f…88e2:16
games details
init.10
func()- OID
- 03175f…88e2:18
init.10 details
Ensure
func(addr .uverse.address)Ensure creates addr's profile if it has none yet.
- OID
- 03175f…88e2:20
Ensure details
AddGamePlayed
func(addr .uverse.address)AddGamePlayed counts a game that started for addr.
- OID
- 03175f…88e2:21
AddGamePlayed details
AddVictoryPoints
func(addr .uverse.address, points int)AddVictoryPoints adds an award's points (\< 0 for a loss) to addr's total.
- OID
- 03175f…88e2:22
AddVictoryPoints details
assertGame
func()- OID
- 03175f…88e2:23
assertGame details
Allow
func(pkgPath string)Allow lets the game realm pkgPath write the profiles (a new version of the game).
- OID
- 03175f…88e2:24
Allow details
Disallow
func(pkgPath string)Disallow stops pkgPath from writing (a game version no longer scored); its calls panic from then on.
- OID
- 03175f…88e2:25
Disallow details
SetAdmin
func(addr .uverse.address)SetAdmin hands the allowlist over to addr.
- OID
- 03175f…88e2:26
SetAdmin details
assertAdmin
func()- OID
- 03175f…88e2:27
assertAdmin details
Admin
func() .uverse.address- OID
- 03175f…88e2:28
Admin details
IsGame
func(pkgPath string) boolIsGame tells whether the realm pkgPath may write the profiles.
- OID
- 03175f…88e2:29
IsGame details
Games
func() []stringGames lists the allowed game realms.
- OID
- 03175f…88e2:30
Games details
Get
func(addr .uverse.address) (v0.Profile, bool)Get is a copy of addr's profile, false when it has none.
- OID
- 03175f…88e2:31
Get details
Rank
func(addr .uverse.address) intRank is addr's 1-based position in the ranking, 0 without a profile.
- OID
- 03175f…88e2:32
Rank details
Count
func() intCount is the number of profiles.
- OID
- 03175f…88e2:33
Count details
Name
func(addr .uverse.address) stringName is addr's name in gno.land/r/sys/users (where namereg registers them), or "".
- OID
- 03175f…88e2:34
Name details
rankKey
func(p *v0.Profile) stringrankKey sorts by victory points, then games played, both descending, then by address.
- OID
- 03175f…88e2:35
rankKey details
desc
func(n int) stringdesc is a fixed-width key that sorts larger numbers first; victory points may be negative, so it is centred on 0 (|n| below 5e8).
- OID
- 03175f…88e2:36
desc details
ensure
func(addr .uverse.address) *v0.Profileensure returns addr's profile, creating it on first use.
- OID
- 03175f…88e2:37
ensure details
update
func(addr .uverse.address, change func(...))update applies change to addr's profile and keeps its rank.
- OID
- 03175f…88e2:38
update details
rankOf
func(p *v0.Profile) intrankOf is the 1-based position of p in the ranking.
- OID
- 03175f…88e2:39
rankOf details
rankingLimit
untyped bigintrankingLimit is how many players the gnoweb page lists.
Value
(50 <untyped> bigint)
router
*v0.Router- OID
- 03175f…88e2:41
router details
init.33
func()- OID
- 03175f…88e2:44
init.33 details
Render
func(path string) stringRender serves the ranking page ("") and the raw JSON views the web client reads ("json/profile/{addr}", "json/players/{offset}/{count}").
- OID
- 03175f…88e2:46
Render details
renderHome
func(res *v0.ResponseWriter, *v0.Request)- OID
- 03175f…88e2:47
renderHome details
label
func(a .uverse.address) stringlabel shows an address by its registered name when it has one.
- OID
- 03175f…88e2:48