logic fix

This commit is contained in:
Hay1tsme 2024-06-23 22:19:27 -04:00
parent 068aa5eaa3
commit bdbb22f164
2 changed files with 3 additions and 3 deletions

View File

@ -194,7 +194,7 @@ class AimedbServlette():
if user_id and user_id > 0:
await self.data.card.update_card_last_login(req.access_code)
if req.access_code.startswith("010") or req.access_code.startswith("3") and req.serial_number != 0x04030201: # Default segatools sn
if (req.access_code.startswith("010") or req.access_code.startswith("3")) and req.serial_number != 0x04030201: # Default segatools sn
await self.data.card.set_chip_id_by_access_code(req.access_code, req.serial_number)
self.logger.info(f"Attempt to set chip id to {req.serial_number:08X} for access code {req.access_code}")
return ret
@ -370,7 +370,7 @@ class AimedbServlette():
)
if user_id > 0:
if req.access_code.startswith("010") or req.access_code.startswith("3") and req.serial_number != 0x04030201: # Default segatools sn:
if (req.access_code.startswith("010") or req.access_code.startswith("3")) and req.serial_number != 0x04030201: # Default segatools sn:
await self.data.card.set_chip_id_by_access_code(req.access_code, req.serial_number)
self.logger.info(f"Attempt to set chip id to {req.serial_number} for access code {req.access_code}")

View File

@ -85,7 +85,7 @@ class SaoBase:
card_id = await self.data.card.create_card(user_id, req.access_code)
if req.access_code.startswith("5"):
await self.data.card.set_idm_by_access_code(card_id, req.chip_id[:16])
elif req.access_code.startswith("010") or req.access_code.startswith("3") and int(req.chip_id[:8], 16) != 0x04030201:
elif (req.access_code.startswith("010") or req.access_code.startswith("3")) and int(req.chip_id[:8], 16) != 0x04030201:
await self.data.card.set_chip_id_by_access_code(card_id, int(req.chip_id[:8], 16))
if card_id is None: