Expand description
Shared field-validation tags for mod-authored inputs.
A validation tag on a crate::ui::UiField or a
crate::mod_config::ModParameter names a rule set that both the
launcher (live, while the user types) and the backend (authoritative,
on receipt) enforce identically. The rules live here, one module, so
the client-side refusal and a server-side one can never drift apart:
the tournament room-name check is mirrored in PHP by contract, and
both sides quote the same limits and charsets.
Two tags ship with this launcher generation:
PLAYER_NAME_TAG, the tournament player identity: 1 to 9 ASCII letters. The name travels inside every replay.datand lands in the game’s high-times table, so it stays as narrow as the game’s own name handling needs.ROOM_NAME_TAG, the room display name: up to 24 printable extended-ASCII characters (what a 1999 Windows application displays without surprises: ASCII 0x20-0x7E plus the Latin-1 supplement 0xA0-0xFF; the name lands in ANSI game files). Empty is valid, the server autogenerates a snowboarding word pair for it.
Unknown tags are rejected by ModUi::validate / ModConfig::validate
(parse liberally, validate strictly, same mechanism as unknown popup
kinds) so a newer mod on an older launcher reports itself instead of
silently skipping the check.
Constants§
- KNOWN_
TAGS - Every tag this launcher generation knows.
- PLAYER_
NAME_ TAG - The tournament player-name rule: 1 to 9 ASCII letters (a-z, A-Z).
- ROOM_
NAME_ TAG - The room display-name rule: up to 24 printable extended-ASCII characters, empty means the server autogenerates one.
Functions§
- is_
known_ tag - Whether
tagnames a rule set this launcher enforces. - validate_
player_ name - The player-name rule set: trimmed, 1 to 9 ASCII letters. Returns the trimmed name, or the reason the input was refused.
- validate_
room_ name - The room-name rule set: empty is fine (server autogenerates), otherwise up to 24 printable extended-ASCII characters.
- validate_
value - Validates one value against the rule set
tagnames.