Skip to content

feat(maps): live publish hot-reload without server restart (#11) - #346

Open
Aduersarius wants to merge 1 commit into
Bitcoindefi:mainfrom
Aduersarius:feat/live-map-publish-hot-reload-11
Open

feat(maps): live publish hot-reload without server restart (#11)#346
Aduersarius wants to merge 1 commit into
Bitcoindefi:mainfrom
Aduersarius:feat/live-map-publish-hot-reload-11

Conversation

@Aduersarius

Copy link
Copy Markdown

Summary

Implements OpenAO #11: publishing a construction-mode map applies live without restarting the game server, notifies players on that map, relocates anyone trapped on newly blocked tiles, and invalidates the client map cache so graphics/blocks refresh without reconnecting.

Closes #11

How it works

  1. Admin POST /admin/game-data/maps/:mapNum/publish still promotes draft → published in Postgres.
  2. API then calls the game server POST /internal/maps/:mapNum/hot-reload (auth via TOKEN_AUTH) when GAME_SERVER_INTERNAL_URL is set.
  3. Game server reloads published-only overrides (with baseline rollback for removed overrides), pushes blockMap deltas, relocates stuck players to the nearest walkable tile, and emits [MAP_LIVE_RELOAD] map=N version=V.
  4. Client intercepts that marker, invalidates mapValueCache, and re-applies /maps/:id/overrides in place.

GM fallback: /recargarmapa [n] and /recargarmapas.

Differentiation vs #74

Focused #11 PR (not a 6-issue mega-bundle). Adds publish→live notify, player unstuck, and client cache invalidation, which #74's GM-only /recargarmapa path does not cover.

Test plan

  • npx tsx --test server/src/tests/mapLivePublish.test.ts (nearest walkable, draft filter, blocked deltas, marker parse)
  • API unit contract test for published-only + liveReload response shape
  • Manual: edit draft tiles → publish with GAME_SERVER_INTERNAL_URL pointing at running game server → player on map sees blocks/graphics update; standing on new wall gets relocated
  • Confirm non-admin /maps/:id/overrides never returns draft rows

GrantFox OpenAO bounty submission for #11.

…fi#11)

Publish promotes drafts then notifies the game server to apply published
overrides in-process, relocate players trapped on new walls, and tell
clients to invalidate map cache so changes appear without reconnecting.
@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 3: publicar mapas en vivo sin reiniciar el server

1 participant