TopSize
untyped bigintTopSize is how many players the leaderboard holds.
Value
(10 <untyped> bigint)
EasyBot
untyped bigintOpponents: the three house bots, or a ghost's id (FirstGhost and up).
Value
(1 <untyped> bigint)
NormalBot
untyped bigintOpponents: the three house bots, or a ghost's id (FirstGhost and up).
Value
(2 <untyped> bigint)
HardBot
untyped bigintOpponents: the three house bots, or a ghost's id (FirstGhost and up).
Value
(3 <untyped> bigint)
FirstGhost
untyped bigintOpponents: the three house bots, or a ghost's id (FirstGhost and up).
Value
(10 <untyped> bigint)
Ghost
typeA Ghost is a ranked top-10 run, kept so others can fight it.
Value
brawl.Ghost
board
[10]string// top runs, best first, encoded; "" is an empty place
- OID
- 0c4016…6ad0:4
board details
nextID
intValue
10
runs
int// runs submitted
Value
0
encode
func(g *brawl.Ghost) stringencode writes a ghost as "id|player|name|class|seed|gold|botGold|height|inputs". Inputs go last because their alphabet includes '|'; names can't.
- OID
- 0c4016…6ad0:7
encode details
decode
func(s string) *brawl.Ghost- OID
- 0c4016…6ad0:9
decode details
gold
func(s string) intgold reads only the gold of an encoded run.
- OID
- 0c4016…6ad0:10
gold details
player
func(s string) string- OID
- 0c4016…6ad0:11
player details
findGhost
func(id int) *brawl.Ghost- OID
- 0c4016…6ad0:12
findGhost details
mustGhost
func(id int) *brawl.Ghost- OID
- 0c4016…6ad0:13
mustGhost details
cleanName
func(name string) string- OID
- 0c4016…6ad0:14
cleanName details
place
func(addr string, g int) intplace returns where a score from this player would go on the board, or -1. A player holds one place; a new score must beat their old one.
- OID
- 0c4016…6ad0:15
place details
insert
func(s string, addr string)- OID
- 0c4016…6ad0:16
insert details
Submit
func(opponent int, seed int, class int, name string, inputs string, gold int, oppGold int) intSubmit records a run. opponent is EasyBot, NormalBot, HardBot or a ghost's id; seed sets the arena and the coins (for a ghost it must be the ghost's seed). inputs are your inputs, one character per tick (see the brawl package); gold and oppGold are the final score the browser showed. A ranked run (against HardBot) good enough for the top 10 is replayed first, and the call fails if the replay disagrees. It returns your new ghost's id if the run made the top 10, or 0.
- OID
- 0c4016…6ad0:17
Submit details
GhostInputs
func(id int) stringGhostInputs returns a ghost's recorded inputs.
- OID
- 0c4016…6ad0:18
GhostInputs details
Top
func() stringTop lists the leaderboard as JSON, best first. Each entry can be fought as a ghost.
- OID
- 0c4016…6ad0:19
Top details
GhostJSON
func(id int) stringGhostJSON describes one ghost as JSON.
- OID
- 0c4016…6ad0:20
GhostJSON details
ghostJSON
func(g *brawl.Ghost) string- OID
- 0c4016…6ad0:21
ghostJSON details
RunCount
func() intRunCount is the number of runs submitted.
- OID
- 0c4016…6ad0:22
RunCount details
classNames
[5]string- OID
- 0c4016…6ad0:24
classNames details
who
func(g *brawl.Ghost) string- OID
- 0c4016…6ad0:25
who details
Render
func(path string) stringRender shows the leaderboard, or one ghost at "ghost/\<id>".
- OID
- 0c4016…6ad0:27