asobi_match_server (asobi v0.72.6)
View SourcePer-match gen_statem driving the configured game module.
Trust boundary (F-32): asobi is single-tenant by design. The
configured game module (Mod:join/2, Mod:tick/1, Mod:handle_input/3,
phase / vote callbacks, etc.) is trusted code. We do not wrap
callbacks in try/catch — a crash in the game module is treated as a
bug worth surfacing, not a security boundary to harden against. The
match supervisor restarts the match server up to 10 times in 60s
(transient + intensity 10) before the entire asobi_match_sup falls
over, intentionally taking the lobby with it so an obviously broken
game cannot keep churning silently.
In multi-tenant or sandboxed contexts (asobi_lua) callbacks are run
through a Lua sandbox that has its own fault-isolation; that wrapper is
the place to put callback hardening.
Summary
Functions
Join carrying an opaque join context from the client. asobi does not
interpret it; it reaches the game module's join/3 if it exports one.
Projection of get_info/1 for callers who are not in the match.
Functions
-spec callback_mode() -> gen_statem:callback_mode_result().
-spec cancel(pid()) -> ok.
-spec finished(gen_statem:event_type() | enter, term(), map()) -> gen_statem:state_enter_result(atom()).
Join carrying an opaque join context from the client. asobi does not
interpret it; it reaches the game module's join/3 if it exports one.
Projection of get_info/1 for callers who are not in the match.
Mirrors asobi_world_server:listing_info/1. get_info/1 carries the full
players roster and the server-side listed flag; neither reaches a
browsing client.
-spec paused(gen_statem:event_type() | enter, term(), map()) -> gen_statem:state_enter_result(atom()).
-spec running(gen_statem:event_type() | enter, term(), map()) -> gen_statem:state_enter_result(atom()).
-spec start_link(map()) -> gen_statem:start_ret().
-spec waiting(gen_statem:event_type() | enter, term(), map()) -> gen_statem:state_enter_result(atom()).