pokken: fix profile loading fail

This commit is contained in:
Hay1tsme 2024-06-12 23:24:45 -04:00
parent eaab3728c4
commit e21568cfd9
3 changed files with 6 additions and 6 deletions

View File

@ -49,7 +49,7 @@ class Utils:
def get_title_port_ssl(cls, cfg: CoreConfig): def get_title_port_ssl(cls, cfg: CoreConfig):
if cls.real_title_port_ssl is not None: return cls.real_title_port_ssl if cls.real_title_port_ssl is not None: return cls.real_title_port_ssl
cls.real_title_port_ssl = cfg.server.proxy_port_ssl if cfg.server.is_using_proxy and cfg.server.proxy_port_ssl else Utils.get_title_port(cfg) cls.real_title_port_ssl = cfg.server.proxy_port_ssl if cfg.server.is_using_proxy and cfg.server.proxy_port_ssl else 443
return cls.real_title_port_ssl return cls.real_title_port_ssl

View File

@ -385,7 +385,7 @@ class PokkenBase:
await self.data.profile.add_profile_points(user_id, get_rank_pts, get_money, get_score_pts, grade_max) await self.data.profile.add_profile_points(user_id, get_rank_pts, get_money, get_score_pts, grade_max)
# Inconsistant underscore use AND a typo?? # Inconsistant underscore use AND a typo??
await self.data.profile.update_rankmatch_data(user_id, req.rankmatch_flag, req.rank_match_max, req.rank_match_success, req.rank_match_process) #await self.data.profile.update_rankmatch_data(user_id, req.rankmatch_flag, req.rank_match_max, req.rank_match_success, req.rank_match_process)
await self.data.profile.update_support_team(user_id, 1, req.support_set_1[0], req.support_set_1[1]) await self.data.profile.update_support_team(user_id, 1, req.support_set_1[0], req.support_set_1[1])
await self.data.profile.update_support_team(user_id, 2, req.support_set_2[0], req.support_set_2[1]) await self.data.profile.update_support_team(user_id, 2, req.support_set_2[0], req.support_set_2[1])

View File

@ -5,7 +5,7 @@ from sqlalchemy.schema import ForeignKey
from sqlalchemy.sql import func, select, update, delete from sqlalchemy.sql import func, select, update, delete
from sqlalchemy.sql.functions import coalesce from sqlalchemy.sql.functions import coalesce
from sqlalchemy.engine import Row from sqlalchemy.engine import Row
from sqlalchemy.dialects.postgresql import insert from sqlalchemy.dialects.mysql import insert
from core.data.schema import BaseData, metadata from core.data.schema import BaseData, metadata
from ..const import PokkenConstants from ..const import PokkenConstants
@ -103,7 +103,7 @@ profile = Table(
) )
pokemon_data = Table( pokemon_data = Table(
"pokken_pokemon", "pokken_pokemon_data",
metadata, metadata,
Column("id", Integer, primary_key=True, nullable=False), Column("id", Integer, primary_key=True, nullable=False),
Column("user", Integer, ForeignKey("aime_user.id", ondelete="cascade", onupdate="cascade"), nullable=False), Column("user", Integer, ForeignKey("aime_user.id", ondelete="cascade", onupdate="cascade"), nullable=False),
@ -295,7 +295,7 @@ class PokkenProfileData(BaseData):
self.logger.warning(f"Failed to add {xp} XP to pokemon ID {pokemon_id} for user {user_id}") self.logger.warning(f"Failed to add {xp} XP to pokemon ID {pokemon_id} for user {user_id}")
async def get_pokemon_data(self, user_id: int, pokemon_id: int) -> Optional[Row]: async def get_pokemon_data(self, user_id: int, pokemon_id: int) -> Optional[Row]:
sql = pokemon_data.select(and_(pokemon_data.c.user == user_id, pokemon_data.c.char_id == pokemon_id)) sql = pokemon_data.select(and_(pokemon_data.c.user == user_id, pokemon_data.c.illustration_book_no == pokemon_id))
result = await self.execute(sql) result = await self.execute(sql)
if result is None: if result is None:
return None return None
@ -323,7 +323,7 @@ class PokkenProfileData(BaseData):
Records the match stats (type and win/loss) for the pokemon and profile Records the match stats (type and win/loss) for the pokemon and profile
coalesce(pokemon_data.c.win_vs_wan, 0) coalesce(pokemon_data.c.win_vs_wan, 0)
""" """
sql = pokemon_data.update(and_(pokemon_data.c.user==user_id, pokemon_data.c.char_id==pokemon_id)).values( sql = pokemon_data.update(and_(pokemon_data.c.user==user_id, pokemon_data.c.illustration_book_no==pokemon_id)).values(
battle_num_tutorial=coalesce(pokemon_data.c.battle_num_tutorial, 0) + 1 if match_type==PokkenConstants.BATTLE_TYPE.TUTORIAL else coalesce(pokemon_data.c.battle_num_tutorial, 0), battle_num_tutorial=coalesce(pokemon_data.c.battle_num_tutorial, 0) + 1 if match_type==PokkenConstants.BATTLE_TYPE.TUTORIAL else coalesce(pokemon_data.c.battle_num_tutorial, 0),
battle_all_num_tutorial=coalesce(pokemon_data.c.battle_all_num_tutorial, 0) + 1 if match_type==PokkenConstants.BATTLE_TYPE.TUTORIAL else coalesce(pokemon_data.c.battle_all_num_tutorial, 0), battle_all_num_tutorial=coalesce(pokemon_data.c.battle_all_num_tutorial, 0) + 1 if match_type==PokkenConstants.BATTLE_TYPE.TUTORIAL else coalesce(pokemon_data.c.battle_all_num_tutorial, 0),