From 8f4c08f825910f39009addcfca3f72ab066df08d Mon Sep 17 00:00:00 2001 From: EmmyHeart Date: Sat, 14 Sep 2024 01:28:35 +0000 Subject: [PATCH 1/2] Fix map overload in Chusan --- titles/chuni/new.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/titles/chuni/new.py b/titles/chuni/new.py index 2275a6e..3d3fb98 100644 --- a/titles/chuni/new.py +++ b/titles/chuni/new.py @@ -104,7 +104,8 @@ class ChuniNew(ChuniBase): return {"returnCode": "1"} async def handle_get_user_map_area_api_request(self, data: Dict) -> Dict: - user_map_areas = await self.data.item.get_map_areas(data["userId"]) + map_area_ids = [int(area["mapAreaId"]) for area in data["mapAreaIdList"]] + user_map_areas = await self.data.item.get_map_areas(data["userId"], map_area_ids) map_areas = [] for map_area in user_map_areas: From 82004cb7432965430c084fe4838d58a87181a134 Mon Sep 17 00:00:00 2001 From: EmmyHeart Date: Sat, 14 Sep 2024 01:30:29 +0000 Subject: [PATCH 2/2] Fix map overload in Chusan --- titles/chuni/schema/item.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/titles/chuni/schema/item.py b/titles/chuni/schema/item.py index 30db4b8..9ce2c53 100644 --- a/titles/chuni/schema/item.py +++ b/titles/chuni/schema/item.py @@ -533,8 +533,8 @@ class ChuniItemData(BaseData): return None return result.lastrowid - async def get_map_areas(self, user_id: int) -> Optional[List[Row]]: - sql = select(map_area).where(map_area.c.user == user_id) + async def get_map_areas(self, user_id: int, map_area_ids: List[int]) -> Optional[List[Row]]: + sql = select(map_area).where(map_area.c.user == user_id, map_area.c.mapAreaId.in_(map_area_ids)) result = await self.execute(sql) if result is None: