feat(api): NPC place/move/remove on worldBuilder drafts (#8) - #358
Open
Aduersarius wants to merge 1 commit into
Open
feat(api): NPC place/move/remove on worldBuilder drafts (#8)#358Aduersarius wants to merge 1 commit into
Aduersarius wants to merge 1 commit into
Conversation
Wire construction-mode NPC placement into Postgres drafts with catalog, blocked-terrain, no-stack, and MAX_NPCS_PER_MAP checks. Self-tile moves are a no-op success. movement persists in entity meta through publish.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ships OpenAO #8 on top of the existing
/construccionworld-builder draft/publish stack.game_map_tile_entitiesdrafts (kind=npc)game_npcs(404 +invalid_npc_index)terrain.jsonpalette/rows + layer-1 draft/published overridesMAX_NPCS_PER_MAP = 50as a single named constantmovementstored in entitymetaand copied on publishapi/src/lib/mapNpcPlacement.ts,api/src/tests/mapNpcPlacement.test.ts(7/7)Closes #8
Admin routes
GET /admin/game-data/maps/:mapNum/npcsPOST /admin/game-data/maps/:mapNum/npcsPOST /admin/game-data/maps/:mapNum/npcs/moveDELETE /admin/game-data/maps/:mapNum/npcs/:x/:yDifferentiation vs open PRs
map-npc-servicekitchen-sink (exits/moderation/protocol/FE). Fake catalog bounds 1–340, not wired to real drafts/Postgres. This PR is #8-only on the live worldBuilder draft/publish path.npcs.jsonon disk outside the draft/publish model. No blocked check against draft tile overrides, nometa.movementpublish survival. This PR uses Postgres drafts, terrain+override collision, named limit, and self-move no-op.Test plan
cd api && npx tsx --test src/tests/mapNpcPlacement.test.ts(7/7)metacolumn)npcIndex→ 404tile_blockedtile_occupiedmap_npc_limitGET /maps/:id/overridesentities include npc + meta.movementNo txs/keys/funds involved.