Skip to content

perf: batch join tab-list sync into a single CPlayerInfoUpdate - #550

Draft
carabistouflette wants to merge 1 commit into
Steel-Foundation:masterfrom
carabistouflette:pr9-join-tablist-batching
Draft

carabistouflette wants to merge 1 commit into
Steel-Foundation:masterfrom
carabistouflette:pr9-join-tablist-batching

Conversation

@carabistouflette

Copy link
Copy Markdown
Contributor

Type of change

  • Block implementation
  • Item implementation
  • Command implementation
  • Entity implementation
  • Bug fix
  • New feature
  • Breaking change
  • Refactor / code cleanup
  • Performance improvement

Description

Batches tab-list initialization for joining players. sync_tab_list previously queued O(N) create_player_initializing packets plus an optional update_chat_session packet per online player to the joiner. Mirroring vanilla PlayerList.placeNewPlayer, the joiner now receives a single CPlayerInfoUpdate whose entries carry every online player with their chat session data attached directly via the InitializeChat action. The broadcast announcing the joiner to existing players is unchanged.

CPlayerInfoUpdate::create_player_initializing_entry is extracted so single-entry and batched construction share one code path.

How this was tested

  • New regression test sync_tab_list_sends_single_batched_update_to_joiner: with two existing players, the joiner receives exactly one tab-list packet and each existing player receives exactly one join announcement.
  • cargo test -p steel-core --lib (2422 tests) pass; cargo clippy -r --all-targets clean.

Screenshots / logs

N/A.

Checklist

  • Code builds w/o errors or warnings
  • Self-reviewed the diff
  • Docs updated (if applicable) — N/A
  • No leftover debug code / comments

Additional notes

  • Env: Linux, Rust nightly, Minecraft protocol 776 (0.15.2+mc26.2).

@github-actions

Copy link
Copy Markdown

This pull request has conflicts with the base branch "master". Please resolve those so we can test out your changes.

sync_tab_list previously queued O(N) create_player_initializing packets plus
an optional update_chat_session packet per online player to the joiner.
Mirroring vanilla PlayerList.placeNewPlayer, the joiner now receives one
PLAYER_INFO_INIT_ACTIONS update whose entries carry every online player with
their chat session data attached directly.

Adds CPlayerInfoUpdate::create_player_initializing_entry so single-entry and
batched construction share one code path, plus a regression test asserting
the joiner receives exactly one packet.
@github-actions

Copy link
Copy Markdown

Conflicts have been resolved! 🎉

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

This pull request has conflicts with the base branch "master". Please resolve those so we can test out your changes.

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

Conflicts have been resolved! 🎉

@github-actions

Copy link
Copy Markdown

This pull request has conflicts with the base branch "master". Please resolve those so we can test out your changes.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants