mirror of
https://github.com/cliffe/BreakEscape.git
synced 2026-02-20 13:50:46 +00:00
Refactor RFID handling and enhance game logic
- Updated `GamesController` and `Game` model to include RFID lock types in the filtering logic for 'requires' attributes, ensuring proper handling of biometric, bluetooth, and RFID types. - Improved `RFIDMinigame` to standardize card ID retrieval, supporting both `card_id` and `key_id`. - Enhanced `unlock-system.js` to prioritize physical keycard checks and streamline the unlocking process with detailed logging. - Adjusted scenario JSON files to replace `keyId` with `card_id` for consistency and added new lock requirements for various rooms.
This commit is contained in:
@@ -519,10 +519,13 @@ module BreakEscape
|
||||
def filter_requires_and_contents_recursive(obj)
|
||||
case obj
|
||||
when Hash
|
||||
# Remove 'requires' for exploitable lock types (key/pin/password/rfid)
|
||||
# Keep it for biometric/bluetooth since they reference collectible items, not answers
|
||||
# Remove 'requires' for exploitable lock types (key/pin/password)
|
||||
# Keep it for biometric/bluetooth/rfid since they reference collectible items, not answers
|
||||
# - biometric: requires fingerprint owner name (e.g., "Mrs Moo")
|
||||
# - bluetooth: requires device MAC/name (e.g., "00:11:22:33:44:55")
|
||||
# - rfid: requires card IDs (e.g., ["master_keycard"])
|
||||
lock_type = obj['lockType']
|
||||
if lock_type && !%w[biometric bluetooth].include?(lock_type)
|
||||
if lock_type && !%w[biometric bluetooth rfid].include?(lock_type)
|
||||
obj.delete('requires')
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user