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.

gnoslinger/v0 package

Overview

Package gnoslinger is the on-chain lobby and referee of Gunslinger showdowns (the 1982 Avalon Hill gunfight game) of two to four players. Players create and join games and play their turn plans hidden: each commits the hash of its plan, then reveals it once every plan is committed (DESIGN_HIDDEN_PLANS.md); the realm resolves each turn with the pure engine package and keeps the result for the web client to animate.

Function

GamesJSON

func GamesJSON(addr string) string
Ask AI Claude ChatGPT

GamesJSON lists, for an address, the games with a free seat, the games being played (live: planning or revealing, for anyone to watch), the last endedLimit games finished (ended, for anyone to replay) and the games it plays or played, newest first (at most 50 each), with the address's registered name ("" if none). live and ended are found among the liveScan newest games, a running game being recent: a turn times out within days.

Example
1{"name","open":[summary...],"live":[summary...],"ended":[summary...],"mine":[summary...]}
2summary = {"id","rev","phase","turn","maxTurns","timeout","winner","endReason","vp","stake","pot","payouts","houseCut","createdAt","updatedAt","timeoutAt","lockRound","players":[{"addr","name","char","status","committed","revealed"}]}

lockRound (0 unless planning or revealing) tells the lobby when the timelocked plans of a seat committed and not revealed can be opened.

players has one entry per seat, "addr" "" for a seat nobody took yet.

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g1th0masp67zfs9lg6d34qhghldhg6kjcqjuv7c2/gnoslinger/v0.GamesJSON()"

Result