mirror of
https://gitea.tendokyu.moe/Hay1tsme/artemis.git
synced 2025-12-14 08:06:25 +08:00
add idm and chip_id fields to card table
This commit is contained in:
@@ -165,6 +165,8 @@ class PokkenBase:
|
||||
f"Register new card {access_code} (UserId {user_id}, CardId {card_id})"
|
||||
)
|
||||
|
||||
await self.data.card.set_chip_id_by_access_code(access_code, int(request.load_user.chip_id[:8], 16))
|
||||
|
||||
elif card is None:
|
||||
self.logger.info(f"Registration of card {access_code} blocked!")
|
||||
res.load_user.CopyFrom(load_usr)
|
||||
@@ -173,6 +175,8 @@ class PokkenBase:
|
||||
else:
|
||||
user_id = card['user']
|
||||
card_id = card['id']
|
||||
if not card['chip_id']:
|
||||
await self.data.card.set_chip_id_by_access_code(access_code, int(request.load_user.chip_id[:8], 16))
|
||||
|
||||
"""
|
||||
TODO: Unlock all supports? Probably
|
||||
|
||||
@@ -83,6 +83,10 @@ class SaoBase:
|
||||
if not user_id:
|
||||
user_id = await self.data.user.create_user() #works
|
||||
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"):
|
||||
await self.data.card.set_chip_id_by_access_code(card_id, int(req.chip_id[:8], 16))
|
||||
|
||||
if card_id is None:
|
||||
user_id = -1
|
||||
|
||||
Reference in New Issue
Block a user