Commit 534ea34
committed
Prep v1 launch: client-auth online (Spark), AI fixes, security, cleanup
Online multiplayer (works on the free Spark plan, no Blaze/Cloud Functions):
- Convert to client-authoritative resolution: the defender resolves each shot
on-device and settles turn/winner. database.rules.json now permits this while
preserving the invariants that don't need a trusted server — ship boards stay
private, only the two participants can touch a game, shot coordinates are locked
after firing, a shooter cannot forge its own result, and winner/turn must be a
real participant.
- Add SERVER_AUTHORITATIVE flag (false) so the client skips the (absent) Cloud
Functions and resolves locally. Flip to true after upgrading to Blaze + deploying
functions to restore server-side anti-cheat.
- Update rules-tests to cover the client-authoritative model.
AI:
- Fix Medium AI targeting: derive lock direction from the second hit and walk the
full hit-line from the origin (no longer strands a half-sunk ship), and fully
reset targeting state on exhaustion (no stale state bleeding across ships).
Guarded by new regression tests.
- Replace generateAiPlacements' uncapped retry loop with GameEngine.autoPlace()
(guaranteed termination, honours adjacency mode).
Security:
- Harden resolveShot Cloud Function: resolve from the stored shot coordinates and
refuse to re-resolve an already-resolved shot (for the future Blaze path).
Play Games:
- Remove the unused leaderboard/achievement code and the placeholder 000000000000
App ID for v1 (dead code + latent SDK-init crash risk).
Repo hygiene:
- Remove graphify-out/ cache, smoke screenshots, stray scripts and zero-byte
artifacts; untrack the confidential security-audit docs (kept on disk); ignore
node_modules/, logs and crash dumps; commit function/rules-tests lockfiles.
- Keep PRODUCTION-CHECKLIST.md current with the Spark deploy path.1 parent 7cc99c4 commit 534ea34
281 files changed
Lines changed: 5304 additions & 28564 deletions
File tree
- app
- src/main
- kotlin/com/battleship/fleetcommand/games
- res/values
- core
- ai/src
- main/kotlin/com/battleship/fleetcommand/core/ai
- test/kotlin/com/battleship/fleetcommand/core/ai
- multiplayer/src/main/kotlin/com/battleship/fleetcommand/core/multiplayer/repository
- feature/game/src/main/kotlin/com/battleship/fleetcommand/feature/game/battle
- functions
- gradle
- graphify-out
- cache/ast
- rules-tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
This file was deleted.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
0 commit comments