Skip to content

feat: colour opponents' mods by server mod policy#469

Draft
ChronoFinale wants to merge 1 commit into
Balatro-Multiplayer:devfrom
ChronoFinale:feat/mod-policy
Draft

feat: colour opponents' mods by server mod policy#469
ChronoFinale wants to merge 1 commit into
Balatro-Multiplayer:devfrom
ChronoFinale:feat/mod-policy

Conversation

@ChronoFinale

@ChronoFinale ChronoFinale commented Jun 17, 2026

Copy link
Copy Markdown

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 setModPolicy action; unknown mods stay white — we never auto-flag something we can't classify.

This is the client piece. It pairs with:

Changes

  • networking/action_handlers.luasetModPolicy handler sets MP.BANNED_MODS / MP.APPROVED_MODS.
  • lib/matchmaking.luaclassify_mod / get_banned_mods match the policy case- and punctuation-insensitively, with version-prefix matching (1.0.0 matches 1.0.0~BETA) and a dash-boundary heuristic so a glued id-version wire 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 via classify_mod.
  • ui/lobby/start_ready_button.lua — the banned-mods warning text uses light/white (reads better than red on the lobby background).
  • core.luaMP.APPROVED_MODS default fallback.

Notes

  • Backwards-compatible policy value semantics (mirrors the server): true = all versions, "1.2.3" = one version, ["1.0","1.1"] = a set.
  • Matching is currently punctuation-insensitive; the website treats punctuation as significant, so the client matches slightly more leniently. For real SMODS ids (unique well beyond punctuation) this never produces a wrong match. Tightening the client to match exactly is a trivial follow-up if desired.

Verification

Tested end-to-end locally: edit lists on the website → server polls and pushes setModPolicy on lobby join → opponent mods colour red/green/white in the lobby, with the generic banned-mods warning.

@ChronoFinale ChronoFinale reopened this Jun 24, 2026
@ChronoFinale ChronoFinale marked this pull request as draft June 24, 2026 13:21
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.
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.

1 participant