diff --git a/titles/pokken/const.py b/titles/pokken/const.py index e7ffdd8..9fa3b06 100644 --- a/titles/pokken/const.py +++ b/titles/pokken/const.py @@ -15,6 +15,7 @@ class PokkenConstants: AI = 2 LAN = 3 WAN = 4 + TUTORIAL_3 = 7 class BATTLE_RESULT(Enum): WIN = 1 diff --git a/titles/pokken/schema/item.py b/titles/pokken/schema/item.py index 32bff2a..6c13306 100644 --- a/titles/pokken/schema/item.py +++ b/titles/pokken/schema/item.py @@ -39,7 +39,11 @@ class PokkenItemData(BaseData): type=item_type, ) - result = self.execute(sql) + conflict = sql.on_duplicate_key_update( + content=content, + ) + + result = self.execute(conflict) if result is None: self.logger.warn(f"Failed to insert reward for user {user_id}: {category}-{content}-{item_type}") return None diff --git a/titles/pokken/schema/profile.py b/titles/pokken/schema/profile.py index 812964d..1d745f6 100644 --- a/titles/pokken/schema/profile.py +++ b/titles/pokken/schema/profile.py @@ -259,7 +259,7 @@ class PokkenProfileData(BaseData): illustration_book_no=illust_no, bp_point_atk=atk, bp_point_res=res, - bp_point_defe=defe, + bp_point_def=defe, bp_point_sp=sp, ) @@ -267,7 +267,7 @@ class PokkenProfileData(BaseData): illustration_book_no=illust_no, bp_point_atk=atk, bp_point_res=res, - bp_point_defe=defe, + bp_point_def=defe, bp_point_sp=sp, ) @@ -347,7 +347,11 @@ class PokkenProfileData(BaseData): if result is None: self.logger.warn(f"Failed to update stats for user {user_id}") - def update_support_team(self, user_id: int, support_id: int, support1: int = 4294967295, support2: int = 4294967295) -> None: + def update_support_team(self, user_id: int, support_id: int, support1: int = None, support2: int = None) -> None: + if support1 == 4294967295: + support1 = None + if support2 == 4294967295: + support2 = None sql = update(profile).where(profile.c.user==user_id).values( support_set_1_1=support1 if support_id == 1 else profile.c.support_set_1_1, support_set_1_2=support2 if support_id == 1 else profile.c.support_set_1_2,