Skip to content Search Apps Documentation Source Content File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

arena state

Back to all declarations

moveWindow

untyped bigint

// seconds a player has for each move

Value

(86400 <untyped> bigint)

openWindow

untyped bigint

// seconds an open challenge stays on the board

Value

(604800 <untyped> bigint)

maxBox

untyped bigint

// bytes

Value

(104 <untyped> bigint)

maxPage

untyped bigint

Value

(50 <untyped> bigint)

maxCleared

untyped bigint

// expired challenges one Challenge deletes at most

Value

(8 <untyped> bigint)

idDigits

untyped bigint

Value

(10 <untyped> bigint)

phaseOpen

untyped string

Value

"open"

phaseReveal

untyped string

Value

"reveal"

phasePlay

untyped string

Value

"play"

phaseEnded

untyped string

Value

"ended"

phaseExpired

untyped string

// reported for an open match past its expiry, never stored

Value

"expired"

lastID

int

Value

5

OpenChallenge

type

OpenChallenge is an open challenge as the board lists it.

Value

arena.OpenChallenge

Challenge

func(clan string, deckSeal string, planSeal string, box string, opponent .uverse.address) string

Challenge posts a challenge for clan with the seals of the challenger's deck and round-1 plan, the box holding both, and an opponent who alone may accept, or none. It returns the new match's id. It first deletes up to 8 expired challenges, whoever posted them.

Open
OID
0a8c52…099f:4
Challenge details

Inspect func

Open

func(offset int, limit int) []arena.OpenChallenge

Open lists open, unexpired challenges, newest first: limit of them after skipping offset. limit is 1 to 50.

Open
OID
0a8c52…099f:6
Open details

Inspect func

forget

func(id int, challenger .uverse.address)

forget deletes open challenge id and its place among its challenger's matches. Its entry on the open list is the caller's to remove.

Open
OID
0a8c52…099f:7
forget details

Inspect func

checkPage

func(offset int, limit int)
Open
OID
0a8c52…099f:8
checkPage details

Inspect func

boxBytes

func(text string) string

boxBytes decodes a box argument: the standard base64 of 1 to maxBox bytes, in the one form that encodes them, so Match returns every box exactly as it was sent.

Open
OID
0a8c52…099f:9
boxBytes details

Inspect func

canonical

func(a .uverse.address) bool

canonical accepts a valid address in the lowercase form callers carry. bech32 also allows uppercase, which would never equal a caller's address.

Open
OID
0a8c52…099f:10
canonical details

Inspect func

validSeal

func(s string) bool

validSeal accepts a sha256 sum in lowercase hex.

Open
OID
0a8c52…099f:11
validSeal details

Inspect func

chunkSize

untyped bigint

// match ids per chunk

Value

(64 <untyped> bigint)

addressSize

untyped bigint

// bytes in an address's text

Value

(40 <untyped> bigint)

sealSize

untyped bigint

// bytes in a raw sha256 seal

Value

(32 <untyped> bigint)

lockSize

untyped bigint

Value

(48 <untyped> bigint)

openSize

untyped bigint

Value

(8 <untyped> bigint)

standingFix

untyped bigint

// a standing's bytes before its per-clan counts

Value

(9 <untyped> bigint)

clanSize

untyped bigint

Value

(14 <untyped> bigint)

planBits

untyped bigint

// bits per round in a side's plans: 2 for the length, 6 per card

Value

(20 <untyped> bigint)

cardBits

untyped bigint

Value

(6 <untyped> bigint)

maxPlanLen

untyped bigint

Value

(3 <untyped> bigint)

maxRound

untyped bigint

Value

(3 <untyped> bigint)

maxPool

untyped bigint

// cards in a clan's pool; a deck is one bit per pool card

Value

(16 <untyped> bigint)

bitsAt

func(v uint64, at uint, width uint) uint64

bitsAt returns the width bits of v starting at bit at.

Open
OID
0a8c52…099f:12
bitsAt details

Inspect func

withBits

func(v uint64, at uint, width uint, x uint64) uint64

withBits returns v with the width bits at bit at replaced by x.

Open
OID
0a8c52…099f:14
withBits details

Inspect func

planAt

func(plans uint64, round int) engine.Plan

planAt returns the plan made for round, or nil when it is not yet made.

Open
OID
0a8c52…099f:16
planAt details

Inspect func

withPlan

func(plans uint64, round int, p engine.Plan) uint64

withPlan returns plans with round's plan set to p.

Open
OID
0a8c52…099f:17
withPlan details

Inspect func

plansMade

func(plans uint64) int

plansMade counts the rounds from the first that have a plan.

Open
OID
0a8c52…099f:18
plansMade details

Inspect func

planOffset

func(round int) uint
Open
OID
0a8c52…099f:19
planOffset details

Inspect func

deckOnPool

func(pool uint64, deck uint64) uint16

deckOnPool returns deck, a set of card ids, as one bit per card of pool in id order.

Open
OID
0a8c52…099f:20
deckOnPool details

Inspect func

deckFromPool

func(pool uint64, bits uint16) uint64

deckFromPool is the inverse of deckOnPool.

Open
OID
0a8c52…099f:21
deckFromPool details

Inspect func

writer

type

Value

arena.writer

reader

type

Value

arena.reader

record

type

record is a match as the arena works on it, decoded from its stored bytes. clans holds each side's index in the ruleset plus one, 0 for none; decks and plans are the engine's card sets and the packed plans of withPlan; hp is the HP after each round, per side; carried holds only the Vulnerable and Strength left after the last resolved round. deckSeal and seal are 64 hex characters; box is the raw bytes, up to maxBox, stored with a 2-byte length.

Value

arena.record

flagOpponent

untyped bigint

Value

(1 <untyped> bigint)

flagDeckSeal

untyped bigint

Value

(2 <untyped> bigint)

flagSealBox

untyped bigint

Value

(4 <untyped> bigint)

phaseNames

[]string (len=4)

The value of each name is its index; 0 of result and reason is none.

Open
OID
0a8c52…099f:24
phaseNames details (len=4)

+4 more Inspect slice

resultNames

[]string (len=4)

The value of each name is its index; 0 of result and reason is none.

Open
OID
0a8c52…099f:26
resultNames details (len=4)

+4 more Inspect slice

reasonNames

[]string (len=5)

The value of each name is its index; 0 of result and reason is none.

Open
OID
0a8c52…099f:28
reasonNames details (len=5)

+5 more Inspect slice

nameIndex

func(names []string, s string, what string) uint64
Open
OID
0a8c52…099f:29
nameIndex details

Inspect func

nameAt

func(names []string, i uint64, what string) string
Open
OID
0a8c52…099f:30
nameAt details

Inspect func

encodeMatch

func(rules *engine.Ruleset, m arena.record) string
Open
OID
0a8c52…099f:31
encodeMatch details

Inspect func

decodeMatch

func(rules *engine.Ruleset, b string) arena.record
Open
OID
0a8c52…099f:32
decodeMatch details

Inspect func

clanNibble

func(rules *engine.Ruleset, clan int) uint64

clanNibble is a clan's stored form, its ruleset index plus one, checked against rules.

Open
OID
0a8c52…099f:33
clanNibble details

Inspect func

poolOf

func(rules *engine.Ruleset, clan int) uint64

poolOf returns the card pool of clan, 0 for no clan.

Open
OID
0a8c52…099f:34
poolOf details

Inspect func

chunkRecord

func(chunk string, slot int) string

chunkRecord returns the record in slot, or "" when it is removed or beyond the chunk.

Open
OID
0a8c52…099f:35
chunkRecord details

Inspect func

withChunkRecord

func(chunk string, slot int, rec string) string

withChunkRecord returns chunk with slot's record set to rec, adding empty slots up to it.

Open
OID
0a8c52…099f:36
withChunkRecord details

Inspect func

playerRecord

type

playerRecord is what the arena keeps per player: the ids of their matches, oldest first, their standing, nil until their first rated match, and the session locks that bind a session key to one match.

Value

arena.playerRecord

standing

type

standing is a player's rated record. lastClan is the clan number, index plus one, of their last rated match; perClan\[i] counts their rated matches with clan number i + 1.

Value

arena.standing

sessionLock

type

Value

arena.sessionLock

decodePlayer

func(s string) arena.playerRecord

A player's bytes are a 2-byte id count, the ids at 4 bytes each, a 1-byte standing length, 0 for none, the standing, then the locks. A standing is the rating, wins, losses and draws at 2 bytes each, the last clan at 1, then a 2-byte count per clan. ceiling: joining a match or changing a lock rewrites all of a player's ids, up to 65,535, so gas grows with their matches; an avl index of ids per player if some play thousands.

Open
OID
0a8c52…099f:37
decodePlayer details

Inspect func

decodeStanding

func(s string) *arena.standing

decodeStanding reads only the standing of a player's bytes, skipping their ids, so its cost does not grow with the player's matches; nil when they have none.

Open
OID
0a8c52…099f:38
decodeStanding details

Inspect func

withStanding

func(s string, st *arena.standing) string

withStanding returns a player's bytes s with their standing replaced by st. It copies the ids and locks without reading them, so its cost does not grow with the player's matches.

Open
OID
0a8c52…099f:39
withStanding details

Inspect func

readStanding

func(r *arena.reader) *arena.standing
Open
OID
0a8c52…099f:40
readStanding details

Inspect func

encodePlayer

func(p arena.playerRecord) string
Open
OID
0a8c52…099f:41
encodePlayer details

Inspect func

writeStanding

func(w *arena.writer, st *arena.standing)
Open
OID
0a8c52…099f:42
writeStanding details

Inspect func

ladderKey

func(rating int, player .uverse.address) string

ladderKey orders the ladder: highest rating first, then address order.

Open
OID
0a8c52…099f:43
ladderKey details

Inspect func

clanRecord

type

clanRecord is a clan's rating and its record in rated matches against other clans.

Value

arena.clanRecord

decodeClans

func(s string, n int) []arena.clanRecord

The clan records are one string holding, per clan in ruleset order, the rating at 2 bytes and the wins, losses and draws at 4 each. decodeClans returns n clans; a clan past the end of s has no rated match yet.

Open
OID
0a8c52…099f:44
decodeClans details

Inspect func

encodeClans

func(c []arena.clanRecord) string
Open
OID
0a8c52…099f:45
encodeClans details

Inspect func

openEntry

type

openEntry is a challenge on the board: its match id and expiry in Unix seconds.

Value

arena.openEntry

openEntries

func(s string) []arena.openEntry
Open
OID
0a8c52…099f:46
openEntries details

Inspect func

encodeOpen

func(entries []arena.openEntry) string
Open
OID
0a8c52…099f:47
encodeOpen details

Inspect func

guard

func(fromUser bool, caller .uverse.address, m arena.record, id int)

guard binds the session that signed the transaction to match id, held in m, saving the caller's record only when its locks change.

Open
OID
0a8c52…099f:48
guard details

Inspect func

join

func(fromUser bool, caller .uverse.address, id int)

join adds match id to the caller's record and binds the session that signed the transaction to it, refused when that session is bound to a match already.

Open
OID
0a8c52…099f:50
join details

Inspect func

signingSession

func(fromUser bool) (.uverse.address, int64, bool)
Open
OID
0a8c52…099f:51
signingSession details

Inspect func

lockSession

func(locks []arena.sessionLock, session .uverse.address, expires int64, id int, opening bool, now int64) (kept []arena.sessionLock, changed bool, refusal string)

lockSession binds session to match id, refused when bound to another, or any when opening. It drops expired locks and any lock its key holds under another expiry (Unix seconds, 0 never).

Open
OID
0a8c52…099f:52
lockSession details

Inspect func

self

string

self is the arena's package path; a deploy under another path changes it.

Value

"gno.land/r/g188vafzutzvlfw6wt7u3s62xtuvm0epmu8ufmfz/gnomepit/arena"

pagePath

untyped string

pagePath is where the page lives on its origin, the start of every trigger's link; the registry accepts only a link that starts with "/".

Value

"/gnomepit/"

tell

func(kind string, player .uverse.address, caller .uverse.address, id int, text string)

tell emits kind to player about match id. It emits nothing when player made the call, so an event never names its caller.

Open
OID
0a8c52…099f:56
tell details

Inspect func

tellBoard

func(id int, text string)

tellBoard emits Board about match id, whose change altered the open-challenge list. It names no address, so a caller cannot aim it at one player's browser.

Open
OID
0a8c52…099f:57
tellBoard details

Inspect func

tellEnded

func(m arena.record, id int, caller .uverse.address)

tellEnded sends Ended to each player of the finished match m, numbered id, but caller, one event each, since gnotif reads only the first value of a repeated attribute.

