maidx: ignore guest upserts, fixes #74

This commit is contained in:
Hay1tsme 2023-12-10 17:36:29 -05:00
parent c1412ca9a8
commit 26cdc6c10f
2 changed files with 8 additions and 0 deletions

View File

@ -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")

View File

@ -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