isle-portable/LEGO1/lego/legoomni/src
foxtacles a9747dec11
Character customization (#8)
* WIP: Add character customization to multiplayer

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Refine character customization: fix message buffering, DRY up code, request-based model

- Register NetworkManager with TickleManager via HandleCreate hook in
  LegoOmni::Create(), so packets are processed continuously instead of
  buffering between Connect() and OnWorldEnabled()
- Spawn unspawned remote players in OnWorldEnabled() (created before
  world was ready)
- Switch to request-based customization: HandleROIClick sends
  MSG_CUSTOMIZE to server, server echoes to all peers, HandleCustomize
  applies state and plays effects
- DRY up SwitchVariant to delegate LOD cloning to ApplyHatVariant
- Add ApplyChange helper consolidating the switch-on-changeType pattern
- Fix InitFromActorInfo to derive dependent color parts from independent
  parts (matching Unpack rules)
- Remove dead code: m_hasBeenTicked, ApplyCustomizeChange on
  RemotePlayer, m_localCustomizeState on NetworkManager
- Add null ROI checks in HandleCustomize for unspawned players
- Move MSG_CUSTOMIZE constant to shared protocol.ts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix

* Fix character customization bugs from code review

- BUG-1: Add bounds check in SwitchColor to prevent OOB access from
  unvalidated network input (p_partIndex could exceed array bounds)
- BUG-2: Enforce allowRemoteCustomize on receiver side in HandleCustomize
  (was only checked on sender side, byppassable by malicious client)
- BUG-3: Document stale-state sound asymmetry for remote targets
- OBS-1: Remove unused bodyVariantIndex from CustomizeState (never
  modified, wasted 3 bits per state message)
- NAME-1: Fix p_ prefix convention on ApplyCustomizeChange parameters
2026-03-07 23:20:55 +01:00
..
actors 3rd person camera (#3) 2026-03-07 01:38:45 +01:00
audio Fix: missing pending action reset on background audio start failure (#684) 2025-08-19 23:36:20 +00:00
build Merge remote-tracking branch 'isle/master' 2026-01-30 17:06:10 -08:00
common Character customization (#8) 2026-03-07 23:20:55 +01:00
control Merge remote-tracking branch 'isle/master' 2025-07-29 16:47:18 -07:00
entity Use consistent Extension call pattern in legoentity and legoworld 2026-03-01 10:40:17 -08:00
input Character customization (#8) 2026-03-07 23:20:55 +01:00
main Character customization (#8) 2026-03-07 23:20:55 +01:00
paths 3rd person camera (#3) 2026-03-07 01:38:45 +01:00
race Merge remote-tracking branch 'isle/master' 2026-01-30 17:06:10 -08:00
video Merge remote-tracking branch 'isle/master' 2026-01-30 17:06:10 -08:00
worlds Merge remote-tracking branch 'isle/master' 2026-01-30 17:06:10 -08:00