mirror of
https://github.com/DragonMinded/bemaniutils.git
synced 2026-07-19 00:51:17 -05:00
Partially roll in Subject38's Jubeat backend updates.
This commit is contained in:
parent
8500201e4c
commit
2ebf59e541
15
bemani/backend/jubeat/avenue.py
Normal file
15
bemani/backend/jubeat/avenue.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# vim: set fileencoding=utf-8
|
||||
from typing import Optional
|
||||
from bemani.backend.jubeat.base import JubeatBase
|
||||
from bemani.backend.jubeat.festo import JubeatFesto
|
||||
|
||||
from bemani.common import VersionConstants
|
||||
|
||||
|
||||
class JubeatAvenue(JubeatBase):
|
||||
|
||||
name: str = 'Jubeat Avenue'
|
||||
version: int = VersionConstants.JUBEAT_AVENUE
|
||||
|
||||
def previous_version(self) -> Optional[JubeatBase]:
|
||||
return JubeatFesto(self.data, self.config, self.model)
|
||||
|
|
@ -4,7 +4,7 @@ from typing_extensions import Final
|
|||
|
||||
from bemani.backend.base import Base
|
||||
from bemani.backend.core import CoreHandler, CardManagerHandler, PASELIHandler
|
||||
from bemani.common import DBConstants, GameConstants, Profile, ValidatedDict
|
||||
from bemani.common import DBConstants, GameConstants, ValidatedDict, Profile
|
||||
from bemani.data import Score, UserID
|
||||
from bemani.protocol import Node
|
||||
|
||||
|
|
@ -36,6 +36,9 @@ class JubeatBase(CoreHandler, CardManagerHandler, PASELIHandler, Base):
|
|||
CHART_TYPE_BASIC: Final[int] = 0
|
||||
CHART_TYPE_ADVANCED: Final[int] = 1
|
||||
CHART_TYPE_EXTREME: Final[int] = 2
|
||||
CHART_TYPE_HARD_BASIC: Final[int] = 3
|
||||
CHART_TYPE_HARD_ADVANCED: Final[int] = 4
|
||||
CHART_TYPE_HARD_EXTREME: Final[int] = 5
|
||||
|
||||
def previous_version(self) -> Optional['JubeatBase']:
|
||||
"""
|
||||
|
|
@ -161,6 +164,7 @@ class JubeatBase(CoreHandler, CardManagerHandler, PASELIHandler, Base):
|
|||
combo: int,
|
||||
ghost: Optional[List[int]]=None,
|
||||
stats: Optional[Dict[str, int]]=None,
|
||||
music_rate: Optional[int]=None,
|
||||
) -> None:
|
||||
"""
|
||||
Given various pieces of a score, update the user's high score and score
|
||||
|
|
@ -228,6 +232,14 @@ class JubeatBase(CoreHandler, CardManagerHandler, PASELIHandler, Base):
|
|||
# Update the ghost regardless, but don't bother with it in history
|
||||
scoredata.replace_int_array('ghost', len(ghost), ghost)
|
||||
|
||||
if music_rate is not None:
|
||||
if oldscore is not None:
|
||||
if music_rate > oldscore.data.get_int('music_rate'):
|
||||
scoredata.replace_int('music_rate', music_rate)
|
||||
else:
|
||||
scoredata.replace_int('music_rate', music_rate)
|
||||
history.replace_int('music_rate', music_rate)
|
||||
|
||||
# Look up where this score was earned
|
||||
lid = self.get_machine_id()
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ from bemani.backend.jubeat.prop import JubeatProp
|
|||
from bemani.backend.jubeat.qubell import JubeatQubell
|
||||
from bemani.backend.jubeat.clan import JubeatClan
|
||||
from bemani.backend.jubeat.festo import JubeatFesto
|
||||
from bemani.backend.jubeat.avenue import JubeatAvenue
|
||||
from bemani.common import Model
|
||||
from bemani.data import Config, Data
|
||||
|
||||
|
|
@ -36,6 +37,7 @@ class JubeatFactory(Factory):
|
|||
JubeatQubell,
|
||||
JubeatClan,
|
||||
JubeatFesto,
|
||||
JubeatAvenue,
|
||||
]
|
||||
|
||||
@classmethod
|
||||
|
|
@ -73,8 +75,10 @@ class JubeatFactory(Factory):
|
|||
return JubeatQubell(data, config, model)
|
||||
if model.version >= 2017062600 and model.version < 2018090500:
|
||||
return JubeatClan(data, config, model)
|
||||
if model.version >= 2018090500:
|
||||
if model.version >= 2018090500 and model.version < 2022080300:
|
||||
return JubeatFesto(data, config, model)
|
||||
if model.version >= 2022080300:
|
||||
return JubeatAvenue(data, config, model)
|
||||
|
||||
# Unknown game version
|
||||
return None
|
||||
|
|
|
|||
|
|
@ -90,6 +90,7 @@ class VersionConstants:
|
|||
JUBEAT_QUBELL: Final[int] = 11
|
||||
JUBEAT_CLAN: Final[int] = 12
|
||||
JUBEAT_FESTO: Final[int] = 13
|
||||
JUBEAT_AVENUE: Final[int] = 14
|
||||
|
||||
MGA: Final[int] = 1
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ types-PyYAML
|
|||
types-Werkzeug
|
||||
types-Flask
|
||||
types-freezegun
|
||||
types-python-dateutil
|
||||
flake8
|
||||
typed-ast
|
||||
freezegun
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user