Open
OID
0a8c52…099f:58
tellEnded details

Inspect func

endText

func(m arena.record, side int) string

endText says how m ended to the player on side.

Open
OID
0a8c52…099f:59
endText details

Inspect func

Accept

func(id string, clan string, deck string, plan string)

Accept answers open challenge id as clan, with deck and the round-1 plan in plain text. When the challenge names an opponent, only that address may accept.

Open
OID
0a8c52…099f:60
Accept details

Inspect func

Reveal

func(id string, deck string, deckSalt string, plan string, planSalt string, nextSeal string, nextBox string)

Reveal opens the challenger's sealed plan for the round being played, and on the first reveal the sealed deck, then resolves the round. A match that goes on needs nextSeal and nextBox for the challenger's next plan; one that ends takes neither.

Open
OID
0a8c52…099f:62
Reveal details

Inspect func

Play

func(id string, plan string)

Play records the acceptor's plan for the round being played.

Open
OID
0a8c52…099f:63
Play details

Inspect func

Resign

func(id string)

Resign withdraws the caller's open challenge, expired or not, deleting it, or concedes a running match.

Open
OID
0a8c52…099f:64
Resign details

Inspect func

ClaimForfeit

func(id string)

ClaimForfeit ends a running match whose deadline has passed: the player who had to move loses. Any wallet may claim it; a session may claim only a match its wallet plays.

Open
OID
0a8c52…099f:65
ClaimForfeit details

Inspect func

find

func(rules *engine.Ruleset, id string) (int, arena.record)
Open
OID
0a8c52…099f:66
find details

Inspect func

lookup

func(rules *engine.Ruleset, id string) (int, arena.record, bool)

lookup returns the match id names, false when there is none. Only an id's own decimal text names it, never "01" or "+1".

Open
OID
0a8c52…099f:67
lookup details

Inspect func

stateOf

func(rules *engine.Ruleset, m arena.record) engine.State

stateOf rebuilds the engine state the next round of m starts from. A round is resolved once the challenger's plan for it is stored; the specials of resolved rounds are spent.

Open
OID
0a8c52…099f:68
stateOf details

Inspect func

checkSeal

func(seal string, salt string, text string)

checkSeal panics unless seal is the sha256 of salt's bytes followed by text.

Open
OID
0a8c52…099f:69
checkSeal details

Inspect func

clanNumber

func(rules *engine.Ruleset, clan string) int

clanNumber is clan's index in rules plus one, as a record stores it, or 0 when no clan has that name.

Open
OID
0a8c52…099f:70
clanNumber details

Inspect func

clanName

func(rules *engine.Ruleset, n int) string

clanName is the name of the clan a record stores as n, "" for none.

Open
OID
0a8c52…099f:71
clanName details

Inspect func

planOf

func(rules *engine.Ruleset, text string) engine.Plan

planOf maps comma-separated card names to the engine's ids.

Open
OID
0a8c52…099f:72
planOf details

Inspect func

deckBits

func(rules *engine.Ruleset, c engine.Clan, deck string) uint64

deckBits returns deck as the engine's bit set, panicking unless it is legal for c. A card named twice is illegal, so a legal deck text holds exactly the deck's names.

Open
OID
0a8c52…099f:73
deckBits details

Inspect func

samePlan

func(p engine.Plan, q engine.Plan) bool
Open
OID
0a8c52…099f:75
samePlan details

Inspect func

resultName

func(r engine.Result) string
Open
OID
0a8c52…099f:76
resultName details

Inspect func

reasonOf

func(s engine.State) string

reasonOf says why a finished match ended: a gnome at 0 HP or less is a knockout.

Open
OID
0a8c52…099f:77
reasonOf details

Inspect func

MatchSummary

type

MatchSummary is one match as a player's list shows it. Round is the round being played, or the last one resolved once the match is over. ToMove is the address that must move next, empty when none. Deadline is the end of the current move's 24 hours, or the expiry of an open challenge, in Unix seconds. Opponent is the address an open challenge is reserved for, "" when anyone can accept it and once accepted.

Value

arena.MatchSummary

MatchView

type

MatchView is everything one match screen needs. Plans holds \[challenger, acceptor] for each resolved round, and for the round being played while the match runs, "" while a plan is sealed or not yet made; HP holds both sides' HP after each resolved round; Box is the challenger's encrypted pending plan, in base64.

