mirror of
https://github.com/tiennm99/noitu.git
synced 2026-10-10 02:13:31 +00:00
One goroutine owns each room and its engine. The room goroutine starts before anyone is seated and seating is itself a message, so reading run() is a complete proof of the concurrency contract rather than a convention to uphold. The bot searches a frozen copy of the board instead of the live engine. Reads carry no deadline; liveness is ping-based, because a read timeout cannot distinguish a healthy player idling in the lobby from a dead socket. The hub no longer binds a joiner to a seat before the room decides whether to seat them. Anyone holding a room code could previously resign or play on a seated player's behalf, and the room code is the only credential online 1v1 has. cmd/noitu-server serves the API and, when NOITU_WEB_DIR is set, the built frontend, with unknown paths falling back to index.html for client routes. All configuration is environment-only and every variable has a working default.