feat(client): admin minimap + click-to-/tp (#237) #244
No reviewers
Labels
No labels
alpha:wave-0
alpha:wave-1
alpha:wave-2
alpha:wave-3
area:assets
area:combat
area:ecology
area:infra
area:render
area:scripting
area:ui
area:world
enhancement
epic
migration
post-alpha
roadmap
tech-debt
type:bug
type:chore
type:design
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
marco/IsoMmo!244
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/admin-minimap"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
An admin-only minimap (#237): a baked top-down overview of the whole world (asterra), shown top-right, zoomable with the mouse wheel (cursor-centred) and pannable, with the player marked. Clicking teleports there via a server-validated
/tp x y.It is drawn only for admins (
AdminPanel.IsAdmin, a UI gate); the click sends the sameGmCommandRequesta/tpchat command would, so the server re-checks the signedadminclaim and validates the target is a walkable tile — the client never moves the player itself. Wanted so an admin can jump anywhere on the 13,344×9,984-cell planet without walking or typing coordinates.Architecture:
MinimapBaker(Client.Core, MonoGame-free, unit-tested) bakes the wholeIReadOnlyTileMapinto a packed-RGBAuint[](one terrain tint per sampled cell) once at load.Minimap(client UI) uploads it to aTexture2Dand draws a zoom/pan view + marker;TryPickmaps a screen pixel back to a world cell. Wired thinly intoGameScreen(build + dispose),WorldRenderer(draw if admin) andGameInputController(M toggle, wheel zoom, click →tp), with the minimap added to the panel-hit guard so a minimap click never also moves/engages the player. No new wire type (reusesGmCommandRequest) → noProtocolVersionbump.Screenshots / recording
Piloted via the debug harness (
docs/debug-harness.md), fresh DB, as admintest:mm_overview.pngTeleported, player is now on the distant continent region (~7760,5296, far from spawn ~5183,4378); the minimap here is zoomed in on the continent, done live with the mouse wheel:mm_teleported.pngHow it was tested
tests/IsoMmo.Client.Core.Tests/MinimapBakerTests.cs):Bakesamples the terrain tint at each sampled cell;CellAtmaps a minimap pixel back to its world cell.· /admin),Mtoggles it, the wheel zooms, and a click teleports — the server loggedtp 7760 5296 -> Teleportedand the client reconciled its self position to the exact clicked cell(7760,5296).GmCommandRequestmust carry the command without the leading/(the registry looks uptp, not/tp) — the first click logged/tp … -> UnknownCommand.dotnet csharpier check .clean ·dotnet build IsoMmo.slnx0 warnings / 0 errors ·dotnet test IsoMmo.slnxall green (739 tests, incl. the 2 newMinimapBakertests).Checklist
just lintpasses (CSharpier + analyzers, zero warnings)just testis greenMinimapBakerTests)