fix(sync): use GlobalComponentRegistry for network sync decoding (#392)

- Decoder.ts now uses GlobalComponentRegistry.getComponentType() instead of local registry
- @sync decorator uses getComponentTypeName() to get @ECSComponent decorator name
- @ECSComponent decorator updates SYNC_METADATA.typeId when defined
- Removed deprecated registerSyncComponent/autoRegisterSyncComponent functions
- Updated ComponentSync.ts in network package to use GlobalComponentRegistry
- Updated tests to use correct @ECSComponent type names

This ensures that components decorated with @ECSComponent are automatically
available for network sync decoding without any manual registration.
This commit is contained in:
YHH
2025-12-30 09:39:17 +08:00
committed by GitHub
parent 449bd420a6
commit a08a84b7db
10 changed files with 63 additions and 59 deletions

View File

@@ -32,6 +32,9 @@
export { ECSRoom } from './ECSRoom.js';
export type { ECSRoomConfig } from './ECSRoom.js';
// Re-export Player for convenience
export { Player, type IPlayer } from '../room/Player.js';
// Re-export commonly used ECS types for convenience
export type {
Entity,