asobi_lua_config_watcher (asobi v0.84.0)
View SourceKeeps the game-mode registry (game_modes) in sync with its Lua source.
Mode-shape config (match_size, strategy, max_players, the config.lua
mode manifest) is read once at boot by
asobi_lua_config:maybe_load_game_config/0 and applied via
asobi_game_config:apply_config/1. The in-match hot-reload
(asobi_lua_reload) re-evaluates a script body inside already-running match and
world servers, but the reported bug is at match formation - before any server
exists for the new config - so that path is structurally blind to it. Without a
refresh, editing match_size and hot-reloading leaves the matchmaker on the
boot-time value (asobi#232).
This watcher polls the manifest and each registered mode's script on an interval
and re-runs the config loader when an mtime moves, so new matches pick up the
change. Running matches are untouched (they consumed their match_size at
formation). It shares the hot-reload dial: with asobi_lua_reload:reload_mode()
off (a sealed prod bundle whose mtimes never change) it is a pure no-op.
Summary
Functions
-spec handle_call(term(), gen_server:from(), map()) -> {reply, term(), map()}.
-spec init([]) -> {ok, map()}.
-spec start_link() -> gen_server:start_ret().