MaxScore
untyped bigintValue
(1000000 <untyped> bigint)
MelomaneUnlockAt
untyped bigint// Classic points needed to unlock Mélomane
Value
(135 <untyped> bigint)
Record
typeRecord = best result in one mode.
Value
sonotone2.Record
Player
typePlayer = a registered player and their best record per mode.
Value
sonotone2.Player
players
v0.Tree// key: wallet address -> \*Player
- OID
- 0939ab…0b67:4
players details
pseudos
v0.Tree// key: lowercase nickname -> wallet address
- OID
- 0939ab…0b67:6
pseudos details
Register
func(pseudo string)Register links a nickname to the wallet signing the transaction.
- OID
- 0939ab…0b67:7
Register details
SubmitScore
func(mode string, score int, level int, instrument string)SubmitScore saves a new record in a mode ("classic" or "melomane").
- OID
- 0939ab…0b67:9
SubmitScore details
GetPlayerJSON
func(addr string) stringGetPlayerJSON returns an address's full profile as JSON, or "null": {"pseudo":"…","address":"…","melomane\_unlocked":true, "classic":{"score":…,"level_max":…,"instrument":"…"}, "melomane":{"score":…,"level_max":…,"instrument":"…"}}
- OID
- 0939ab…0b67:10
GetPlayerJSON details
GetTopJSON
func(mode string, n int) stringGetTopJSON returns the top n players of a mode, as JSON: \[{"pseudo":"…","address":"…","score":…,"level\_max":…,"instrument":"…"}, …]
- OID
- 0939ab…0b67:11
GetTopJSON details
Render
func(string) stringRender shows both leaderboards as Markdown on gnoweb.
- OID
- 0939ab…0b67:12
Render details
renderTable
func(title string, mode string) string- OID
- 0939ab…0b67:13
renderTable details
recordOf
func(p *sonotone2.Player, mode string) sonotone2.Record- OID
- 0939ab…0b67:14
recordOf details
recordJSON
func(r sonotone2.Record) string- OID
- 0939ab…0b67:15
recordJSON details
checkPseudo
func(p string)checkPseudo: 3 to 20 characters, letters, digits, \_ and - only.
- OID
- 0939ab…0b67:16
checkPseudo details
validInstrument
func(i string) bool- OID
- 0939ab…0b67:17
validInstrument details
topPlayers
func(mode string, n int) []*sonotone2.PlayertopPlayers sorts players with a score in this mode, highest first.
- OID
- 0939ab…0b67:18