GameServerService.normalizeSpacecraftListEvent drops spacecraft velocity fields #1006

Closed
opened 2026-08-12 06:25:38 +00:00 by spikerj · 1 comment
Owner

Summary

normalizeSpacecraftListEvent maps position/rotation/mass/docking fields from PascalCase or camelCase, but never maps VelocityX/Y/Z (or camelCase equivalents) onto the normalized spacecraft objects.

handleSpacecraftList then seeds _entityStateCache with sc.velocityX ?? 0 (always 0), so initial list velocities from the server are discarded.

Repro

Unit coverage in game-server.events-space.spec.ts (Wave 6 a5): fire a SpacecraftList with VelocityX/velocityX set — cache entry velocity stays 0.

Expected

Normalize should include velocityX/Y/Z from VelocityX/Y/Z or camelCase, and the entity-state cache should seed those values.

Location

projects/spikersoft/src/app/_services/game-server/game-server.service.ts — normalizeSpacecraftListEvent / handleSpacecraftList.

## Summary `normalizeSpacecraftListEvent` maps position/rotation/mass/docking fields from PascalCase or camelCase, but never maps `VelocityX/Y/Z` (or camelCase equivalents) onto the normalized spacecraft objects. `handleSpacecraftList` then seeds `_entityStateCache` with `sc.velocityX ?? 0` (always `0`), so initial list velocities from the server are discarded. ## Repro Unit coverage in `game-server.events-space.spec.ts` (Wave 6 a5): fire a `SpacecraftList` with `VelocityX`/`velocityX` set — cache entry velocity stays `0`. ## Expected Normalize should include `velocityX/Y/Z` from `VelocityX/Y/Z` or camelCase, and the entity-state cache should seed those values. ## Location `projects/spikersoft/src/app/_services/game-server/game-server.service.ts` — `normalizeSpacecraftListEvent` / `handleSpacecraftList`.
Author
Owner

Already on master (not part of PR #819). normalizeSpacecraftListEvent already maps VelocityX/Y/Z onto the entity-state cache. Closing.

Already on `master` (not part of PR #819). normalizeSpacecraftListEvent already maps VelocityX/Y/Z onto the entity-state cache. Closing.
Sign in to join this conversation.