API Reference asobi v#0.35.4

View Source

Modules

In-memory cache for access-token → player resolution.

Issues and revokes player auth tokens on top of nova_auth_refresh.

UUIDv7 generation for Asobi entities.

The behaviour a game developer implements to define server-authoritative game logic. Each game mode is a module that implements this behaviour; Asobi runs one process per match and invokes these callbacks at the right moments in the match lifecycle.

Per-match gen_statem driving the configured game module.

The matchmaking queue. Players submit tickets with a mode and property constraints (add/2); a pluggable strategy groups compatible tickets, spawns a match, and pushes match.matched to each player. A single gen_server owns the queue and ticks it on an interval.

Client-IP extraction shared across HTTP and WebSocket entry points, used as the rate-limiter key.

Query-string parsing helpers shared across controllers.

Spatial query primitives over zone entities: radius and rectangle queries, nearest-neighbour, range and distance helpers. Pure functional - no process, no state - operating on entity maps, so asobi_zone and game code can call it directly.

Pure functional terrain chunk encoding and compression.

Behaviour for terrain data providers.

Kura schema for persisted vote results.

REST controller for vote history queries.

Vote lifecycle state machine.

Dynamic supervisor for asobi_vote_server processes.

A persistent, zoned world: the gen_statem behind large session games (game_type = "world"). It partitions space into a grid of asobi_zone processes, moves players between zones as they travel, runs a world-level post_tick, and drives voting. Use it for MMO-style shared spaces; for transient matches use asobi_match_server instead.

Top-level world supervisor.

One spatial partition of an asobi_world_server. A gen_server that owns the entities in its cell of the grid, ticks their simulation, applies player input, manages interest (subscribers), and answers spatial queries via asobi_spatial. Zones are created and reaped lazily as players move.

Lazy zone lifecycle manager for the world server.