Liking cljdoc? Tell your friends :D

game.gm.runtime


bootstrap-settlement-ledger!clj

(bootstrap-settlement-ledger! mom-url game-name)

create-game!clj

(create-game! mom-url owner-id game-name spec)

find-game!clj

(find-game! mom-url game-name)

Resolves an already-registered game by handle, returning {:game-id ...} or nil.

Games are registered by a platform operator, so a GM's job at boot is to FIND its game rather than create it. Creating unconditionally is what blocks MoM from requiring an admin for game creation: with that gate on the POST 403s, and the boot sequence — which branches on the returned :game-id — stops the GM before it claims its role, taking routing down on every restart.

A failed lookup returns nil rather than throwing. That is deliberately indistinguishable from "absent" here: the caller falls through to the create path, which reports its own errors and fails loudly if creation is refused.

Resolves an already-registered game by handle, returning {:game-id ...} or nil.

Games are registered by a platform operator, so a GM's job at boot is to FIND
its game rather than create it. Creating unconditionally is what blocks MoM
from requiring an admin for game creation: with that gate on the POST 403s,
and the boot sequence — which branches on the returned :game-id — stops the
GM before it claims its role, taking routing down on every restart.

A failed lookup returns nil rather than throwing. That is deliberately
indistinguishable from "absent" here: the caller falls through to the create
path, which reports its own errors and fails loudly if creation is refused.
raw docstring

game-idclj


game-name-handleclj


gm-identityclj


provision-settlement-ledger!clj

(provision-settlement-ledger! mom-url game-name)

Idempotently provision the MoM ledger currency used by marketplace settlement.

Idempotently provision the MoM ledger currency used by marketplace settlement.
raw docstring

recover-agent!clj

(recover-agent! mom-url agent-id)

register-with-mom!clj

(register-with-mom! mom-url gm-url agent-name player-group-id owner-id)

settlement-ledger-currencyclj


start-gm!clj

(start-gm! {:keys [mom-url gm-url gm-port game-spec game-name agent-name
                   player-group-id owner-id]
            :as cfg}
           app)

sync-player-slots!clj

(sync-player-slots! mom-url game-name spec-slots stored-slots)

Corrects a game's stored :game/player-slots when it disagrees with the spec. Returns true when a write happened.

:game/player-slots is set at game creation and nothing in MoM re-derives it, so a spec that gains a role leaves the record behind. That is not a cosmetic drift: mom.game.service/validate-player-join branches on (seq slots) — WITH slots an unknown role is refused and :max capacity enforced; with NONE it returns {:valid? true} for anything. A game with empty or stale slots fails OPEN, accepting roles it does not have and ignoring capacity, while looking entirely healthy.

:game/protocols has the same staleness but is read only by display code (Portal's games table, mom.ui.auto-ui), so it is left alone here. MoM heals it on re-registration anyway — a path that is dead wherever MOM_REQUIRE_ADMIN_FOR_GAME_CREATION is on, which is worth fixing separately rather than smuggling into a slots writer.

NEVER throws and never stops the boot. A GM that cannot correct its slot list is a GM with a stale slot list, which is where it already was; refusing to start over it would turn a quiet drift into a routing outage.

Corrects a game's stored :game/player-slots when it disagrees with the spec.
Returns true when a write happened.

:game/player-slots is set at game creation and nothing in MoM re-derives it,
so a spec that gains a role leaves the record behind. That is not a cosmetic
drift: mom.game.service/validate-player-join branches on (seq slots) — WITH
slots an unknown role is refused and :max capacity enforced; with NONE it
returns {:valid? true} for anything. A game with empty or stale slots fails
OPEN, accepting roles it does not have and ignoring capacity, while looking
entirely healthy.

:game/protocols has the same staleness but is read only by display code
(Portal's games table, mom.ui.auto-ui), so it is left alone here. MoM heals it
on re-registration anyway — a path that is dead wherever
MOM_REQUIRE_ADMIN_FOR_GAME_CREATION is on, which is worth fixing separately
rather than smuggling into a slots writer.

NEVER throws and never stops the boot. A GM that cannot correct its slot list
is a GM with a stale slot list, which is where it already was; refusing to
start over it would turn a quiet drift into a routing outage.
raw docstring

sync-self-claimable-roles!clj

(sync-self-claimable-roles! mom-url game-name spec-roles stored-roles)

Keeps an existing game's human self-enrolment policy aligned with the GM spec. A missing spec key leaves policy ownership with MoM; an explicit empty vector closes self-enrolment. Never throws or blocks GM startup.

Keeps an existing game's human self-enrolment policy aligned with the GM
spec. A missing spec key leaves policy ownership with MoM; an explicit empty
vector closes self-enrolment. Never throws or blocks GM startup.
raw docstring

verify-settlement-ledger!clj

(verify-settlement-ledger! mom-url game-name)

Verify the platform house account is readable for the settlement currency.

Verify the platform house account is readable for the settlement currency.
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close