Impl
typeImpl is the rules engine. Declared here so every version agrees on one type identity. The methods are non-crossing: this realm threads its own cur in, so an implementation reaching Store is seen as this realm. The caller's address and the coins received are established by the entry points below and passed in; an implementation cannot be invoked with forged ones from elsewhere, because without this realm's live cur it cannot reach the state at all.
Value
shots.Impl
Denom
untyped stringDenom is the coin pots are held in.
Value
"ugnot"
Admin
.uverse.addressAdmin may accept, roll back or freeze an implementation. The value is the standard test1 account so the tests run unedited; set your own address before deploying (TransferAuthority moves it afterwards).
Value
<gnolang.StringValue>
proxy
*v0.Proxy- OID
- 01d009…d184:71
proxy details
selfPath
stringValue
"gno.land/r/g1lnkytfqcjwllws63gvf0mv9yt04aswy4y9amhm/shots"
init.5
func()- OID
- 01d009…d184:5
init.5 details
CreateGame
func(entryFee int64, timeoutBlocks int64, config string) uint64CreateGame opens a game. Send the initial pot with the call (ugnot). config overrides the default constants as "key=value,..." ("" for the defaults; see penalty.ParseConfig). timeoutBlocks 0 picks the default. Returns the game id.
- OID
- 01d009…d184:7
CreateGame details
JoinGame
func(gameID uint64)JoinGame starts a shootout in an open game. Send exactly its entry fee.
- OID
- 01d009…d184:8
JoinGame details
TopUp
func(gameID uint64)TopUp adds the coins sent to a game's pot.
- OID
- 01d009…d184:9
TopUp details
TakeShot
func(gameID uint64, aimX int64, aimY int64, contactX int64, contactY int64, power int64) stringTakeShot plays the player's kick for the current round against the chain's keeper: aim point on the goal plane (mm), contact offset on the ball (milli-radii) and power (per-mille). Returns the kick as JSON.
- OID
- 01d009…d184:10
TakeShot details
SubmitKeeperPlan
func(gameID uint64, direction uint16, speed uint16, jump uint16, reaction uint16) stringSubmitKeeperPlan plays the player's keeper plan against the chain's kick for the current round: four uint16 (see penalty.DecodePlan). Returns the kick as JSON.
- OID
- 01d009…d184:11
SubmitKeeperPlan details
Forfeit
func(gameID uint64)Forfeit ends the current shootout as a loss: the player may resign at any time, anyone else once the player has been idle for the game's timeout.
- OID
- 01d009…d184:12
Forfeit details
CancelGame
func(gameID uint64)CancelGame refunds the pot to the creator of a game nobody has played yet.
- OID
- 01d009…d184:13
CancelGame details
SimulateShot
func(aimX int64, aimY int64, contactX int64, contactY int64, power int64, mishitHex string, direction uint16, speed uint16, jump uint16, reaction uint16, config string) stringSimulateShot runs the live outcome function on ten inputs, without touching any state: the taker's aim, contact, power and 48-hex-char mishit seed, and the keeper's four uint16, under config ("" for the defaults). Returns JSON.
- OID
- 01d009…d184:14
SimulateShot details
GameJSON
func(gameID uint64) stringGameJSON returns game id as JSON ("" if it does not exist).
- OID
- 01d009…d184:15
GameJSON details
SessionJSON
func(gameID uint64, no int) stringSessionJSON returns session no of a game, kicks included, as JSON.
- OID
- 01d009…d184:16
SessionJSON details
ListGames
func(status string, offset int, limit int) stringListGames returns up to limit games as a JSON array, newest first, optionally filtered by status ("open", "playing", "won", "cancelled"; "" for all).
- OID
- 01d009…d184:17
ListGames details
VerifySession
func(gameID uint64, no int) boolVerifySession re-runs every recorded kick of a shootout through the live outcome function and reports whether all of them reproduce, so anyone can check a result from the ten recorded inputs alone.
- OID
- 01d009…d184:18
VerifySession details
GameCount
func() uint64GameCount returns how many games have been created.
- OID
- 01d009…d184:19
GameCount details
receivePayment
func(int, rlm .uverse.realm) int64receivePayment returns the ugnot sent with a direct user call. The coin envelope is credited to this realm only when this realm is the message's target, so a payment from any other call shape is refused rather than trusted.
- OID
- 01d009…d184:20
receivePayment details
assertFreeDirectCall
func(int, rlm .uverse.realm)assertFreeDirectCall requires a direct user call that sends no coins.
- OID
- 01d009…d184:21
assertFreeDirectCall details
assertDirect
func(int, rlm .uverse.realm)- OID
- 01d009…d184:22
assertDirect details
Register
func(impl shots.Impl)Register records the calling realm as a candidate implementation; an implementation calls it from its own init. Nothing serves until Accept.
- OID
- 01d009…d184:23
Register details
Accept
func(pkgPath string)Accept makes the candidate at pkgPath live. Authority only.
- OID
- 01d009…d184:24
Accept details
Withdraw
func(pkgPath string)Withdraw drops a candidate. Authority only, or the candidate itself.
- OID
- 01d009…d184:25
Withdraw details
Rollback
func()Rollback restores the previous implementation. Authority only.
- OID
- 01d009…d184:26
Rollback details
Forget
func()Forget drops the rollback history. Authority only.
- OID
- 01d009…d184:27
Forget details
Freeze
func()Freeze ends upgradeability permanently. Authority only.
- OID
- 01d009…d184:28
Freeze details
AddExtension
func(pkgPath string)AddExtension lets another realm act as this one. Authority only.
- OID
- 01d009…d184:29
AddExtension details
DropExtension
func(pkgPath string)DropExtension revokes one. Authority only.
- OID
- 01d009…d184:30
DropExtension details
TransferAuthority
func(newOwner .uverse.address)TransferAuthority hands the power to upgrade to another address.
- OID
- 01d009…d184:31
TransferAuthority details
TransferAuthorityToRealms
func(csvPaths string)TransferAuthorityToRealms hands it to governance realms (comma-separated).
- OID
- 01d009…d184:32
TransferAuthorityToRealms details
LivePath
func() string- OID
- 01d009…d184:33
LivePath details
Frozen
func() bool- OID
- 01d009…d184:34
Frozen details
Authority
func() string- OID
- 01d009…d184:35
Authority details
Extensions
func() []string- OID
- 01d009…d184:36
Extensions details
PendingPaths
func() []string- OID
- 01d009…d184:37
PendingPaths details
HistoryPaths
func() []string- OID
- 01d009…d184:38
HistoryPaths details
live
func() shots.Impl- OID
- 01d009…d184:39
live details
itoa
func(n int64) string- OID
- 01d009…d184:40
itoa details
games
*v0.Tree// gameKey(id) -> \*shootout.Game
- OID
- 01d009…d184:42
games details
sessions
*v0.Tree// sessionKey(id, no) -> \*shootout.Session
- OID
- 01d009…d184:45
sessions details
lastID
uint64Value
9
gameKey
func(id uint64) string- OID
- 01d009…d184:48
gameKey details
sessionKey
func(id uint64, no int) string- OID
- 01d009…d184:50
sessionKey details
getGame
func(id uint64) (v0.Game, bool)- OID
- 01d009…d184:51
getGame details
getSession
func(id uint64, no int) (v0.Session, bool)- OID
- 01d009…d184:52
getSession details
StateRef
typeStateRef is a permission to read and write the game state, handed to code running on this realm's cur. It carries the caller's realm value and re-checks it on every operation, so it cannot be stashed (the VM refuses to persist a realm value) or replayed after its frame returns.
Value
shots.StateRef
Store
func(int, rlm .uverse.realm) *shots.StateRefStore hands a StateRef to the live implementation, or to a registered extension. Any other realm presents its own cur and is refused.
- OID
- 01d009…d184:53
Store details
assertStateAccess
func(int, rlm .uverse.realm)assertStateAccess panics unless rlm is a live cur belonging to this realm or to a registered extension.
- OID
- 01d009…d184:54
assertStateAccess details
q
func(s string) string- OID
- 01d009…d184:55
q details
kv
func(k string, v string) string- OID
- 01d009…d184:57
kv details
obj
func(fields []string) string- OID
- 01d009…d184:58
obj details
gameJSON
func(g v0.Game) string- OID
- 01d009…d184:59
gameJSON details
resultJSON
func(r v0.Result) string- OID
- 01d009…d184:60
resultJSON details
shotJSON
func(s v0.ShotInput) string- OID
- 01d009…d184:61
shotJSON details
planJSON
func(p v0.KeeperPlan) string- OID
- 01d009…d184:62
planJSON details
kickJSON
func(k v0.Kick) string- OID
- 01d009…d184:63
kickJSON details
sessionJSON
func(s v0.Session) string- OID
- 01d009…d184:64
sessionJSON details
Render
func(path string) stringRender shows the games list, one game ("game/\<id>") or one shootout ("game/\<id>/\<session>").
- OID
- 01d009…d184:65
Render details
ugnot
func(n int64) string- OID
- 01d009…d184:66
ugnot details
renderHome
func() string- OID
- 01d009…d184:67
renderHome details
renderGame
func(id uint64) string- OID
- 01d009…d184:68
renderGame details
score
func(s v0.Shootout) string- OID
- 01d009…d184:69
score details
renderSession
func(id uint64, no int) string- OID
- 01d009…d184:70