Skip to content

Add client lifecycle handler registration boundary#124

Merged
ogyrec-o merged 1 commit into
mainfrom
feat/issue-123-client-lifecycle-state-boundary
May 28, 2026
Merged

Add client lifecycle handler registration boundary#124
ogyrec-o merged 1 commit into
mainfrom
feat/issue-123-client-lifecycle-state-boundary

Conversation

@ogyrec-o

Copy link
Copy Markdown
Member

Summary

Adds the SDK-facing registration boundary for stateful client lifecycle handlers.

This introduces:

  • ClientLifecycleHandler
  • AvatarLifecycleRegistrationExt::register_client_lifecycle_handler
  • hidden ModContext / ModContextBackend plumbing for runtime implementations

This is the SDK half of #123 and is needed before implementing bounded Vanilla client terrain intent aggregation in frevenengine/freven-vanilla#94.

Why

Vanilla block interaction currently uses stateless function hooks:

  • on_start_client(fn)
  • on_tick_client(fn)

That is not sufficient for small deterministic per-client-session state such as a bounded near-frame terrain intent cancel window. Using process-global state in Vanilla would be the wrong long-term boundary.

This PR adds a typed SDK registration surface so the runtime can own one mutable client lifecycle handler per mod/client session.

Boundaries

  • SDK API/registration boundary only.
  • No runtime implementation in this PR.
  • No Vanilla behavior changes.
  • No server authority changes.
  • No client prediction as authority.
  • No protocol changes.
  • No process-global state workaround.
  • Runtime implementation is expected in frevenengine/freven-engine after this lands.

Validation

  • cargo +stable check --locked -p freven_avatar_api
  • cargo +stable check --locked -p freven_world_api
  • cargo +stable test --locked --workspace
  • cargo +stable clippy --locked --workspace --all-targets -- -D warnings
  • cargo +stable fmt --all -- --check
  • git --no-pager diff --check

Related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant