Repository navigation
feat(game): ask minimap mods to switch themselves off - #315
Merged
Merged
Conversation
Sends invisible colour-code system messages that Xaero's Minimap and VoxelMap obey, on every spawn. Configurable through minimap.mode (disabled, fair, off).
Contributor
Test results 588 files 588 suites 3m 42s ⏱️ Results for commit 934f313. ♻️ This comment has been updated with latest results. |
Answers the LabyMod 4 hello on labymod:neo with a hand-encoded permission packet denying entity_marker, following minimap.mode.
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.
Proposed changes
Cygnus now asks cooperating client minimap mods to switch themselves off, so nobody finds the slender or the pages on a radar. This is opt-in on the mods' side and cannot be enforced: modified clients and mods that do not know the convention ignore it.
Change.
MinimapPolicy(net.onelitefeather.cygnus.minimap, aGameFeature) sends one system chat message per code on everyPlayerSpawnEvent, so on join and again whenever a player spawns into another instance (lobby to map). The codes are sent as a literal text component, so the§characters reach the client raw and the line renders as an empty message.MinimapConfigwith keyminimap.mode:disabled(default; Xaero minimap off plus radar and cave mode off),fair(map allowed, radar and cave mode off),off(nothing sent, the feature is not registered). An unknown value is logged and replaced by the default. Documented inconfig.properties.example.Codes.
disabled§n§o§m§i§n§i§m§a§p,§f§a§i§r§x§a§e§r§o,§3 §6 §3 §6 §3 §6 §e,§3 §6 §3 §6 §3 §6 §dfair§f§a§i§r§x§a§e§r§o,§3 §6 §3 §6 §3 §6 §e,§3 §6 §3 §6 §3 §6 §doff§f§a§i§r§x§a§e§r§o= fair play (no entity radar, no cave mode),§n§o§m§i§n§i§m§a§p= no minimap. VoxelMap and compatible mods:§3 §6 §3 §6 §3 §6 §e= no radar,§3 §6 §3 §6 §3 §6 §d= no cave mode. There is no full-disable code for VoxelMap.Sources.
xaero:fairxaeroandxaero:nominimap): https://www.curseforge.com/minecraft/data-packs/xaeros-map-server-utilsModeManager.java)Listener.java)msg.contains(...)): https://github.com/umeow0716/Voxelmap-Forge (VoxelMap.java); also NoCheatPlusJourneyMapMOTD.java, which sends the same codes for "JourneyMap + VoxelMap".Types of changes
Checklist
Further comments
Test plan.
MinimapPolicyTest: join sends the expected strings per mode,offsends nothing and is disabled, spawning into a second instance resends, and the capturedSystemChatPacketcarries a literal text component with intact§signs, no children and nothing visible.GameConfigReaderTest/GameConfigTest: defaultdisabled, case-insensitive parsing, unknown value falls back, null mode rejected../gradlew :game:test :common:testis green.Entity radar check (report only). A radar shows what the client knows as entities. The hidden slender and spectators are not sent as entities to survivors:
VisibilityRules.slenderRule/spectatorRuleare installed viaupdateViewableRule(TeamHelper.java:84,SpectatorService.java:89), and the slender is only a viewer-visible entity while revealed by design. The Creaking body is limited to an explicit viewer set (CreakingBody.java:53). Dead survivors' mannequins are visible by design (PlayerDeathListener.java:70).LabyMod
Second commit,
feat(game): ask labymod to switch off unfair features.LabyModPolicyfollows the sameminimap.mode(offsends nothing and is not registered).labymod:neo; a packet is a VarInt id plus its fields. The client opens withVersionLoginPacket(id 0), which the official Minestom integration also waits for, so the policy answers only that hello. ThePermissionPacket(id 10) is a VarInt count, then per permission a VarInt-prefixed UTF-8 identifier and one boolean byte. This is hand-encoded (about 15 lines) instead of depending on the Server API; the tests pin the exact bytes (0A 01 0D "entity_marker" 00).entity_marker. The client'sDefaultPermissionRegistryregistersimproved_lava,crosshair_sync,refill_fix,range,slowdown,entity_marker,gui_*,chat_autotext,blockbuild,sneaking*,tags,chat,animations,saturation_bar. None of them is a minimap, radar or waypoint permission: LabyMod 4 has no such built-in feature.entity_marker(lets a player mark an entity) is the only one that could point at other players, and it is off by default, so denying it only makes that explicit. The other permissions are cosmetic or gameplay tweaks and carry no map information, so they are left alone. Third-party minimap addons would have to be disabled throughAddonDisablePacket(id 24) by addon namespace; no namespace could be verified, so that is not done.labymod3:mainmessagePERMISSIONS(a JSON object ofname: boolean) into the same packet, so no separate legacy path is sent.Sources:
PermissionPacket,PayloadWriter,VersionLoginPacket, Minestom handler): https://github.com/LabyMod/labymod4-server-apiPERMISSIONStranslation (decompiled client dump): https://github.com/6lyxt/labymod-4-dump (DefaultPermissionRegistry.java,PermissionTranslationListener.java)