feat(rust): the live map draws monuments by label, minor labels hidden (PLAN_REDESIGNS §4, D196)

A switch per monument label, a fleet default and a per-server override, on
Admin -> Rust visibility's live map card. Substations, caves, train tunnels,
wells and the other minor labels start hidden; every other label is drawn,
so a monument a game update adds appears. GET /map leaves hidden labels out
of the answer, so the website and the app both lose them.

No schema change: rows are map.marker.<label key> in rust_settings and
rust_map_overrides. No wire change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
This commit is contained in:
2026-09-29 12:10:47 -05:00
parent eb184aaac8
commit 0da8f44b55
12 changed files with 759 additions and 26 deletions

View File

@@ -25,6 +25,22 @@ async function setSetting(key, value, userId = null) {
)
}
/**
* Every stored setting whose key starts with `prefix`, as `{ setting, value }`
* rows: the map's per-label marker switches are one row each (D196).
*/
async function listSettings(prefix) {
return core.query(
`SELECT setting_key AS setting, value FROM ${SETTINGS} WHERE setting_key LIKE CONCAT(?, '%')`,
[prefix.replace(/[\\%_]/g, '\\$&')],
)
}
/** Forget one setting, so it follows the built-in default again. */
async function clearSetting(key) {
await core.query(`DELETE FROM ${SETTINGS} WHERE setting_key = ?`, [key])
}
/** One server's override, `null` for "inherit", or `undefined` when there is no such server. */
async function getServerPresence(serverId) {
const rows = await core.query(`SELECT presence_audience AS presence FROM ${SERVERS} WHERE id = ?`, [serverId])
@@ -69,6 +85,8 @@ async function setServerNewsDelivery(serverId, delivery) {
module.exports = {
getSetting,
setSetting,
listSettings,
clearSetting,
getServerPresence,
listServerPresence,
setServerPresence,