Skip to content

feat(api): floor objects, doors, signs, and atomic structures (#9) - #357

Open
Aduersarius wants to merge 1 commit into
Bitcoindefi:mainfrom
Aduersarius:feat/map-objects-doors-structures-9
Open

feat(api): floor objects, doors, signs, and atomic structures (#9)#357
Aduersarius wants to merge 1 commit into
Bitcoindefi:mainfrom
Aduersarius:feat/map-objects-doors-structures-9

Conversation

@Aduersarius

Copy link
Copy Markdown

Summary

Ships OpenAO #9 on top of the existing /construccion world-builder draft/publish stack.

  • Floor objects: place with catalog-validated objIndex, optional amount (capped), atomic move, remove via existing entity delete
  • Structures: atomic multi-tile paint on layers 3/4 (uses existing paintTiles TX) + bounding-box metadata for entity-with-area editing
  • Doors: place + open|closed state; closed doors write blocked=true on layer-1 override in the same TX
  • Signs/carteles: place with associated text in meta
  • Schema: game_map_tile_entities.amount + meta; publish copies both so they survive reload
  • Pure helpers + unit tests: api/src/lib/mapObjectPlacement.ts, api/src/tests/mapObjectPlacement.test.ts (6/6)

Closes #9

Admin routes

  • PUT /admin/game-data/maps/:mapNum/objects
  • POST /admin/game-data/maps/:mapNum/objects/move
  • PUT /admin/game-data/maps/:mapNum/structures
  • PUT /admin/game-data/maps/:mapNum/doors
  • POST /admin/game-data/maps/:mapNum/doors/:x/:y/state
  • PUT /admin/game-data/maps/:mapNum/signs

Differentiation vs open PRs

PR Gap vs this
#64 (angelTomo9) In-memory map-entities service bundled with protocol/FE/converter kitchen-sink. This PR is #9-only, wired into real worldBuilder drafts + Postgres + admin HTTP.
#78 (Rodrigoue9) place/remove/structure/door on worldBuilder, but no atomic move, no signs/text, no amount economy cap, and publish path does not carry amount/meta. This PR adds move + signs + amount/meta publish survival and pure unit-tested placement rules.

Test plan

  • node --experimental-strip-types --test api/src/tests/mapObjectPlacement.test.ts (6/6)
  • Apply schema (amount/meta columns)
  • Admin: place object with amount → move → publish → GET /maps/:id/overrides entities include amount/meta
  • Place structure across layers 3/4 in one request; invalid layer 2 rejected
  • Place door closed → tile blocked draft; set state open → unblocked
  • Place sign with text; empty text rejected
  • Unknown objIndex → 404

No txs/keys/funds involved.

…ndefi#9)

Extends world-builder drafts with catalog-validated floor objects (amount +
atomic move), multi-tile layer 3/4 structures, doors that sync blocked state,
and text signs. Pure placement helpers are unit-tested; amount/meta survive publish.
@gitar-bot

gitar-bot Bot commented Sep 6, 2026

Copy link
Copy Markdown

Important

You are using the Gitar free plan. Upgrade to unlock code review, CI analysis, auto-apply, custom automations, and more.

Gitar

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.

Etapa 2: colocacion de objetos, estructuras y puertas

1 participant