feat(world): expose empty_grace_ms global + log Lua callback errors#14
Merged
feat(world): expose empty_grace_ms global + log Lua callback errors#14
Conversation
Pairs with widgrensit/asobi#86 (lobby lifecycle + empty_grace_ms feature). - feat(config): read `empty_grace_ms` Lua global and forward it as empty_grace_ms in mode config. asobi_world_server reads it and keeps worlds alive briefly after the last player leaves; barrow uses this for hub worlds so brief disconnects don't tear them down. - fix(world): leave / spawn_position / zone_tick / handle_input now log when the Lua callback errors instead of silently swallowing. Pre-fix, only post_tick logged; broken user scripts could degrade gameplay invisibly. Single log_lua_error/3 helper, severity=error for genuine errors, severity=timeout for timeouts. - fix(world): generate_world surfaces lua_loader:new failures via logger:error before falling back to empty zones. Previously silent. - fix(world): decode_phases logs a warning when the Lua phases() table isn't a list. Hides nothing now.
5 tasks
Taure
added a commit
that referenced
this pull request
Apr 26, 2026
Brings in widgrensit/asobi#86: world-server lifecycle fixes plus the empty_grace_ms feature consumed by asobi_lua_config (#14). - world.create now reflects the creator in the join reply - already_in_world rejection on join when player is in another world - empty world stays alive for empty_grace_ms after last leave - ETS player->world tracking with cleanup on terminate - loading state postpones join until init completes - empty phases() no longer auto-finishes the world
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Pairs with widgrensit/asobi#86 (lobby lifecycle +
empty_grace_msfeature).empty_grace_msLua global and forward it asempty_grace_msin mode config so games can configure how long an empty world stays alive before reaping.leave/spawn_position/zone_tick/handle_inputnow log when the Lua callback errors instead of silently swallowing the error. This was hiding bugs in user-supplied scripts.generate_worldsurfaceslua_loader:newfailures vialogger:errorinstead of returning an empty world that looks fine.decode_phaseslogs a warning when the Luaphases()table isn't a list. Hides nothing now.Test plan
rebar3 fmt --checkcleanrebar3 xrefcleanrebar3 dialyzerclean~/bin/elp eqwalize-all— only pre-existing errors (verified via stash)rebar3 eunit62 tests, 0 failures (incl. newempty_grace_ms_forwardedtest)world.lua(empty_grace_ms = 900000) in follow-up commit