1
0
forked from Hay1tsme/artemis

IDAC: Hotfix to block amdaemon_emu users without correct access code

This commit is contained in:
Dniel97 2023-10-10 16:06:58 +02:00
parent d55ada2538
commit 31188ccce6
Signed by untrusted user: Dniel97
GPG Key ID: 6180B3C768FB2E08

View File

@ -342,16 +342,25 @@ class IDACSeason2(IDACBase):
def handle_login_checklock_request(self, data: Dict, headers: Dict): def handle_login_checklock_request(self, data: Dict, headers: Dict):
user_id = data["id"] user_id = data["id"]
access_code = data["accesscode"]
is_new_player = 0
# check if an IDAC profile already exists # check that the user_id from access_code matches the user_id
p = self.data.profile.get_profile(user_id, self.version) if user_id == self.data.card.get_user_id_from_card(access_code):
is_new_player = 1 if p is None else 0 lock_result = 1
# check if an IDAC profile already exists
p = self.data.profile.get_profile(user_id, self.version)
is_new_player = 1 if p is None else 0
else:
lock_result = 0
user_id = ""
# other: in use # other: in use
return { return {
"status_code": "0", "status_code": "0",
# 0 = already in use, 1 = good, 2 = too new # 0 = already in use, 1 = good, 2 = too new
"lock_result": 1, "lock_result": lock_result,
"lock_date": int(datetime.now().timestamp()), "lock_date": int(datetime.now().timestamp()),
"daily_play": 1, "daily_play": 1,
"session": f"{user_id}", "session": f"{user_id}",