web¶
The world served over HTTP.
Source: src/laife/web/.
How to run it and what the routes return: the serving guide.
snapshot.py-WorldSnapshotandtake_snapshot, the world as JSON. Players get aPlayerView, sincePlayeris not a pydantic model.events.py-EventHub, which numbers events and fans them out, andadd_log_sink, which feeds it from the structured log.vendor.py- theui/vendor.tomlmanifest,make vendor's download, hash check and extraction, and the lock check before a file is served.run.py-serve_run, which plays a built world while serving it;make runandmake headless SERVE=1both use it.server.py-create_app, the FastAPI routes, andserve, which runs uvicorn as a task in the game's loop and stops it, by the quit route or a signal, after closing the hub's streams.
The page itself is in ui/world_web/, outside the package, served by create_app; the sprite table it reads is laife.config.sprites.
Every route is async def: FastAPI runs a plain def route in a worker thread, which would read the game state from outside the event loop.