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

ClaimTimeout

func ClaimTimeout(cur realm, id string)
Ask AI Claude ChatGPT

ClaimTimeout ends the wait of a turn past its deadline. Anyone may call it. A game waiting for players has no timeout (its creator may cancel it). While the plans are committed, past the deadline: each player who did not commit misses the turn: it is passed for them, unless that makes MaxMissed in a row, which puts the character out of the fight (out of time counts as surrendering); the game then goes on to the reveals, and with nobody's plan in, the turn resolves empty. A showdown nobody plays any more so ends after MaxMissed claims, everyone out of the fight (its stakes given back, stakes.gno). While they are revealed, RevealGrace past the deadline (the timelocked plans had time to be opened, which is how a vanished player's plan normally comes in): every character whose plan is still not in misses the turn the same way. The realm cannot tell a copy nobody could open from one nobody tried to open, so it does not punish more than a missed turn. With one character left the game ends and is scored, with more the turn resolves with the plans in and the showdown goes on.

Param

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/g1th0masp67zfs9lg6d34qhghldhg6kjcqjuv7c2/gnoslinger/v0" -func "ClaimTimeout" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g1th0masp67zfs9lg6d34qhghldhg6kjcqjuv7c2/gnoslinger/v0" -func "ClaimTimeout" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx