feat(walls): proto 2 typed wall record, inert geometry, derived kind (#54)
wall.add/wall.update take thickness, position, height and the eight raw switches; kind is output-only and the GM wall frames echo the full typed record. Geometry is stored but inert (0/full/centre behaviour), and the legacy kind/open wire adapter is gone. proto is bumped to 2 with the harness default, and BannedAlways gains every wall field name with a WALLDATA positive control. Tests: schema-7 migrated scene vs the same walls authored via raw switches gives byte-identical player frames, refusals and per-tile statuses. Nim 382 / Node 113 green.
This commit is contained in:
+6
-3
@@ -36,7 +36,10 @@ const
|
||||
AllowedTypes = ["hello", "ack", "roster", "token", "token_gone", "vision", "explored",
|
||||
"character", "character_gone", "encountered"]
|
||||
BannedAlways = ["walls", "wall", "wall_gone", "a", "b", "open", "kind", "controller", "gm_only",
|
||||
"flags", "radius_own", "extra"]
|
||||
"flags", "radius_own", "extra",
|
||||
# every wall field name (#54): geometry, switches, door settings, label
|
||||
"thickness", "position", "height", "blocks_sight", "blocks_movement", "sight_dir",
|
||||
"player_marker", "door", "secret", "locked", "label"]
|
||||
BannedToken = ["descriptive_name", "actual_name", "reveal_all", "revealed"]
|
||||
BannedCharacterTop = ["owner", "reveal_all", "revealed"] ## top-level only: `props.owner` is fine
|
||||
BannedEncountered = ["player", "character_id", "pos"]
|
||||
@@ -124,11 +127,11 @@ proc applyGmWalls(truth: var Truth, ids: var seq[int], m: JsonNode) =
|
||||
ids.setLen(0)
|
||||
for w in m["walls"]:
|
||||
truth.walls.add Wall(a: vec(w["a"]), b: vec(w["b"]),
|
||||
door: w["kind"].getStr == "door", open: w["open"].getBool)
|
||||
door: w["door"].getBool, open: w["open"].getBool)
|
||||
ids.add w["id"].getInt
|
||||
of "wall":
|
||||
let id = m["id"].getInt
|
||||
let w = Wall(a: vec(m["a"]), b: vec(m["b"]), door: m["kind"].getStr == "door",
|
||||
let w = Wall(a: vec(m["a"]), b: vec(m["b"]), door: m["door"].getBool,
|
||||
open: m["open"].getBool)
|
||||
var found = false
|
||||
for i in 0 ..< ids.len:
|
||||
|
||||
Reference in New Issue
Block a user