Starvation::sync() runs after every mutation and event: it keeps food.runs_out at
the moment the stock hits 0, starts the grace timer once the village starves and
stops it when income covers upkeep again. Each desertion wave takes the fewest
soldiers, highest upkeep first, that feed the rest; then the levy ends.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drafted villagers still eat but stop working; recruiting trains only undrafted ones.
A levy.ends event settles the village and sends them back; village.endLevy ends it early.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The package resolves the per-message authtoken for that message only.
Recording socket_<id> and the authed-user map lets the server authenticate
later messages itself and the game:events worker find sockets to push to.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>