From 26cdc6c10f095e1fc0b19b7205a1ded38e4100bc Mon Sep 17 00:00:00 2001 From: Kevin Trocolli Date: Sun, 10 Dec 2023 17:36:29 -0500 Subject: [PATCH] maidx: ignore guest upserts, fixes #74 --- titles/mai2/base.py | 4 ++++ titles/mai2/dx.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/titles/mai2/base.py b/titles/mai2/base.py index b896b4f..2f40176 100644 --- a/titles/mai2/base.py +++ b/titles/mai2/base.py @@ -237,6 +237,10 @@ class Mai2Base: def handle_upsert_user_all_api_request(self, data: Dict) -> Dict: user_id = data["userId"] upsert = data["upsertUserAll"] + + if int(user_id) & 1000000000001 == 1000000000001: + self.logger.info("Guest play, ignoring.") + return {"returnCode": 1, "apiName": "UpsertUserAllApi"} if "userData" in upsert and len(upsert["userData"]) > 0: upsert["userData"][0].pop("accessCode") diff --git a/titles/mai2/dx.py b/titles/mai2/dx.py index a0a7d6f..508cebb 100644 --- a/titles/mai2/dx.py +++ b/titles/mai2/dx.py @@ -96,6 +96,10 @@ class Mai2DX(Mai2Base): def handle_upsert_user_all_api_request(self, data: Dict) -> Dict: user_id = data["userId"] upsert = data["upsertUserAll"] + + if int(user_id) & 1000000000001 == 1000000000001: + self.logger.info("Guest play, ignoring.") + return {"returnCode": 1, "apiName": "UpsertUserAllApi"} if "userData" in upsert and len(upsert["userData"]) > 0: upsert["userData"][0]["isNetMember"] = 1