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.

sonotone state

Back to all declarations

MaxScore

untyped bigint

Score maximum accepté (protection basique contre les valeurs absurdes).

Value

(1000000 <untyped> bigint)

Player

type

Player = un joueur inscrit et son meilleur résultat.

Value

sonotone.Player

players

v0.Tree

// clé : adresse du wallet -> \*Player

Open
OID
0b2825…ea45:4
players details

Inspect ref

pseudos

v0.Tree

// clé : pseudo en minuscules -> adresse du wallet

Open
OID
0b2825…ea45:6
pseudos details

Inspect ref

Register

func(pseudo string)

Register relie un pseudo au wallet qui signe la transaction. Le premier paramètre "cur realm" est obligatoire pour qu'un utilisateur puisse appeler la fonction et pour savoir QUI l'appelle.

Open
OID
0b2825…ea45:7
Register details

Inspect func

SubmitScore

func(score int, level int, instrument string)

SubmitScore enregistre un nouveau record pour le wallet qui signe.

Open
OID
0b2825…ea45:9
SubmitScore details

Inspect func

GetPlayerJSON

func(addr string) string

GetPlayerJSON renvoie le profil d'une adresse en JSON, ou "null".

Open
OID
0b2825…ea45:10
GetPlayerJSON details

Inspect func

GetTopJSON

func(n int) string

GetTopJSON renvoie les n meilleurs joueurs (ayant un score) en JSON.

Open
OID
0b2825…ea45:11
GetTopJSON details

Inspect func

Render

func(string) string

Render affiche le classement en Markdown sur gnoweb.

Open
OID
0b2825…ea45:12
Render details

Inspect func

checkPseudo

func(p string)

checkPseudo : 3 à 20 caractères, lettres, chiffres, \_ et - uniquement. (Ça évite aussi les caractères qui casseraient le JSON ou la page.)

Open
OID
0b2825…ea45:13
checkPseudo details

Inspect func

validInstrument

func(i string) bool
Open
OID
0b2825…ea45:14
validInstrument details

Inspect func

playerToJSON

func(p *sonotone.Player) string
Open
OID
0b2825…ea45:15
playerToJSON details

Inspect func

topPlayers

func(n int) []*sonotone.Player

topPlayers trie les joueurs ayant un score, du plus grand au plus petit.

Open
OID
0b2825…ea45:16
topPlayers details

Inspect func
MaxScore : untyped bigint =(1000000 <untyped> bigint)
Player : type =sonotone.Player
players : v0.Tree Inspect
pseudos : v0.Tree Inspect
Register : func(pseudo string) Inspect
SubmitScore : func(score int, level int, instrument string) Inspect
GetPlayerJSON : func(addr string) string Inspect
GetTopJSON : func(n int) string Inspect
Render : func(string) string Inspect
checkPseudo : func(p string) Inspect
validInstrument : func(i string) bool Inspect
playerToJSON : func(p *sonotone.Player) string Inspect
topPlayers : func(n int) []*sonotone.Player Inspect