addressSize
untyped bigint// bytes in an address's text
Value
(40 <untyped> bigint)
standingFix
untyped bigint// a standing's bytes before its per-clan counts
Value
(9 <untyped> bigint)
resultSize
untyped bigintValue
(88 <untyped> bigint)
resultsPerChunk
untyped bigintValue
(64 <untyped> bigint)
writer
typeValue
v0.writer
reader
typeValue
v0.reader
standing
typestanding is a player's rated record. lastClan is the clan number of their last rated match; perClan\[i] counts their rated matches with clan number i + 1.
Value
v0.standing
decodeStanding
func(s string) *v0.standingdecodeStanding reads a standing's bytes: the rating, wins, losses and draws at 2 bytes each, the last clan number at 1, then a 2-byte count per clan number played.
- OID
- 0fcff9…d416:3
decodeStanding details
encodeStanding
func(st *v0.standing) string- OID
- 0fcff9…d416:5
encodeStanding details
ladderKey
func(rating int, player .uverse.address) stringladderKey orders the ladder: highest rating first, then address order.
- OID
- 0fcff9…d416:6
ladderKey details
resultEntry
typeresultEntry is one logged result. writer is the reporting realm's writer number, clans the two clan numbers, result 'a', 'b' or 'd', and time the block's Unix seconds.
Value
v0.resultEntry
resultChunkKey
func(seq int) stringresultChunkKey is the log key of the chunk that holds result seq, 1 first.
- OID
- 0fcff9…d416:7
resultChunkKey details
encodeResult
func(e v0.resultEntry) string- OID
- 0fcff9…d416:8
encodeResult details
decodeResult
func(s string) v0.resultEntry- OID
- 0fcff9…d416:9
decodeResult details
maxPage
untyped bigintValue
(50 <untyped> bigint)
Standing
typeStanding is one player's place on the ladder. Rank is 1 for the highest rating and equal ratings share it; Rank is 0 and Rating 1000 for a player with no rated match. Name is the player's gno.land name, "" without one. MainClan is "" until their first rated match with a counted clan.
Value
v0.Standing
ClanStanding
typeClanStanding is one clan's record across rated cross-clan matches.
Value
v0.ClanStanding
Result
typeResult is one logged result. Seq is its place in the log, 1 first; Writer is the path of the realm that reported it. Result is "a" when the challenger won, "b" when the acceptor did, and "draw"; Time is the block's Unix seconds.
Value
v0.Result
Leaderboard
func(offset int, limit int) []v0.StandingLeaderboard lists rated players, highest rating first: limit of them after skipping offset.
- OID
- 0fcff9…d416:10
Leaderboard details
StandingOf
func(player .uverse.address) v0.StandingStandingOf returns player's standing, rated or not.
- OID
- 0fcff9…d416:12
StandingOf details
RatedPlayers
func() intRatedPlayers counts the players on the ladder.
- OID
- 0fcff9…d416:13
RatedPlayers details
ClanStandings
func() []v0.ClanStandingClanStandings lists every clan with a rated cross-clan match, highest rating first; equal ratings keep first-seen order and share a rank. Clans with no such match are left out: they stand at 1000 and 0-0-0.
- OID
- 0fcff9…d416:14
ClanStandings details
Results
func(offset int, limit int) []v0.ResultResults lists logged results, oldest first: limit of them after skipping offset.
- OID
- 0fcff9…d416:15
Results details
ResultCount
func() intResultCount counts the logged results.
- OID
- 0fcff9…d416:16
ResultCount details
standingOf
func(player .uverse.address) v0.StandingstandingOf is player's standing without its rank.
- OID
- 0fcff9…d416:17
standingOf details
nameOf
func(player .uverse.address) stringnameOf is player's gno.land name, "" when they have none.
- OID
- 0fcff9…d416:18
nameOf details
clanName
func(n int) stringclanName is the name of clan number n, "" for 0, no clan.
- OID
- 0fcff9…d416:19
clanName details
resultName
func(b uint8) string- OID
- 0fcff9…d416:20
resultName details
checkPage
func(offset int, limit int)- OID
- 0fcff9…d416:21
checkPage details
startRating
untyped bigintValue
(1000 <untyped> bigint)
maxRating
untyped bigint// a ladder key holds the rating in 2 bytes
Value
(65535 <untyped> bigint)
playerK
untyped bigintValue
(32 <untyped> bigint)
clanK
untyped bigintValue
(16 <untyped> bigint)
maxClans
untyped bigint// a clan number fills one byte of a standing and a result entry
Value
(255 <untyped> bigint)
maxPlayerCount
untyped bigint// a player's counts are stored in 2 bytes
Value
(65535 <untyped> bigint)
maxClanCount
untyped bigintValue
(4294967295 <untyped> bigint)
clanRecord
typeclanRecord is a clan's rating and its record in rated matches against other clans.
Value
v0.clanRecord
expectedTable
[17]intexpectedTable is the expected score, in thousandths, of a side whose opponent is rated 0, 25, …, 400 points above it: 1 / (1 + 10^(d / 400)), rounded.
- OID
- 0fcff9…d416:23
expectedTable details
expected
func(a int, b int) intexpected is the expected score, in thousandths, of a side rated a against one rated b. The gap is capped at 400 points and rounded to the nearest 25.
- OID
- 0fcff9…d416:24
expected details
eloChange
func(a int, b int, score int, k int) inteloChange is the change, rounded to the nearest point, of a side rated a that scored score thousandths (1000 a win, 500 a draw, 0 a loss) against one rated b.
- OID
- 0fcff9…d416:26
eloChange details
applyChange
func(a int, b int, delta int) (int, int)applyChange gives a the change delta and b its negative, each kept within 0 to maxRating.
- OID
- 0fcff9…d416:27
applyChange details
clampRating
func(r int) int- OID
- 0fcff9…d416:28
clampRating details
rate
func(a .uverse.address, b .uverse.address, ca int, cb int, score int)rate counts a match between a, playing clan number ca, and b, playing clan number cb, in which a scored score thousandths: in both standings, on the ladder, and in the clan records when both clans are counted and differ.
- OID
- 0fcff9…d416:29
rate details
ratedStanding
func(a .uverse.address) *v0.standingratedStanding returns a's standing, created at startRating for a first rated match, and takes its key off the ladder until it is counted.
- OID
- 0fcff9…d416:30
ratedStanding details
loadStanding
func(a .uverse.address) *v0.standingloadStanding returns a's standing, nil before their first rated match.
- OID
- 0fcff9…d416:31
loadStanding details
saveStanding
func(a .uverse.address, st *v0.standing)- OID
- 0fcff9…d416:32
saveStanding details
clanNumber
func(name string) intclanNumber is the clan number of name, its first-seen position plus one. A name not seen before gets the next number, or 0, no clan, once maxClans are numbered: a writer that fills the table must not abort another writer's endings.
- OID
- 0fcff9…d416:33
clanNumber details
scoreOf
func(result string) intscoreOf is the challenger's score, in thousandths, in a match that ended with result.
- OID
- 0fcff9…d416:34
scoreOf details
tally
func(score int, wins *int, losses *int, draws *int, ceiling int)tally adds a win, loss or draw for score, each count stopping at ceiling.
- OID
- 0fcff9…d416:35
tally details
rankOf
func(rating int) intrankOf is the rank a rating holds: 1 plus the number of players rated above it.
- OID
- 0fcff9…d416:36
rankOf details
maxWriters
untyped bigint// a writer number fills one byte of a result entry
Value
(255 <untyped> bigint)
maxClanName
untyped bigintValue
(32 <untyped> bigint)
maxPkgPath
untyped bigintValue
(256 <untyped> bigint)
owner
*v0.Ownable- OID
- 0fcff9…d416:64
owner details
writerPaths
[]string// every path ever a writer; its index plus one is its writer number
- OID
- 0fcff9…d416:66
writerPaths details
writers
v0.Tree// current writer path → its writer number
- OID
- 0fcff9…d416:40
writers details
players
v0.Tree// address → standing bytes
- OID
- 0fcff9…d416:42
players details
ladder
*v0.Node// ladderKey of every rated player → nil
Value
<zero>
clans
[]v0.clanRecord// in first-seen order; a clan's index plus one is its clan number
Value
<zero>
results
v0.Tree// resultChunkKey → that chunk's result entries, oldest first
- OID
- 0fcff9…d416:46
results details
init.60
func()- OID
- 0fcff9…d416:47
init.60 details
Record
func(challenger .uverse.address, acceptor .uverse.address, challengerClan string, acceptorClan string, result string)Record rates a match the calling arena reports as ended, and logs it. result is "a" when the challenger won, "b" when the acceptor did, and "draw". It aborts unless the caller is a realm on the writer list, and on a report no correct arena sends: the same player on both sides, another result, or a clan name that is empty or over 32 bytes.
- OID
- 0fcff9…d416:49
Record details
AddWriter
func(pkgpath string)AddWriter lets the realm at pkgpath, a versioned path under gno.land/r/, report results. A path that was a writer before gets its old writer number back. Owner only.
- OID
- 0fcff9…d416:50
AddWriter details
RemoveWriter
func(pkgpath string)RemoveWriter stops the realm at pkgpath from reporting results. Owner only.
- OID
- 0fcff9…d416:51
RemoveWriter details
TransferOwnership
func(newOwner .uverse.address)TransferOwnership makes newOwner the owner. Owner only.
- OID
- 0fcff9…d416:52
TransferOwnership details
refuseSession
func()refuseSession refuses a call signed with a session key, which its master may have handed to a page or a script: the writer list answers only to the owner's own key.
- OID
- 0fcff9…d416:53
refuseSession details
IsWriter
func(pkgpath string) boolIsWriter reports whether the realm at pkgpath may report results.
- OID
- 0fcff9…d416:54
IsWriter details
Writers
func() []stringWriters lists the realms that may report results, in writer-number order.
- OID
- 0fcff9…d416:55
Writers details
Owner
func() .uverse.address- OID
- 0fcff9…d416:56
Owner details
addWriter
func(pkgpath string)- OID
- 0fcff9…d416:57
addWriter details
isVersionedRealm
func(pkgpath string) boolisVersionedRealm reports whether pkgpath is under gno.land/r/, at most maxPkgPath bytes of lowercase letters, digits and "/.\_-", and ends in a version element: "v" and one or more digits. A sub-realm path, with "#", is refused.
- OID
- 0fcff9…d416:58
isVersionedRealm details
validClan
func(name string) bool- OID
- 0fcff9…d416:59
validClan details
appendResult
func(e v0.resultEntry)- OID
- 0fcff9…d416:60
appendResult details
resultAt
func(seq int) v0.resultEntryresultAt is logged result seq, 1 first.
- OID
- 0fcff9…d416:61
resultAt details
resultCount
func() intresultCount counts the logged results: every chunk but the last is full.
- OID
- 0fcff9…d416:62
resultCount details
stringAt
func(t *v0.Tree, key string) stringstringAt is t's string at key, "" when t has none.
- OID
- 0fcff9…d416:63