fix(ecs): provide World reference to SystemContext#148
Merged
Conversation
Ecs stores an optional Arc<World> set by the server at startup. SystemContext::world() returns this reference instead of panicking. Fixes PhysicsPlugin crash when ctx.world() is called during system dispatch.
Game loop panic: TickLoop::Drop detects thread panic via JoinHandle::join() and calls process::exit(1). The server never becomes a zombie with a dead game loop. Plugin handler panic: dispatch_event() wraps bus.dispatch() in catch_unwind when crash_on_plugin_panic = false. Panicking handlers are logged and skipped without killing the game loop. Net task instant dispatches (chat, commands) are also caught and logged. When crash_on_plugin_panic = true (default), plugin panics propagate normally and crash the game loop → process::exit(1).
Infrastructure panics (game loop, I/O thread) crash the server via process::exit(1) — detected through JoinHandle::join() in Drop/stop. The server never becomes a zombie. Plugin handler panics are caught at the dispatch level via dispatch_event() with catch_unwind when crash_on_plugin_panic is false. Net task instant dispatches (chat, commands) are also caught and logged. Net task panics are monitored via JoinHandle and logged without crashing the server. Skin fetch failures are logged with context.
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
Option<Arc<World>>set viaset_world()at server startupSystemContext::world()returns this reference instead of panickingctx.world()is called during system dispatchTest plan