Value

arena.MatchView

SessionLock

type

SessionLock binds the session key at address Session to the match whose id is Match. Expires is the session's expiry in Unix seconds, 0 for none.

Value

arena.SessionLock

Standing

type

Standing 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.

Value

arena.Standing

ClanStanding

type

ClanStanding is one clan's record across rated cross-clan matches.

Value

arena.ClanStanding

Leaderboard

func(offset int, limit int) []arena.Standing

Leaderboard lists rated players, highest rating first: limit of them after skipping offset.

Open
OID
0a8c52…099f:78
Leaderboard details

Inspect func

StandingOf

func(player .uverse.address) arena.Standing

StandingOf returns player's standing, rated or not.

Open
OID
0a8c52…099f:80
StandingOf details

Inspect func

RatedPlayers

func() int

RatedPlayers counts the players on the ladder.

Open
OID
0a8c52…099f:81
RatedPlayers details

Inspect func

ClanStandings

func() []arena.ClanStanding

ClanStandings lists every clan of the ruleset, highest rating first; equal ratings keep ruleset order and share a rank.

Open
OID
0a8c52…099f:82
ClanStandings details

Inspect func

standingOf

func(rules *engine.Ruleset, player .uverse.address) arena.Standing

standingOf is player's standing without its rank.

Open
OID
0a8c52…099f:83
standingOf details

Inspect func

nameOf

func(player .uverse.address) string

nameOf is player's gno.land name, "" when they have none.

Open
OID
0a8c52…099f:84
nameOf details

Inspect func

Locks

func(player .uverse.address) []arena.SessionLock

Locks lists player's session locks. It can include locks whose session has expired.

Open
OID
0a8c52…099f:85
Locks details

Inspect func

Matches

func(player .uverse.address, offset int, limit int) []arena.MatchSummary

Matches lists player's matches, newest first: limit of them after skipping offset.

Open
OID
0a8c52…099f:86
Matches details

Inspect func

Match

func(id string) arena.MatchView

Match returns the view of match id.

Open
OID
0a8c52…099f:87
Match details

Inspect func

deckText

func(rules *engine.Ruleset, deck uint64) string

deckText names the cards of deck in card id order.

Open
OID
0a8c52…099f:88
deckText details

Inspect func

planText

func(rules *engine.Ruleset, p engine.Plan) string

planText names the cards of p in play order.

Open
OID
0a8c52…099f:89
planText details

Inspect func

startRating

untyped bigint

Value

(1000 <untyped> bigint)

maxRating

untyped bigint

// a ladder key holds the rating in 2 bytes

Value

(65535 <untyped> bigint)

playerK

untyped bigint

Value

(32 <untyped> bigint)

clanK

untyped bigint

Value

(16 <untyped> bigint)

expectedTable

[17]int

expectedTable 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.

Open
OID
0a8c52…099f:91
expectedTable details

Inspect array

expected

func(a int, b int) int

expected 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.

Open
OID
0a8c52…099f:92
expected details

Inspect func

eloChange

func(a int, b int, score int, k int) int

eloChange 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.

Open
OID
0a8c52…099f:94
eloChange details

Inspect func

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.

Open
OID
0a8c52…099f:95
applyChange details

Inspect func

rate

func(rules *engine.Ruleset, m arena.record)

rate counts match m, which has just ended, in both players' standings and on the ladder, and in the clan records when two different clans met. A match its challenger accepted is not rated.

Open
OID
0a8c52…099f:97
rate details

Inspect func

ratedStanding

func(rules *engine.Ruleset, a .uverse.address) *arena.standing

ratedStanding returns a's standing, created at startRating for a first rated match, with a count for every clan of rules, and takes its key off the ladder until it is counted.

Open
OID
0a8c52…099f:98
ratedStanding details

Inspect func

scoreOf

func(result string) int

scoreOf is the challenger's score, in thousandths, in a match that ended with result.

Open
OID
0a8c52…099f:99
scoreOf details

Inspect func

tally

func(score int, wins *int, losses *int, draws *int)
Open
OID
0a8c52…099f:100
tally details

Inspect func

rankOf

func(rating int) int

rankOf is the rank a rating holds: 1 plus the number of players rated above it.

Open
OID
0a8c52…099f:101
rankOf details

