feat(server): implement live map hot-reload without restarting server (closes #11) - #364
Open
ThiagoLPereira wants to merge 4 commits into
Open
ThiagoLPereira wants to merge 4 commits into
ThiagoLPereira wants to merge 4 commits into
Conversation
added 3 commits
September 8, 2026 01:42
…ebSocket broadcast tests
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
Resolves #11 by introducing live map hot-reloading capabilities without requiring a server reboot.
Key Changes
server/src/loadMaps.ts):reloadMap(mapNum)andreloadAllMaps().vars.mapData.findNearestWalkableTile()safe-warp resolution: if a new map version places a blocked tile on an active entity coordinate, the entity is automatically relocated to the nearest walkable tile within a 5-tile radius.reconcileEntities()generic helper to ensure DRY compliance and unified entity restoration.server/src/gameDataSync.ts):reloadMapsDiff()bridge.notifyCharactersOnReloadedMaps()to broadcast real-time map updates to connected WebSockets on affected maps.server/src/commands.ts):/recargarmapa [id]: Reloads a specific map by numeric ID./recargarmapas: Batch reloads all available maps.hasAdminPrivileges(user).server/tests/):server/tests/reloadMaps.test.ts: 5/5 unit tests covering entity preservation, safe-warp, non-existent map handling, and sync bridge.server/tests/e2e_runtime_verification.test.ts: Comprehensive end-to-end runtime lifecycle simulation.Verification & Quality Gates
tsc --noEmit: 0 errorseslint ./src/**/*.ts: 0 errors, 0 warningstsx --test): 6/6 tests passing