PlayerSync/src/main/java/vip/fubuki/playersync
laforetbrut f1540c8210 Phase 12: batch-prefetch storage contents for restore
Spark profile confirmed 'restoreSophisticatedStorageItems' and its single-item
helpers as hot paths on the server main thread. The prior restore did:

  for each backpack/shulker/disk in the player's inventory:
      SELECT backpack_nbt FROM backpack_data WHERE uuid = ?
      deserialize
      apply

With a player carrying 3 backpacks + 2 shulkers + 4 RS2 disks this was
9 sequential blocking SELECTs on the main thread — adding ~9 round-trips
of MySQL latency to the restore window.

Adds two helpers:

  ModsSupport.prefetchStorageContents(Collection<UUID>)
      → single SELECT with WHERE uuid IN (?,?,?,...) returning a
        Map<UUID, CompoundTag>. Shares the parsing path (BNBT: prefix,
        legacy Base64, snbt fallback) with restoreStorageContents so
        any serialization quirk handled there is handled here.

  ModsSupport.collectBackpackUuids(Player, includeEnderChest)
      → UUID-only scan without any DB work, used by the restore path
        to build the prefetch list.

No behavior change yet — the helpers are wired in a follow-up commit
that plugs them into doPlayerJoin's apply phase.
2026-04-22 07:57:56 +02:00
..
config Phase 9: cap wait time on alive-peer ghost sessions (fixes 30-60s join delay) 2026-04-22 07:16:47 +02:00
sync Phase 12: batch-prefetch storage contents for restore 2026-04-22 07:57:56 +02:00
util Phase 8: 20+ new config keys + 14 admin commands (/playersync) 2026-04-22 06:34:02 +02:00
CommandInit.java Add /playersync inventory viewer 2026-04-22 07:03:08 +02:00
PlayerSync.java Tutorial banner when MySQL init fails on a dedicated server 2026-04-22 06:55:20 +02:00