Skip to content

fix: Address 4 critical codebase issues#1147

Merged
braedonsaunders merged 1 commit into
mainfrom
claude/review-codebase-quality-15ML8
Jan 30, 2026
Merged

fix: Address 4 critical codebase issues#1147
braedonsaunders merged 1 commit into
mainfrom
claude/review-codebase-quality-15ML8

Conversation

@braedonsaunders

Copy link
Copy Markdown
Owner
  1. Add 8 missing naval abilities (abilities.ts)

    • boost, flak_barrage, submerge, depth_charge_defense
    • beach_assault, amphibious_mode, shore_bombardment, yamato_cannon
    • Prevents runtime errors when naval units try to use abilities
  2. Implement multiplayer lockstep barrier (Game.ts, GameCommand.ts)

    • Add HEARTBEAT command type for tick synchronization
    • Implement hasAllCommandsForTick() barrier check
    • Add heartbeat sending for ticks without player actions
    • Add timeout handling to prevent infinite hangs
    • Ensures both players execute same commands per tick
  3. Add projectileType cross-reference validation (DefinitionValidator.ts)

    • Validates unit.projectileType references exist
    • Validates transformMode.projectileType references
    • Validates building.projectileType for turrets
    • Optional parameter maintains backwards compatibility
  4. Refactor debug logger to use factory function (debugLogger.ts)

    • Reduces 118 lines of boilerplate to 38 lines
    • createCategoryLogger() factory generates all loggers
    • Same public API, no breaking changes

https://claude.ai/code/session_01AxoTtAx1mKqsWq21g8h5Rf

1. Add 8 missing naval abilities (abilities.ts)
   - boost, flak_barrage, submerge, depth_charge_defense
   - beach_assault, amphibious_mode, shore_bombardment, yamato_cannon
   - Prevents runtime errors when naval units try to use abilities

2. Implement multiplayer lockstep barrier (Game.ts, GameCommand.ts)
   - Add HEARTBEAT command type for tick synchronization
   - Implement hasAllCommandsForTick() barrier check
   - Add heartbeat sending for ticks without player actions
   - Add timeout handling to prevent infinite hangs
   - Ensures both players execute same commands per tick

3. Add projectileType cross-reference validation (DefinitionValidator.ts)
   - Validates unit.projectileType references exist
   - Validates transformMode.projectileType references
   - Validates building.projectileType for turrets
   - Optional parameter maintains backwards compatibility

4. Refactor debug logger to use factory function (debugLogger.ts)
   - Reduces 118 lines of boilerplate to 38 lines
   - createCategoryLogger() factory generates all loggers
   - Same public API, no breaking changes

https://claude.ai/code/session_01AxoTtAx1mKqsWq21g8h5Rf
@braedonsaunders braedonsaunders merged commit d1965e6 into main Jan 30, 2026
@braedonsaunders braedonsaunders deleted the claude/review-codebase-quality-15ML8 branch January 30, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants