Expand Glitch operations hub, cabinet authoring, deployment, and RFID support
Operator hub - Introduce Escape Gallery branding and Glitch: the Dark Machine room views - Add cabinet illustrations, Pac-Man marquee/gameplay artwork, and waiting states - Add device feedback panels with RFID readings, input/output states, and stale status - Add logged operator hardware interventions with request deduplication Room and cabinet authoring - Add a visual custom-PCB connection editor with per-cabinet device inventory - Support device IDs, bindings, wiring notes, input polarity, and validation - Add physical-room label/dimension toggles and editable doorway annotations - Preserve doorway changes through undo, save, and revert - Expand cabinet profiles, room layout, and Glitch scenario resources Scenarios and gameplay - Add per-assignment game configuration and runtime feature validation - Add timed test wins and Frogger individual-home objectives - Add the three-cabinet timed/score/Frogger test scenario - Add Cabinet 1 Pac-Man RFID credits, credit sound, and CREDIT 0/1 display - Require physical Start after an accepted scan and prevent duplicate credits Pi hardware and deployment - Add GPIO feedback sampling and a separate multiplexed RFID helper - Validate reader pin ownership and input/output conflicts - Add SSH cabinet startup and Pi desktop-session service support - Add master packaging, site setup, SSH enrollment, and staged cabinet releases - Verify deployment manifests and support explicit activation/status/log commands Documentation and verification - Consolidate the root README around the current architecture and setup workflow - Add the complete master/Pi/RFID export and deployment walkthrough - Document network isolation, credentials, card identification, and rollback - Add PCB, room-editor, feedback, credit, deployment, and controller tests - Isolate protocol tests from designer-edited cabinet configurations Known limitations - RFID helper compilation and physical Pi commissioning remain unverified - Fleet provisioning does not yet configure RFID-only installations completely - Broader Pac-Man tests retain a ghost-capture assertion failure - Staged exports must be rebuilt and checked before deploying runtime 2.3
This commit is contained in:
1 parent
705ec31e0b
commit
c1b2195834
90 files changed
+4969
-456
No files matched your search
@@ -13,6 +13,40 @@ var model = Model.new()
|
||||
var view
|
||||
var audio
|
||||
var accumulator := 0.0
|
||||
var credits := 0
|
||||
var rfid_seen: Dictionary = {}
|
||||
var rfid_initialized := false
|
||||
|
||||
func receive_device_feedback(feedback: Dictionary) -> void:
|
||||
var events: Array = feedback.get("events", [])
|
||||
if not rfid_initialized:
|
||||
if not bool(feedback.get("fresh", false)): return
|
||||
for entry in events: rfid_seen[str(entry.get("id", ""))] = true
|
||||
rfid_initialized = true
|
||||
return
|
||||
if not bool(feedback.get("fresh", false)): return
|
||||
var device_id := str(run_config.get("rfid_credit_device", ""))
|
||||
for entry in events:
|
||||
var ident := str(entry.get("id", ""))
|
||||
if ident.is_empty() or rfid_seen.has(ident): continue
|
||||
rfid_seen[ident] = true
|
||||
if device_id.is_empty() or is_running or credits > 0 or model.state != "idle": continue
|
||||
if entry.get("device") != device_id or entry.get("kind") != "rfid" or not str(entry.get("error", "")).is_empty(): continue
|
||||
var uid := str(entry.get("value", "")).to_upper()
|
||||
if uid.is_empty(): continue
|
||||
var allowed: Array = run_config.get("rfid_allowed_uids", [])
|
||||
if not allowed.is_empty() and not allowed.has(uid): continue
|
||||
for sample in feedback.get("devices", []):
|
||||
if sample.get("id") == device_id and int(sample.get("age_ms", 999999)) < 2000 and sample.get("value") == entry.get("value") and str(sample.get("error", "")).is_empty():
|
||||
credits = 1
|
||||
view.credits = credits
|
||||
audio.play_effect("credit")
|
||||
break
|
||||
# The bridge retains only its last 64 events. Keep deduplication bounded too.
|
||||
if rfid_seen.size() > 256:
|
||||
rfid_seen.clear()
|
||||
for entry in events: rfid_seen[str(entry.get("id", ""))] = true
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
view = View.new()
|
||||
@@ -26,9 +60,15 @@ func _ready() -> void:
|
||||
|
||||
func configure(config: Dictionary = {}) -> void:
|
||||
super.configure(config)
|
||||
credits = 0
|
||||
rfid_seen.clear()
|
||||
rfid_initialized = false
|
||||
_apply_config()
|
||||
|
||||
func _apply_config() -> void:
|
||||
if view != null:
|
||||
view.credit_required = not str(run_config.get("rfid_credit_device", "")).is_empty()
|
||||
view.credits = credits
|
||||
model.boards_to_win = maxi(0, int(run_config.get("boards_to_win", boards_to_win)))
|
||||
model.score_to_win = maxi(0, int(run_config.get("score_to_win", score_to_win)))
|
||||
model.initial_lives = clampi(int(run_config.get("starting_lives", starting_lives)), 1, 9)
|
||||
@@ -36,6 +76,9 @@ func _apply_config() -> void:
|
||||
|
||||
func start_game() -> bool:
|
||||
if is_running: return false
|
||||
if not str(run_config.get("rfid_credit_device", "")).is_empty():
|
||||
if credits < 1: return false
|
||||
credits -= 1
|
||||
_apply_config()
|
||||
audio.stop_all()
|
||||
model.start()
|
||||
@@ -43,6 +86,8 @@ func start_game() -> bool:
|
||||
return super.start_game()
|
||||
|
||||
func reset_game() -> void:
|
||||
credits = 0
|
||||
if view != null: view.credits = 0
|
||||
audio.stop_all()
|
||||
model.reset()
|
||||
accumulator = 0.0
|
||||
|
||||
Reference in new issue
Block a user