1
0
mirror of synced 2025-01-31 04:03:45 +01:00

Roll in omnimix music version fixes to make Jubeat omnimix-capable, thanks to Subject38!

This commit is contained in:
Jennifer Taylor 2022-08-17 22:29:56 +00:00
parent 529dc5ef15
commit fed13b2828
8 changed files with 32 additions and 20 deletions

View File

@ -4,8 +4,8 @@ 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, ValidatedDict, Profile
from bemani.data import Score, UserID
from bemani.common import DBConstants, GameConstants, ValidatedDict, Model, Profile
from bemani.data import Data, Score, UserID, Config
from bemani.protocol import Node
@ -40,6 +40,19 @@ class JubeatBase(CoreHandler, CardManagerHandler, PASELIHandler, Base):
CHART_TYPE_HARD_ADVANCED: Final[int] = 4
CHART_TYPE_HARD_EXTREME: Final[int] = 5
def __init__(self, data: Data, config: Config, model: Model) -> None:
super().__init__(data, config, model)
if model.rev == 'X' or model.rev == 'Y':
self.omnimix = True
else:
self.omnimix = False
@property
def music_version(self) -> int:
if self.omnimix:
return DBConstants.OMNIMIX_VERSION_BUMP + self.version
return self.version
def previous_version(self) -> Optional['JubeatBase']:
"""
Returns the previous version of the game, based on this game. Should
@ -145,7 +158,7 @@ class JubeatBase(CoreHandler, CardManagerHandler, PASELIHandler, Base):
return None
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
scores = self.data.remote.music.get_scores(self.game, self.version, userid)
scores = self.data.remote.music.get_scores(self.game, self.music_version, userid)
if scores is None:
return None
profile = self.get_profile(userid)
@ -184,7 +197,7 @@ class JubeatBase(CoreHandler, CardManagerHandler, PASELIHandler, Base):
oldscore = self.data.local.music.get_score(
self.game,
self.version,
self.music_version,
userid,
songid,
chart,
@ -246,7 +259,7 @@ class JubeatBase(CoreHandler, CardManagerHandler, PASELIHandler, Base):
# Write the new score back
self.data.local.music.put_score(
self.game,
self.version,
self.music_version,
userid,
songid,
chart,
@ -260,7 +273,7 @@ class JubeatBase(CoreHandler, CardManagerHandler, PASELIHandler, Base):
# Save the history of this score too
self.data.local.music.put_attempt(
self.game,
self.version,
self.music_version,
userid,
songid,
chart,

View File

@ -1318,8 +1318,8 @@ class JubeatClan(
# Figure out if we've played these songs
start_time, end_time = self.data.local.network.get_schedule_duration('daily')
today_attempts = self.data.local.music.get_all_attempts(self.game, self.version, userid, entry.get_int('today', -1), timelimit=start_time)
whim_attempts = self.data.local.music.get_all_attempts(self.game, self.version, userid, entry.get_int('whim', -1), timelimit=start_time)
today_attempts = self.data.local.music.get_all_attempts(self.game, self.music_version, userid, entry.get_int('today', -1), timelimit=start_time)
whim_attempts = self.data.local.music.get_all_attempts(self.game, self.music_version, userid, entry.get_int('whim', -1), timelimit=start_time)
fc_challenge = Node.void('fc_challenge')
player.add_child(fc_challenge)

View File

@ -42,7 +42,7 @@ class JubeatDemodataGetHitchartHandler(JubeatBase):
data.add_child(hitchart_lic)
hitchart_lic.set_attribute('count', '0')
songs = self.data.local.music.get_hit_chart(self.game, self.version, 10)
songs = self.data.local.music.get_hit_chart(self.game, self.music_version, 10)
hitchart_org = Node.void('hitchart_org')
data.add_child(hitchart_org)
hitchart_org.set_attribute('count', str(len(songs)))

View File

@ -718,10 +718,10 @@ class JubeatFesto(
# Figure out if we've played these songs
start_time, end_time = self.data.local.network.get_schedule_duration('daily')
today_attempts = self.data.local.music.get_all_attempts(
self.game, self.version, userid, entry.get_int('today', -1), timelimit=start_time
self.game, self.music_version, userid, entry.get_int('today', -1), timelimit=start_time
)
whim_attempts = self.data.local.music.get_all_attempts(
self.game, self.version, userid, entry.get_int('whim', -1), timelimit=start_time
self.game, self.music_version, userid, entry.get_int('whim', -1), timelimit=start_time
)
# TODO: Are these still the right state constants?

View File

@ -916,8 +916,8 @@ class JubeatProp(
# Figure out if we've played these songs
start_time, end_time = self.data.local.network.get_schedule_duration('daily')
today_attempts = self.data.local.music.get_all_attempts(self.game, self.version, userid, entry.get_int('today', -1), timelimit=start_time)
whim_attempts = self.data.local.music.get_all_attempts(self.game, self.version, userid, entry.get_int('whim', -1), timelimit=start_time)
today_attempts = self.data.local.music.get_all_attempts(self.game, self.music_version, userid, entry.get_int('today', -1), timelimit=start_time)
whim_attempts = self.data.local.music.get_all_attempts(self.game, self.music_version, userid, entry.get_int('whim', -1), timelimit=start_time)
fc_challenge = Node.void('fc_challenge')
player.add_child(fc_challenge)

View File

@ -549,7 +549,7 @@ class JubeatQubell(
# Looks to be set to true when there's an old profile, stops tutorial from
# happening on first load.
info.add_child(Node.bool('inherit', profile.get_bool('has_old_version') and not profile.get_bool('saved')))
info.add_child(Node.bool('inherit', profile.get_bool('has_old_version')))
# Not saved, but loaded
info.add_child(Node.s32('mtg_entry_cnt', 123))
@ -643,8 +643,8 @@ class JubeatQubell(
# Figure out if we've played these songs
start_time, end_time = self.data.local.network.get_schedule_duration('daily')
today_attempts = self.data.local.music.get_all_attempts(self.game, self.version, userid, entry.get_int('today', -1), timelimit=start_time)
whim_attempts = self.data.local.music.get_all_attempts(self.game, self.version, userid, entry.get_int('whim', -1), timelimit=start_time)
today_attempts = self.data.local.music.get_all_attempts(self.game, self.music_version, userid, entry.get_int('today', -1), timelimit=start_time)
whim_attempts = self.data.local.music.get_all_attempts(self.game, self.music_version, userid, entry.get_int('whim', -1), timelimit=start_time)
fc_challenge = Node.void('fc_challenge')
player.add_child(fc_challenge)
@ -925,7 +925,6 @@ class JubeatQubell(
def unformat_profile(self, userid: UserID, request: Node, oldprofile: Profile) -> Profile:
newprofile = oldprofile.clone()
newprofile.replace_bool('saved', True)
data = request.child('data')
# Grab system information

View File

@ -319,7 +319,7 @@ class JubeatSaucer(
# Figure out if we've played these songs
start_time, end_time = self.data.local.network.get_schedule_duration('daily')
today_attempts = self.data.local.music.get_all_attempts(self.game, self.version, userid, entry.get_int('today', -1), timelimit=start_time)
today_attempts = self.data.local.music.get_all_attempts(self.game, self.music_version, userid, entry.get_int('today', -1), timelimit=start_time)
challenge = Node.void('challenge')
player.add_child(challenge)

View File

@ -493,8 +493,8 @@ class JubeatSaucerFulfill(
# Figure out if we've played these songs
start_time, end_time = self.data.local.network.get_schedule_duration('daily')
today_attempts = self.data.local.music.get_all_attempts(self.game, self.version, userid, entry.get_int('today', -1), timelimit=start_time)
whim_attempts = self.data.local.music.get_all_attempts(self.game, self.version, userid, entry.get_int('whim', -1), timelimit=start_time)
today_attempts = self.data.local.music.get_all_attempts(self.game, self.music_version, userid, entry.get_int('today', -1), timelimit=start_time)
whim_attempts = self.data.local.music.get_all_attempts(self.game, self.music_version, userid, entry.get_int('whim', -1), timelimit=start_time)
challenge = Node.void('challenge')
player.add_child(challenge)