mirror of
https://gitea.tendokyu.moe/Hay1tsme/artemis.git
synced 2026-02-14 03:37:29 +08:00
[mai2/chuni/ongeki] Properly ignore guest plays (#132)
For all three games, guest plays are created using: ```python 0x1000000000001 | ((allnet_place_id & 65535) << 32) ``` Reviewed-on: https://gitea.tendokyu.moe/Hay1tsme/artemis/pulls/132 Co-authored-by: beerpsi <beerpsi@duck.com> Co-committed-by: beerpsi <beerpsi@duck.com>
This commit is contained in:
@@ -238,8 +238,10 @@ class Mai2Base:
|
||||
user_id = data["userId"]
|
||||
upsert = data["upsertUserAll"]
|
||||
|
||||
if int(user_id) & 1000000000001 == 1000000000001:
|
||||
self.logger.info("Guest play, ignoring.")
|
||||
if int(user_id) & 0x1000000000001 == 0x1000000000001:
|
||||
place_id = int(user_id) & 0xFFFC00000000
|
||||
|
||||
self.logger.info("Guest play from place ID %d, ignoring.", place_id)
|
||||
return {"returnCode": 1, "apiName": "UpsertUserAllApi"}
|
||||
|
||||
if "userData" in upsert and len(upsert["userData"]) > 0:
|
||||
|
||||
@@ -121,8 +121,10 @@ class Mai2DX(Mai2Base):
|
||||
user_id = data["userId"]
|
||||
upsert = data["upsertUserAll"]
|
||||
|
||||
if int(user_id) & 1000000000001 == 1000000000001:
|
||||
self.logger.info("Guest play, ignoring.")
|
||||
if int(user_id) & 0x1000000000001 == 0x1000000000001:
|
||||
place_id = int(user_id) & 0xFFFC00000000
|
||||
|
||||
self.logger.info("Guest play from place ID %d, ignoring.", place_id)
|
||||
return {"returnCode": 1, "apiName": "UpsertUserAllApi"}
|
||||
|
||||
if "userData" in upsert and len(upsert["userData"]) > 0:
|
||||
|
||||
Reference in New Issue
Block a user