Inspect func

notFound

untyped string

Value

"# Not found\n\nThe arena has no page at this path.\n"

Render

func(path string) string

Render serves the board of open challenges at "", one player's matches at "player/\<address>", and one match at "match/\<id>".

Open
OID
0a8c52…099f:102
Render details

Inspect func

renderPlayer

func(player .uverse.address) string
Open
OID
0a8c52…099f:105
renderPlayer details

Inspect func

renderMatch

func(v arena.MatchView) string
Open
OID
0a8c52…099f:106
renderMatch details

Inspect func

outcome

func(result string, reason string) string
Open
OID
0a8c52…099f:107
outcome details

Inspect func

chunks

v0.Tree

// 4-byte chunk number → chunk string

Open
OID
0a8c52…099f:112
chunks details

Inspect ref

players

v0.Tree

// address → player string

Open
OID
0a8c52…099f:114
players details

Inspect ref

ladder

*v0.Node

// ladderKey of every rated player → nil

Open
OID
0a8c52…099f:251
ladder details

Inspect pointer

clanRecords

string

Value

"\x03�\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x03�\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x03�\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00"

openList

string

Value

""

loadMatch

func(rules *engine.Ruleset, id int) (arena.record, bool)

loadMatch returns match id, or false when it does not exist or was removed.

Open
OID
0a8c52…099f:120
loadMatch details

Inspect func

saveMatch

func(rules *engine.Ruleset, id int, m arena.record)
Open
OID
0a8c52…099f:121
saveMatch details

Inspect func

dropMatch

func(id int)

dropMatch removes match id; an absent id is left alone.

Open
OID
0a8c52…099f:122
dropMatch details

Inspect func

putRecord

func(id int, rec string)
Open
OID
0a8c52…099f:123
putRecord details

Inspect func

stringAt

func(t *v0.Tree, key string) string

stringAt returns the string under key, "" when there is none.

Open
OID
0a8c52…099f:124
stringAt details

Inspect func

loadPlayer

func(a .uverse.address) arena.playerRecord
Open
OID
0a8c52…099f:125
loadPlayer details

Inspect func

savePlayer

func(a .uverse.address, p arena.playerRecord)
Open
OID
0a8c52…099f:126
savePlayer details

Inspect func

loadStanding

func(a .uverse.address) *arena.standing

loadStanding returns a's standing, nil before their first rated match.

Open
OID
0a8c52…099f:127
loadStanding details

Inspect func

saveStanding

func(a .uverse.address, st *arena.standing)
Open
OID
0a8c52…099f:128
saveStanding details

Inspect func

openAdd

func(id int, expires int64)

ceiling: each change rewrites the whole open list, 8 bytes per open challenge, so its gas grows with the board; an avl index keyed by expiry and id if the board holds thousands.

Open
OID
0a8c52…099f:129
openAdd details

Inspect func

openNewest

func(now int64, offset int, limit int) []int

openNewest returns up to limit unexpired ids, newest first, after skipping offset of them.

Open
OID
0a8c52…099f:131
openNewest details

Inspect func

openClear

func(now int64, max int) []int

openClear removes up to max expired entries from the front and returns their ids.

Open
OID
0a8c52…099f:132
openClear details

