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 source realm

Constants 1

const MaxScore

1const MaxScore = 1000000
source

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

Functions 5

func GetPlayerJSON

Action
1func GetPlayerJSON(addr string) string
source

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

func GetTopJSON

Action
1func GetTopJSON(n int) string
source

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

func Register

crossing Action
1func Register(cur realm, pseudo string)
source

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.

func Render

1func Render(_ string) string
source

Render affiche le classement en Markdown sur gnoweb.

func SubmitScore

crossing Action
1func SubmitScore(cur realm, score int, level int, instrument string)
source

SubmitScore enregistre un nouveau record pour le wallet qui signe.

Types 1

type Player

struct
1type Player struct {
2	Pseudo     string
3	Address    address
4	BestScore  int
5	Level      int    // niveau max atteint lors du meilleur score
6	Instrument string // instrument utilisé lors du meilleur score
7}
source

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

Dependencies

Imports 3

/r/g1nmhpk7x6rjh0e43x9d6pw84qy3wu47g8lxw9kp/sonotone

Imported by indexer

Source Files 2