feat: colour opponents' mods by server mod policy#469
Draft
ChronoFinale wants to merge 1 commit into
Draft
Conversation
Receive the server's banned/approved mod policy (setModPolicy action) and colour each opponent mod in the lobby list: red (banned), green (approved), white (unknown). Unknown stays white — we never auto-flag what we can't classify. - matchmaking.lua: classify_mod / get_banned_mods match the policy case- and punctuation-insensitively, with version-prefix matching and a dash-boundary heuristic so a glued "id-version" wire string still resolves (e.g. "Saturn-0.2.2-E"). The approved list mirrors banned. - action_handlers.lua: setModPolicy handler sets MP.BANNED_MODS / MP.APPROVED_MODS. - lobby.lua: colour mod rows via classify_mod. - start_ready_button.lua: banned warning text uses light/white (readable on the lobby background). - core.lua: MP.APPROVED_MODS default fallback. Pairs with the server (BalatroMultiplayerAPI-Server), which sends the policy on lobby join, and the website (www), where staff manage the lists.
2a5db09 to
01a7251
Compare
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.
What this adds
Colours each opponent's mods in the lobby list by the server-driven mod policy: red (banned) / green (approved) / white (unknown). The server sends the policy via a
setModPolicyaction; unknown mods stay white — we never auto-flag something we can't classify.This is the client piece. It pairs with:
BalatroMultiplayerAPI-Server— sends the policy to a client on lobby join.www— where staff manage the banned/approved lists (the source of truth).Changes
networking/action_handlers.lua—setModPolicyhandler setsMP.BANNED_MODS/MP.APPROVED_MODS.lib/matchmaking.lua—classify_mod/get_banned_modsmatch the policy case- and punctuation-insensitively, with version-prefix matching (1.0.0matches1.0.0~BETA) and a dash-boundary heuristic so a gluedid-versionwire string still resolves (e.g.Saturn-0.2.2-E). Approved list mirrors banned. The normalized index is cached per source table.ui/lobby/lobby.lua— colour each mod row viaclassify_mod.ui/lobby/start_ready_button.lua— the banned-mods warning text uses light/white (reads better than red on the lobby background).core.lua—MP.APPROVED_MODSdefault fallback.Notes
true= all versions,"1.2.3"= one version,["1.0","1.1"]= a set.Verification
Tested end-to-end locally: edit lists on the website → server polls and pushes
setModPolicyon lobby join → opponent mods colour red/green/white in the lobby, with the generic banned-mods warning.