Inspect func
moveWindow : untyped bigint =(86400 <untyped> bigint)
openWindow : untyped bigint =(604800 <untyped> bigint)
maxBox : untyped bigint =(104 <untyped> bigint)
maxPage : untyped bigint =(50 <untyped> bigint)
maxCleared : untyped bigint =(8 <untyped> bigint)
idDigits : untyped bigint =(10 <untyped> bigint)
phaseOpen : untyped string ="open"
phaseReveal : untyped string ="reveal"
phasePlay : untyped string ="play"
phaseEnded : untyped string ="ended"
phaseExpired : untyped string ="expired"
lastID : int =5
OpenChallenge : type =arena.OpenChallenge
Challenge : func(clan string, deckSeal string, planSeal string, box string, opponent .uverse.address) string Inspect
Open : func(offset int, limit int) []arena.OpenChallenge Inspect
forget : func(id int, challenger .uverse.address) Inspect
checkPage : func(offset int, limit int) Inspect
boxBytes : func(text string) string Inspect
canonical : func(a .uverse.address) bool Inspect
validSeal : func(s string) bool Inspect
chunkSize : untyped bigint =(64 <untyped> bigint)
addressSize : untyped bigint =(40 <untyped> bigint)
sealSize : untyped bigint =(32 <untyped> bigint)
lockSize : untyped bigint =(48 <untyped> bigint)
openSize : untyped bigint =(8 <untyped> bigint)
standingFix : untyped bigint =(9 <untyped> bigint)
clanSize : untyped bigint =(14 <untyped> bigint)
planBits : untyped bigint =(20 <untyped> bigint)
cardBits : untyped bigint =(6 <untyped> bigint)
maxPlanLen : untyped bigint =(3 <untyped> bigint)
maxRound : untyped bigint =(3 <untyped> bigint)
maxPool : untyped bigint =(16 <untyped> bigint)
bitsAt : func(v uint64, at uint, width uint) uint64 Inspect
withBits : func(v uint64, at uint, width uint, x uint64) uint64 Inspect
mask : func(width uint) uint64 Inspect
planAt : func(plans uint64, round int) engine.Plan Inspect
withPlan : func(plans uint64, round int, p engine.Plan) uint64 Inspect
plansMade : func(plans uint64) int Inspect
planOffset : func(round int) uint Inspect
deckOnPool : func(pool uint64, deck uint64) uint16 Inspect
deckFromPool : func(pool uint64, bits uint16) uint64 Inspect
cardsIn : func(pool uint64) uint Inspect
writer : type =arena.writer
reader : type =arena.reader
record : type =arena.record
flagOpponent : untyped bigint =(1 <untyped> bigint)
flagDeckSeal : untyped bigint =(2 <untyped> bigint)
flagSealBox : untyped bigint =(4 <untyped> bigint)
phaseNames : []string (len=4) Inspect
resultNames : []string (len=4) Inspect
reasonNames : []string (len=5) Inspect
nameIndex : func(names []string, s string, what string) uint64 Inspect
nameAt : func(names []string, i uint64, what string) string Inspect
encodeMatch : func(rules *engine.Ruleset, m arena.record) string Inspect
decodeMatch : func(rules *engine.Ruleset, b string) arena.record Inspect
clanNibble : func(rules *engine.Ruleset, clan int) uint64 Inspect
poolOf : func(rules *engine.Ruleset, clan int) uint64 Inspect
chunkRecord : func(chunk string, slot int) string Inspect
withChunkRecord : func(chunk string, slot int, rec string) string Inspect
playerRecord : type =arena.playerRecord
standing : type =arena.standing
sessionLock : type =arena.sessionLock
decodePlayer : func(s string) arena.playerRecord Inspect
decodeStanding : func(s string) *arena.standing Inspect
withStanding : func(s string, st *arena.standing) string Inspect
readStanding : func(r *arena.reader) *arena.standing Inspect
encodePlayer : func(p arena.playerRecord) string Inspect
writeStanding : func(w *arena.writer, st *arena.standing) Inspect
ladderKey : func(rating int, player .uverse.address) string Inspect
clanRecord : type =arena.clanRecord
decodeClans : func(s string, n int) []arena.clanRecord Inspect
encodeClans : func(c []arena.clanRecord) string Inspect
openEntry : type =arena.openEntry
openEntries : func(s string) []arena.openEntry Inspect
encodeOpen : func(entries []arena.openEntry) string Inspect
guard : func(fromUser bool, caller .uverse.address, m arena.record, id int) Inspect
join : func(fromUser bool, caller .uverse.address, id int) Inspect
signingSession : func(fromUser bool) (.uverse.address, int64, bool) Inspect
lockSession : func(locks []arena.sessionLock, session .uverse.address, expires int64, id int, opening bool, now int64) (kept []arena.sessionLock, changed bool, refusal string) Inspect
self : string ="gno.land/r/g188vafzutzvlfw6wt7u3s62xtuvm0epmu8ufmfz/gnomepit/arena"
pagePath : untyped string ="/gnomepit/"
init.81 : func() Inspect
tell : func(kind string, player .uverse.address, caller .uverse.address, id int, text string) Inspect
tellBoard : func(id int, text string) Inspect
tellEnded : func(m arena.record, id int, caller .uverse.address) Inspect
endText : func(m arena.record, side int) string Inspect
Accept : func(id string, clan string, deck string, plan string) Inspect
Reveal : func(id string, deck string, deckSalt string, plan string, planSalt string, nextSeal string, nextBox string) Inspect
Play : func(id string, plan string) Inspect
Resign : func(id string) Inspect
ClaimForfeit : func(id string) Inspect
find : func(rules *engine.Ruleset, id string) (int, arena.record) Inspect
lookup : func(rules *engine.Ruleset, id string) (int, arena.record, bool) Inspect
stateOf : func(rules *engine.Ruleset, m arena.record) engine.State Inspect
checkSeal : func(seal string, salt string, text string) Inspect
clanNumber : func(rules *engine.Ruleset, clan string) int Inspect
clanName : func(rules *engine.Ruleset, n int) string Inspect
planOf : func(rules *engine.Ruleset, text string) engine.Plan Inspect
deckBits : func(rules *engine.Ruleset, c engine.Clan, deck string) uint64 Inspect
samePlan : func(p engine.Plan, q engine.Plan) bool Inspect
resultName : func(r engine.Result) string Inspect
reasonOf : func(s engine.State) string Inspect
MatchSummary : type =arena.MatchSummary
MatchView : type =arena.MatchView
SessionLock : type =arena.SessionLock
Standing : type =arena.Standing
ClanStanding : type =arena.ClanStanding
Leaderboard : func(offset int, limit int) []arena.Standing Inspect
StandingOf : func(player .uverse.address) arena.Standing Inspect
RatedPlayers : func() int Inspect
ClanStandings : func() []arena.ClanStanding Inspect
standingOf : func(rules *engine.Ruleset, player .uverse.address) arena.Standing Inspect
nameOf : func(player .uverse.address) string Inspect
Locks : func(player .uverse.address) []arena.SessionLock Inspect
Matches : func(player .uverse.address, offset int, limit int) []arena.MatchSummary Inspect
Match : func(id string) arena.MatchView Inspect
deckText : func(rules *engine.Ruleset, deck uint64) string Inspect
planText : func(rules *engine.Ruleset, p engine.Plan) string Inspect
startRating : untyped bigint =(1000 <untyped> bigint)
maxRating : untyped bigint =(65535 <untyped> bigint)
playerK : untyped bigint =(32 <untyped> bigint)
clanK : untyped bigint =(16 <untyped> bigint)
expectedTable : [17]int Inspect
expected : func(a int, b int) int Inspect
eloChange : func(a int, b int, score int, k int) int Inspect
applyChange : func(a int, b int, delta int) (int, int) Inspect
clampRating : func(r int) int Inspect
rate : func(rules *engine.Ruleset, m arena.record) Inspect
ratedStanding : func(rules *engine.Ruleset, a .uverse.address) *arena.standing Inspect
scoreOf : func(result string) int Inspect
tally : func(score int, wins *int, losses *int, draws *int) Inspect
rankOf : func(rating int) int Inspect
notFound : untyped string ="# Not found\n\nThe arena has no page at this path.\n"
Render : func(path string) string Inspect
renderBoard : func() string Inspect
renderPlayer : func(player .uverse.address) string Inspect
renderMatch : func(v arena.MatchView) string Inspect
outcome : func(result string, reason string) string Inspect
date : func(unix int64) string Inspect
orNone : func(s string) string Inspect
chunks : v0.Tree Inspect
players : v0.Tree Inspect
ladder : *v0.Node Inspect
clanRecords : string ="\x03�\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x03�\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x03�\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00"
openList : string =""
chunkKey : func(id int) string Inspect
loadMatch : func(rules *engine.Ruleset, id int) (arena.record, bool) Inspect
saveMatch : func(rules *engine.Ruleset, id int, m arena.record) Inspect
dropMatch : func(id int) Inspect
putRecord : func(id int, rec string) Inspect
stringAt : func(t *v0.Tree, key string) string Inspect
loadPlayer : func(a .uverse.address) arena.playerRecord Inspect
savePlayer : func(a .uverse.address, p arena.playerRecord) Inspect
loadStanding : func(a .uverse.address) *arena.standing Inspect
saveStanding : func(a .uverse.address, st *arena.standing) Inspect
openAdd : func(id int, expires int64) Inspect
openRemove : func(id int) Inspect
openNewest : func(now int64, offset int, limit int) []int Inspect
openClear : func(now int64, max int) []int Inspect