1
0
mirror of synced 2024-11-23 22:10:59 +01:00

Latest black changed some formatting, re-run it.

This commit is contained in:
Jennifer Taylor 2023-02-17 03:02:41 +00:00
parent bf9bf16ddd
commit eaf07ddf6a
103 changed files with 96 additions and 230 deletions

View File

@ -207,7 +207,7 @@ def lookup(protoversion: str, requestgame: str, requestversion: str) -> Dict[str
# Figure out what games we support based on config, and map those.
gamemapping = {}
for (gameid, constant) in [
for gameid, constant in [
("ddr", GameConstants.DDR),
("iidx", GameConstants.IIDX),
("jubeat", GameConstants.JUBEAT),

View File

@ -119,7 +119,7 @@ class ProfileObject(BaseObject):
# Now, fetch the users, and filter out profiles belonging to orphaned users
retval: List[Dict[str, Any]] = []
id_to_cards: Dict[UserID, List[str]] = {}
for (userid, profile) in profiles:
for userid, profile in profiles:
if userid not in id_to_cards:
cards = self.data.local.user.get_cards(userid)
if len(cards) == 0:

View File

@ -306,7 +306,7 @@ class RecordsObject(BaseObject):
# Now, fetch the users, and filter out scores belonging to orphaned users
id_to_cards: Dict[UserID, List[str]] = {}
retval: List[Dict[str, Any]] = []
for (userid, record) in records:
for userid, record in records:
# Postfilter for queries that can't filter. This will save on data transferred.
if since is not None:
if record.update < since:

View File

@ -182,7 +182,7 @@ class StatisticsObject(BaseObject):
) -> List[Dict[str, Any]]:
stats: Dict[UserID, Dict[int, Dict[int, Dict[str, int]]]] = {}
for (userid, attempt) in attempts:
for userid, attempt in attempts:
if userid not in stats:
stats[userid] = {}
if attempt.id not in stats[userid]:

View File

@ -21,7 +21,6 @@ class TheStarBishiBashi(
EventLogHandler,
BishiBashiBase,
):
name: str = "The★BishiBashi"
version: int = VersionConstants.BISHI_BASHI_TSBB

View File

@ -7,7 +7,6 @@ from bemani.data import Config, Data
class BishiBashiFactory(Factory):
MANAGED_CLASSES: List[Type[Base]] = [
TheStarBishiBashi,
]
@ -25,7 +24,6 @@ class BishiBashiFactory(Factory):
model: Model,
parentmodel: Optional[Model] = None,
) -> Optional[Base]:
if model.gamecode == "IBB":
return TheStarBishiBashi(data, config, model)

View File

@ -422,7 +422,7 @@ class PASELIHandler(Base):
)
topic.add_child(Node.string("sumto", Time.format(this_month, date_format)))
for (start, end) in [(month_before, last_month), (last_month, this_month)]:
for start, end in [(month_before, last_month), (last_month, this_month)]:
year, month, _ = Time.date_from_timestamp(start)
items = []

View File

@ -58,7 +58,7 @@ class DDRGameHiscoreHandler(DDRBase):
sortedrecords: Dict[int, Dict[int, Tuple[UserID, Score]]] = {}
missing_profiles = []
for (userid, score) in records:
for userid, score in records:
if score.id not in sortedrecords:
sortedrecords[score.id] = {}
sortedrecords[score.id][score.chart] = (userid, score)
@ -124,7 +124,7 @@ class DDRGameAreaHiscoreHandler(DDRBase):
# to think about how to change this knowing that we only pulled
# up area records.
area_records: Dict[int, Dict[int, Tuple[UserID, Score]]] = {}
for (userid, score) in records:
for userid, score in records:
if score.id not in area_records:
area_records[score.id] = {}
area_records[score.id][score.chart] = (userid, score)

View File

@ -52,7 +52,6 @@ class DDR2013(
DDRGameTraceHandler,
DDRBase,
):
name: str = "DanceDanceRevolution 2013"
version: int = VersionConstants.DDR_2013
@ -176,7 +175,7 @@ class DDR2013(
self.game, self.music_version, self.GAME_MAX_SONGS
)
counts_by_reflink = [0] * self.GAME_MAX_SONGS
for (reflink, plays) in hit_chart:
for reflink, plays in hit_chart:
if reflink >= 0 and reflink < self.GAME_MAX_SONGS:
counts_by_reflink[reflink] = plays
game.add_child(Node.u32_array("cnt_music", counts_by_reflink))

View File

@ -46,7 +46,6 @@ class DDR2014(
DDRGameTaxInfoHandler,
DDRBase,
):
name: str = "DanceDanceRevolution 2014"
version: int = VersionConstants.DDR_2014
@ -171,7 +170,7 @@ class DDR2014(
self.game, self.music_version, self.GAME_MAX_SONGS, 30
)
counts_by_reflink = [0] * self.GAME_MAX_SONGS
for (reflink, plays) in hit_chart:
for reflink, plays in hit_chart:
if reflink >= 0 and reflink < self.GAME_MAX_SONGS:
counts_by_reflink[reflink] = plays
game.add_child(Node.u32_array("cnt_music_monthly", counts_by_reflink))
@ -181,7 +180,7 @@ class DDR2014(
self.game, self.music_version, self.GAME_MAX_SONGS, 7
)
counts_by_reflink = [0] * self.GAME_MAX_SONGS
for (reflink, plays) in hit_chart:
for reflink, plays in hit_chart:
if reflink >= 0 and reflink < self.GAME_MAX_SONGS:
counts_by_reflink[reflink] = plays
game.add_child(Node.u32_array("cnt_music_weekly", counts_by_reflink))
@ -191,7 +190,7 @@ class DDR2014(
self.game, self.music_version, self.GAME_MAX_SONGS, 1
)
counts_by_reflink = [0] * self.GAME_MAX_SONGS
for (reflink, plays) in hit_chart:
for reflink, plays in hit_chart:
if reflink >= 0 and reflink < self.GAME_MAX_SONGS:
counts_by_reflink[reflink] = plays
game.add_child(Node.u32_array("cnt_music_daily", counts_by_reflink))

View File

@ -9,7 +9,6 @@ from bemani.common import VersionConstants
class DDRA20(
DDRBase,
):
name: str = "DanceDanceRevolution A20"
version: int = VersionConstants.DDR_A20

View File

@ -23,7 +23,6 @@ class DDRAce(
DDRBase,
EventLogHandler,
):
name: str = "DanceDanceRevolution A"
version: int = VersionConstants.DDR_ACE
@ -623,7 +622,7 @@ class DDRAce(
missing_users = [
userid for (userid, _) in scores if userid not in profiles_by_userid
]
for (userid, profile) in self.get_any_profiles(missing_users):
for userid, profile in self.get_any_profiles(missing_users):
profiles_by_userid[userid] = profile
for userid, score in scores:

View File

@ -42,7 +42,6 @@ class DDRX2(
DDRGameTraceHandler,
DDRBase,
):
name: str = "DanceDanceRevolution X2"
version: int = VersionConstants.DDR_X2
@ -161,7 +160,7 @@ class DDRX2(
self.game, self.music_version, self.GAME_MAX_SONGS
)
counts_by_reflink = [0] * self.GAME_MAX_SONGS
for (reflink, plays) in hit_chart:
for reflink, plays in hit_chart:
if reflink >= 0 and reflink < self.GAME_MAX_SONGS:
counts_by_reflink[reflink] = plays
game.add_child(Node.u32_array("cnt_music", counts_by_reflink))
@ -176,7 +175,7 @@ class DDRX2(
sortedrecords: Dict[int, Dict[int, Tuple[UserID, Score]]] = {}
missing_profiles = []
for (userid, score) in records:
for userid, score in records:
if score.id not in sortedrecords:
sortedrecords[score.id] = {}
sortedrecords[score.id][score.chart] = (userid, score)

View File

@ -48,7 +48,6 @@ class DDRX3(
DDRGameTraceHandler,
DDRBase,
):
name: str = "DanceDanceRevolution X3 VS 2ndMIX"
version: int = VersionConstants.DDR_X3_VS_2NDMIX
@ -170,7 +169,7 @@ class DDRX3(
self.game, self.music_version, self.GAME_MAX_SONGS
)
counts_by_reflink = [0] * self.GAME_MAX_SONGS
for (reflink, plays) in hit_chart:
for reflink, plays in hit_chart:
if reflink >= 0 and reflink < self.GAME_MAX_SONGS:
counts_by_reflink[reflink] = plays
game.add_child(Node.u32_array("cnt_music", counts_by_reflink))

View File

@ -25,7 +25,6 @@ from bemani.data import Config, Data
class DDRFactory(Factory):
MANAGED_CLASSES: List[Type[Base]] = [
DDR1stMix,
DDR2ndMix,

View File

@ -6,7 +6,6 @@ from bemani.common import VersionConstants
class DDRX(DDRBase):
name: str = "DanceDanceRevolution X"
version: int = VersionConstants.DDR_X
@ -15,7 +14,6 @@ class DDRX(DDRBase):
class DDRSuperNova2(DDRBase):
name: str = "DanceDanceRevolution SuperNova 2"
version: int = VersionConstants.DDR_SUPERNOVA_2
@ -24,7 +22,6 @@ class DDRSuperNova2(DDRBase):
class DDRSuperNova(DDRBase):
name: str = "DanceDanceRevolution SuperNova"
version: int = VersionConstants.DDR_SUPERNOVA
@ -33,7 +30,6 @@ class DDRSuperNova(DDRBase):
class DDRExtreme(DDRBase):
name: str = "DanceDanceRevolution Extreme"
version: int = VersionConstants.DDR_EXTREME
@ -42,7 +38,6 @@ class DDRExtreme(DDRBase):
class DDR7thMix(DDRBase):
name: str = "DanceDanceRevolution 7thMix"
version: int = VersionConstants.DDR_7THMIX
@ -51,7 +46,6 @@ class DDR7thMix(DDRBase):
class DDR6thMix(DDRBase):
name: str = "DanceDanceRevolution 6thMix"
version: int = VersionConstants.DDR_6THMIX
@ -60,7 +54,6 @@ class DDR6thMix(DDRBase):
class DDR5thMix(DDRBase):
name: str = "DanceDanceRevolution 5thMix"
version: int = VersionConstants.DDR_5THMIX
@ -69,7 +62,6 @@ class DDR5thMix(DDRBase):
class DDR4thMix(DDRBase):
name: str = "DanceDanceRevolution 4thMix"
version: int = VersionConstants.DDR_4THMIX
@ -78,7 +70,6 @@ class DDR4thMix(DDRBase):
class DDR3rdMix(DDRBase):
name: str = "DanceDanceRevolution 3rdMix"
version: int = VersionConstants.DDR_3RDMIX
@ -87,7 +78,6 @@ class DDR3rdMix(DDRBase):
class DDR2ndMix(DDRBase):
name: str = "DanceDanceRevolution 2ndMix"
version: int = VersionConstants.DDR_2NDMIX
@ -96,6 +86,5 @@ class DDR2ndMix(DDRBase):
class DDR1stMix(DDRBase):
name: str = "DanceDanceRevolution 1stMix"
version: int = VersionConstants.DDR_1STMIX

View File

@ -237,7 +237,7 @@ class IIDXBase(CoreHandler, CardManagerHandler, PASELIHandler, Base):
)
attempts: Dict[int, Dict[int, Dict[str, int]]] = {}
for (_, attempt) in all_attempts:
for _, attempt in all_attempts:
if attempt.data.get_int("clear_status") == self.CLEAR_STATUS_NO_PLAY:
# This attempt was outside of the clear infra, so don't bother with it.
continue

View File

@ -7,7 +7,6 @@ from bemani.common import VersionConstants
class IIDXBistrover(IIDXBase):
name: str = "Beatmania IIDX BISTROVER"
version: int = VersionConstants.IIDX_BISTROVER

View File

@ -22,7 +22,6 @@ from bemani.protocol import Node
class IIDXCannonBallers(IIDXCourse, IIDXBase):
name: str = "Beatmania IIDX CANNON BALLERS"
version: int = VersionConstants.IIDX_CANNON_BALLERS
@ -844,7 +843,7 @@ class IIDXCannonBallers(IIDXCourse, IIDXBase):
reverse=True,
)
missing_players = [uid for (uid, _) in all_scores if uid not in all_players]
for (uid, prof) in self.get_any_profiles(missing_players):
for uid, prof in self.get_any_profiles(missing_players):
all_players[uid] = prof
if not global_scores:

View File

@ -21,7 +21,6 @@ from bemani.protocol import Node
class IIDXCopula(IIDXCourse, IIDXBase):
name: str = "Beatmania IIDX copula"
version: int = VersionConstants.IIDX_COPULA
@ -721,7 +720,7 @@ class IIDXCopula(IIDXCourse, IIDXBase):
reverse=True,
)
missing_players = [uid for (uid, _) in all_scores if uid not in all_players]
for (uid, prof) in self.get_any_profiles(missing_players):
for uid, prof in self.get_any_profiles(missing_players):
all_players[uid] = prof
if not global_scores:

View File

@ -8,7 +8,6 @@ from bemani.data import UserID
class IIDXCourse(IIDXBase):
COURSE_TYPE_SECRET: Final[str] = "secret_course"
COURSE_TYPE_INTERNET_RANKING: Final[str] = "ir_course"
COURSE_TYPE_CLASSIC: Final[str] = "classic_course"

View File

@ -36,7 +36,6 @@ from bemani.data import Config, Data
class IIDXFactory(Factory):
MANAGED_CLASSES: List[Type[Base]] = [
IIDX1stStyle,
IIDX2ndStyle,

View File

@ -7,7 +7,6 @@ from bemani.common import VersionConstants
class IIDXHeroicVerse(IIDXBase):
name: str = "Beatmania IIDX HEROIC VERSE"
version: int = VersionConstants.IIDX_HEROIC_VERSE

View File

@ -21,7 +21,6 @@ from bemani.protocol import Node
class IIDXPendual(IIDXCourse, IIDXBase):
name: str = "Beatmania IIDX PENDUAL"
version: int = VersionConstants.IIDX_PENDUAL
@ -724,7 +723,7 @@ class IIDXPendual(IIDXCourse, IIDXBase):
reverse=True,
)
missing_players = [uid for (uid, _) in all_scores if uid not in all_players]
for (uid, prof) in self.get_any_profiles(missing_players):
for uid, prof in self.get_any_profiles(missing_players):
all_players[uid] = prof
if not global_scores:
@ -1301,7 +1300,7 @@ class IIDXPendual(IIDXCourse, IIDXBase):
# Ranking details in title screen
rankingcharts = []
for (mid, _plays) in self.data.local.music.get_hit_chart(
for mid, _plays in self.data.local.music.get_hit_chart(
self.game, self.music_version, 20
):
rankingcharts.append(mid)

View File

@ -22,7 +22,6 @@ from bemani.protocol import Node
class IIDXRootage(IIDXCourse, IIDXBase):
name: str = "Beatmania IIDX ROOTAGE"
version: int = VersionConstants.IIDX_ROOTAGE
@ -698,7 +697,7 @@ class IIDXRootage(IIDXCourse, IIDXBase):
reverse=True,
)
missing_players = [uid for (uid, _) in all_scores if uid not in all_players]
for (uid, prof) in self.get_any_profiles(missing_players):
for uid, prof in self.get_any_profiles(missing_players):
all_players[uid] = prof
if not global_scores:

View File

@ -22,7 +22,6 @@ from bemani.protocol import Node
class IIDXSinobuz(IIDXCourse, IIDXBase):
name: str = "Beatmania IIDX SINOBUZ"
version: int = VersionConstants.IIDX_SINOBUZ
@ -845,7 +844,7 @@ class IIDXSinobuz(IIDXCourse, IIDXBase):
reverse=True,
)
missing_players = [uid for (uid, _) in all_scores if uid not in all_players]
for (uid, prof) in self.get_any_profiles(missing_players):
for uid, prof in self.get_any_profiles(missing_players):
all_players[uid] = prof
if not global_scores:

View File

@ -20,7 +20,6 @@ from bemani.protocol import Node
class IIDXSpada(IIDXBase):
name: str = "Beatmania IIDX SPADA"
version: int = VersionConstants.IIDX_SPADA
@ -655,7 +654,7 @@ class IIDXSpada(IIDXBase):
reverse=True,
)
missing_players = [uid for (uid, _) in all_scores if uid not in all_players]
for (uid, prof) in self.get_any_profiles(missing_players):
for uid, prof in self.get_any_profiles(missing_players):
all_players[uid] = prof
if not global_scores:

View File

@ -6,13 +6,11 @@ from bemani.common import VersionConstants
class IIDX1stStyle(IIDXBase):
name: str = "Beatmania IIDX 1st style & substream"
version: int = VersionConstants.IIDX
class IIDX2ndStyle(IIDXBase):
name: str = "Beatmania IIDX 2nd style"
version: int = VersionConstants.IIDX_2ND_STYLE
@ -21,7 +19,6 @@ class IIDX2ndStyle(IIDXBase):
class IIDX3rdStyle(IIDXBase):
name: str = "Beatmania IIDX 3rd style"
version: int = VersionConstants.IIDX_3RD_STYLE
@ -30,7 +27,6 @@ class IIDX3rdStyle(IIDXBase):
class IIDX4thStyle(IIDXBase):
name: str = "Beatmania IIDX 4th style"
version: int = VersionConstants.IIDX_4TH_STYLE
@ -39,7 +35,6 @@ class IIDX4thStyle(IIDXBase):
class IIDX5thStyle(IIDXBase):
name: str = "Beatmania IIDX 5th style"
version: int = VersionConstants.IIDX_5TH_STYLE
@ -48,7 +43,6 @@ class IIDX5thStyle(IIDXBase):
class IIDX6thStyle(IIDXBase):
name: str = "Beatmania IIDX 6th style"
version: int = VersionConstants.IIDX_6TH_STYLE
@ -57,7 +51,6 @@ class IIDX6thStyle(IIDXBase):
class IIDX7thStyle(IIDXBase):
name: str = "Beatmania IIDX 7th style"
version: int = VersionConstants.IIDX_7TH_STYLE
@ -66,7 +59,6 @@ class IIDX7thStyle(IIDXBase):
class IIDX8thStyle(IIDXBase):
name: str = "Beatmania IIDX 8th style"
version: int = VersionConstants.IIDX_8TH_STYLE
@ -75,7 +67,6 @@ class IIDX8thStyle(IIDXBase):
class IIDX9thStyle(IIDXBase):
name: str = "Beatmania IIDX 9th style"
version: int = VersionConstants.IIDX_9TH_STYLE
@ -84,7 +75,6 @@ class IIDX9thStyle(IIDXBase):
class IIDX10thStyle(IIDXBase):
name: str = "Beatmania IIDX 10th style"
version: int = VersionConstants.IIDX_10TH_STYLE
@ -93,7 +83,6 @@ class IIDX10thStyle(IIDXBase):
class IIDXRed(IIDXBase):
name: str = "Beatmania IIDX RED"
version: int = VersionConstants.IIDX_RED
@ -102,7 +91,6 @@ class IIDXRed(IIDXBase):
class IIDXHappySky(IIDXBase):
name: str = "Beatmania IIDX HAPPY SKY"
version: int = VersionConstants.IIDX_HAPPY_SKY
@ -111,7 +99,6 @@ class IIDXHappySky(IIDXBase):
class IIDXDistorted(IIDXBase):
name: str = "Beatmania IIDX DistorteD"
version: int = VersionConstants.IIDX_DISTORTED
@ -120,7 +107,6 @@ class IIDXDistorted(IIDXBase):
class IIDXGold(IIDXBase):
name: str = "Beatmania IIDX GOLD"
version: int = VersionConstants.IIDX_GOLD
@ -129,7 +115,6 @@ class IIDXGold(IIDXBase):
class IIDXDJTroopers(IIDXBase):
name: str = "Beatmania IIDX DJ TROOPERS"
version: int = VersionConstants.IIDX_DJ_TROOPERS
@ -138,7 +123,6 @@ class IIDXDJTroopers(IIDXBase):
class IIDXEmpress(IIDXBase):
name: str = "Beatmania IIDX EMPRESS"
version: int = VersionConstants.IIDX_EMPRESS
@ -147,7 +131,6 @@ class IIDXEmpress(IIDXBase):
class IIDXSirius(IIDXBase):
name: str = "Beatmania IIDX SIRIUS"
version: int = VersionConstants.IIDX_SIRIUS
@ -156,7 +139,6 @@ class IIDXSirius(IIDXBase):
class IIDXResortAnthem(IIDXBase):
name: str = "Beatmania IIDX Resort Anthem"
version: int = VersionConstants.IIDX_RESORT_ANTHEM
@ -165,7 +147,6 @@ class IIDXResortAnthem(IIDXBase):
class IIDXLincle(IIDXBase):
name: str = "Beatmania IIDX Lincle"
version: int = VersionConstants.IIDX_LINCLE

View File

@ -12,7 +12,6 @@ from bemani.protocol import Node
class IIDXTricoro(IIDXBase):
name: str = "Beatmania IIDX Tricoro"
version: int = VersionConstants.IIDX_TRICORO
@ -647,7 +646,7 @@ class IIDXTricoro(IIDXBase):
reverse=True,
)
missing_players = [uid for (uid, _) in all_scores if uid not in all_players]
for (uid, prof) in self.get_any_profiles(missing_players):
for uid, prof in self.get_any_profiles(missing_players):
all_players[uid] = prof
if not global_scores:

View File

@ -7,7 +7,6 @@ from bemani.common import VersionConstants
class JubeatAvenue(JubeatBase):
name: str = "Jubeat Avenue"
version: int = VersionConstants.JUBEAT_AVENUE

View File

@ -29,7 +29,6 @@ class JubeatClan(
JubeatLoggerReportHandler,
JubeatBase,
):
name: str = "Jubeat Clan"
version: int = VersionConstants.JUBEAT_CLAN

View File

@ -7,7 +7,6 @@ from bemani.backend.jubeat.base import JubeatBase
class JubeatCourse(JubeatBase):
COURSE_RATING_FAILED: Final[int] = 100
COURSE_RATING_BRONZE: Final[int] = 200
COURSE_RATING_SILVER: Final[int] = 300

View File

@ -22,7 +22,6 @@ from bemani.data import Config, Data
class JubeatFactory(Factory):
MANAGED_CLASSES: List[Type[Base]] = [
Jubeat,
JubeatRipples,

View File

@ -29,7 +29,6 @@ class JubeatFesto(
JubeatLoggerReportHandler,
JubeatBase,
):
name: str = "Jubeat Festo"
version: int = VersionConstants.JUBEAT_FESTO

View File

@ -31,7 +31,6 @@ class JubeatProp(
JubeatCourse,
JubeatBase,
):
name: str = "Jubeat Prop"
version: int = VersionConstants.JUBEAT_PROP
@ -1621,7 +1620,6 @@ class JubeatProp(
def format_scores(
self, userid: UserID, profile: Profile, scores: List[Score]
) -> Node:
root = Node.void("gametop")
datanode = Node.void("data")
root.add_child(datanode)

View File

@ -29,7 +29,6 @@ class JubeatQubell(
JubeatLoggerReportHandler,
JubeatBase,
):
name: str = "Jubeat Qubell"
version: int = VersionConstants.JUBEAT_QUBELL

View File

@ -27,7 +27,6 @@ class JubeatSaucer(
JubeatLoggerReportHandler,
JubeatBase,
):
name: str = "Jubeat Saucer"
version: int = VersionConstants.JUBEAT_SAUCER
@ -905,7 +904,6 @@ class JubeatSaucer(
def format_scores(
self, userid: UserID, profile: Profile, scores: List[Score]
) -> Node:
root = Node.void("gametop")
datanode = Node.void("data")
root.add_child(datanode)

View File

@ -30,7 +30,6 @@ class JubeatSaucerFulfill(
JubeatCourse,
JubeatBase,
):
name: str = "Jubeat Saucer Fulfill"
version: int = VersionConstants.JUBEAT_SAUCER_FULFILL
@ -1018,7 +1017,6 @@ class JubeatSaucerFulfill(
def format_scores(
self, userid: UserID, profile: Profile, scores: List[Score]
) -> Node:
root = Node.void("gametop")
datanode = Node.void("data")
root.add_child(datanode)

View File

@ -6,13 +6,11 @@ from bemani.common import VersionConstants
class Jubeat(JubeatBase):
name: str = "Jubeat"
version: int = VersionConstants.JUBEAT
class JubeatRipples(JubeatBase):
name: str = "Jubeat Ripples"
version: int = VersionConstants.JUBEAT_RIPPLES
@ -21,7 +19,6 @@ class JubeatRipples(JubeatBase):
class JubeatRipplesAppend(JubeatBase):
name: str = "Jubeat Ripples Append"
version: int = VersionConstants.JUBEAT_RIPPLES_APPEND
@ -30,7 +27,6 @@ class JubeatRipplesAppend(JubeatBase):
class JubeatKnit(JubeatBase):
name: str = "Jubeat Knit"
version: int = VersionConstants.JUBEAT_KNIT
@ -39,7 +35,6 @@ class JubeatKnit(JubeatBase):
class JubeatKnitAppend(JubeatBase):
name: str = "Jubeat Knit Append"
version: int = VersionConstants.JUBEAT_KNIT_APPEND
@ -48,7 +43,6 @@ class JubeatKnitAppend(JubeatBase):
class JubeatCopious(JubeatBase):
name: str = "Jubeat Copious"
version: int = VersionConstants.JUBEAT_COPIOUS
@ -57,7 +51,6 @@ class JubeatCopious(JubeatBase):
class JubeatCopiousAppend(JubeatBase):
name: str = "Jubeat Copious Append"
version: int = VersionConstants.JUBEAT_COPIOUS_APPEND

View File

@ -7,7 +7,6 @@ from bemani.data import Config, Data
class MetalGearArcadeFactory(Factory):
MANAGED_CLASSES: List[Type[Base]] = [
MetalGearArcade,
]
@ -25,7 +24,6 @@ class MetalGearArcadeFactory(Factory):
model: Model,
parentmodel: Optional[Model] = None,
) -> Optional[Base]:
if model.gamecode == "I36":
return MetalGearArcade(data, config, model)

View File

@ -13,7 +13,6 @@ class MetalGearArcade(
EventLogHandler,
MetalGearArcadeBase,
):
name: str = "Metal Gear Arcade"
version: int = VersionConstants.MGA

View File

@ -166,7 +166,7 @@ class MusecaBase(CoreHandler, CardManagerHandler, PASELIHandler, Base):
]
)
attempts: Dict[int, Dict[int, Dict[str, int]]] = {}
for (_, attempt) in all_attempts:
for _, attempt in all_attempts:
# Terrible temporary structure is terrible.
if attempt.id not in attempts:
attempts[attempt.id] = {}

View File

@ -26,7 +26,7 @@ class MusecaGameHiscoreHandler(MusecaBase):
hitchart = Node.void("hitchart")
game.add_child(hitchart)
for (songid, count) in playcounts:
for songid, count in playcounts:
info = Node.void("info")
hitchart.add_child(info)
info.add_child(Node.u32("id", songid))
@ -42,7 +42,7 @@ class MusecaGameHiscoreHandler(MusecaBase):
game.add_child(hiscore_allover)
# Output records
for (userid, score) in records:
for userid, score in records:
info = Node.void("info")
if userid not in users:
@ -70,14 +70,14 @@ class MusecaGameHiscoreHandler(MusecaBase):
self.game, self.version, userlist=area_users
)
missing_players = [uid for (uid, _) in records if uid not in users]
for (uid, prof) in self.get_any_profiles(missing_players):
for uid, prof in self.get_any_profiles(missing_players):
users[uid] = prof
hiscore_location = Node.void("hiscore_location")
game.add_child(hiscore_location)
# Output records
for (userid, score) in records:
for userid, score in records:
info = Node.void("info")
if userid not in users:

View File

@ -8,7 +8,6 @@ from bemani.data import Config, Data
class MusecaFactory(Factory):
MANAGED_CLASSES: List[Type[Base]] = [
Museca1,
Museca1Plus,

View File

@ -28,7 +28,6 @@ class Museca1(
MusecaGameShopHandler,
MusecaBase,
):
name: str = "MÚSECA"
version: int = VersionConstants.MUSECA
@ -125,7 +124,7 @@ class Museca1(
):
ids.add((song.id, song.chart))
for (songid, chart) in ids:
for songid, chart in ids:
info = Node.void("info")
limited.add_child(info)
info.add_child(Node.s32("music_id", songid))

View File

@ -29,7 +29,6 @@ class Museca1Plus(
MusecaGameShopHandler,
MusecaBase,
):
name: str = "MÚSECA 1+1/2"
version: int = VersionConstants.MUSECA_1_PLUS
@ -137,7 +136,7 @@ class Museca1Plus(
):
ids.add((song.id, song.chart))
for (songid, chart) in ids:
for songid, chart in ids:
info = Node.void("info")
limited.add_child(info)
info.add_child(Node.s32("music_id", songid))

View File

@ -12,7 +12,6 @@ from bemani.protocol import Node
class PopnMusicModernBase(PopnMusicBase, ABC):
# Chart type, as returned from the game
GAME_CHART_TYPE_EASY: Final[int] = 0
GAME_CHART_TYPE_NORMAL: Final[int] = 1
@ -304,7 +303,7 @@ class PopnMusicModernBase(PopnMusicBase, ABC):
# Calculate most popular characters
profiles = self.data.remote.user.get_all_profiles(self.game, self.version)
charas: Dict[int, int] = {}
for (_userid, profile) in profiles:
for _userid, profile in profiles:
chara = profile.get_int("chara", -1)
if chara <= 0:
continue
@ -328,7 +327,7 @@ class PopnMusicModernBase(PopnMusicBase, ABC):
popular.add_child(Node.s16("chara_num", charaid))
# Top 500 Popular music
for (songid, _plays) in self.data.local.music.get_hit_chart(
for songid, _plays in self.data.local.music.get_hit_chart(
self.game, self.version, 500
):
popular_music = Node.void("popular_music")

View File

@ -12,7 +12,6 @@ from bemani.protocol import Node
class PopnMusicEclale(PopnMusicBase):
name: str = "Pop'n Music éclale"
version: int = VersionConstants.POPN_MUSIC_ECLALE
@ -184,7 +183,7 @@ class PopnMusicEclale(PopnMusicBase):
# Calculate most popular characters
profiles = self.data.remote.user.get_all_profiles(self.game, self.version)
charas: Dict[int, int] = {}
for (_userid, profile) in profiles:
for _userid, profile in profiles:
chara = profile.get_int("chara", -1)
if chara <= 0:
continue
@ -202,7 +201,7 @@ class PopnMusicEclale(PopnMusicBase):
# Output the top 20 of them
rank = 1
for (charaid, _usecount) in charamap[:20]:
for charaid, _usecount in charamap[:20]:
popular = Node.void("popular")
root.add_child(popular)
popular.add_child(Node.s16("rank", rank))
@ -210,7 +209,7 @@ class PopnMusicEclale(PopnMusicBase):
rank = rank + 1
# Output the hit chart
for (songid, _plays) in self.data.local.music.get_hit_chart(
for songid, _plays in self.data.local.music.get_hit_chart(
self.game, self.version, 500
):
popular_music = Node.void("popular_music")

View File

@ -34,7 +34,6 @@ from bemani.data import Config, Data
class PopnMusicFactory(Factory):
MANAGED_CLASSES: List[Type[Base]] = [
PopnMusic,
PopnMusic2,

View File

@ -12,7 +12,6 @@ from bemani.protocol import Node
class PopnMusicFantasia(PopnMusicBase):
name: str = "Pop'n Music fantasia"
version: int = VersionConstants.POPN_MUSIC_FANTASIA

View File

@ -13,7 +13,6 @@ from bemani.protocol.node import Node
class PopnMusicKaimei(PopnMusicModernBase):
name: str = "Pop'n Music 解明リドルズ"
version: int = VersionConstants.POPN_MUSIC_KAIMEI_RIDDLES

View File

@ -12,7 +12,6 @@ from bemani.protocol import Node
class PopnMusicLapistoria(PopnMusicBase):
name: str = "Pop'n Music ラピストリア"
version: int = VersionConstants.POPN_MUSIC_LAPISTORIA

View File

@ -8,7 +8,6 @@ from bemani.common import VersionConstants
class PopnMusicPeace(PopnMusicModernBase):
name: str = "Pop'n Music peace"
version: int = VersionConstants.POPN_MUSIC_PEACE

View File

@ -6,13 +6,11 @@ from bemani.common import VersionConstants
class PopnMusic(PopnMusicBase):
name: str = "Pop'n Music"
version: int = VersionConstants.POPN_MUSIC
class PopnMusic2(PopnMusicBase):
name: str = "Pop'n Music 2"
version: int = VersionConstants.POPN_MUSIC_2
@ -21,7 +19,6 @@ class PopnMusic2(PopnMusicBase):
class PopnMusic3(PopnMusicBase):
name: str = "Pop'n Music 3"
version: int = VersionConstants.POPN_MUSIC_3
@ -30,7 +27,6 @@ class PopnMusic3(PopnMusicBase):
class PopnMusic4(PopnMusicBase):
name: str = "Pop'n Music 4"
version: int = VersionConstants.POPN_MUSIC_4
@ -39,7 +35,6 @@ class PopnMusic4(PopnMusicBase):
class PopnMusic5(PopnMusicBase):
name: str = "Pop'n Music 5"
version: int = VersionConstants.POPN_MUSIC_5
@ -48,7 +43,6 @@ class PopnMusic5(PopnMusicBase):
class PopnMusic6(PopnMusicBase):
name: str = "Pop'n Music 6"
version: int = VersionConstants.POPN_MUSIC_6
@ -57,7 +51,6 @@ class PopnMusic6(PopnMusicBase):
class PopnMusic7(PopnMusicBase):
name: str = "Pop'n Music 7"
version: int = VersionConstants.POPN_MUSIC_7
@ -66,7 +59,6 @@ class PopnMusic7(PopnMusicBase):
class PopnMusic8(PopnMusicBase):
name: str = "Pop'n Music 8"
version: int = VersionConstants.POPN_MUSIC_8
@ -75,7 +67,6 @@ class PopnMusic8(PopnMusicBase):
class PopnMusic9(PopnMusicBase):
name: str = "Pop'n Music 9"
version: int = VersionConstants.POPN_MUSIC_9
@ -84,7 +75,6 @@ class PopnMusic9(PopnMusicBase):
class PopnMusic10(PopnMusicBase):
name: str = "Pop'n Music 10"
version: int = VersionConstants.POPN_MUSIC_10
@ -93,7 +83,6 @@ class PopnMusic10(PopnMusicBase):
class PopnMusic11(PopnMusicBase):
name: str = "Pop'n Music 11"
version: int = VersionConstants.POPN_MUSIC_11
@ -102,7 +91,6 @@ class PopnMusic11(PopnMusicBase):
class PopnMusicIroha(PopnMusicBase):
name: str = "Pop'n Music いろは"
version: int = VersionConstants.POPN_MUSIC_IROHA
@ -111,7 +99,6 @@ class PopnMusicIroha(PopnMusicBase):
class PopnMusicCarnival(PopnMusicBase):
name: str = "Pop'n Music カーニバル"
version: int = VersionConstants.POPN_MUSIC_CARNIVAL
@ -120,7 +107,6 @@ class PopnMusicCarnival(PopnMusicBase):
class PopnMusicFever(PopnMusicBase):
name: str = "Pop'n Music FEVER!"
version: int = VersionConstants.POPN_MUSIC_FEVER
@ -129,7 +115,6 @@ class PopnMusicFever(PopnMusicBase):
class PopnMusicAdventure(PopnMusicBase):
name: str = "Pop'n Music ADVENTURE"
version: int = VersionConstants.POPN_MUSIC_ADVENTURE
@ -138,7 +123,6 @@ class PopnMusicAdventure(PopnMusicBase):
class PopnMusicParty(PopnMusicBase):
name: str = "Pop'n Music Party♪"
version: int = VersionConstants.POPN_MUSIC_PARTY
@ -147,7 +131,6 @@ class PopnMusicParty(PopnMusicBase):
class PopnMusicTheMovie(PopnMusicBase):
name: str = "Pop'n Music THE MOVIE"
version: int = VersionConstants.POPN_MUSIC_THE_MOVIE
@ -156,7 +139,6 @@ class PopnMusicTheMovie(PopnMusicBase):
class PopnMusicSengokuRetsuden(PopnMusicBase):
name: str = "Pop'n Music せんごく列伝"
version: int = VersionConstants.POPN_MUSIC_SENGOKU_RETSUDEN

View File

@ -12,7 +12,6 @@ from bemani.protocol import Node
class PopnMusicSunnyPark(PopnMusicBase):
name: str = "Pop'n Music Sunny Park"
version: int = VersionConstants.POPN_MUSIC_SUNNY_PARK

View File

@ -12,7 +12,6 @@ from bemani.protocol import Node
class PopnMusicTuneStreet(PopnMusicBase):
name: str = "Pop'n Music TUNE STREET"
version: int = VersionConstants.POPN_MUSIC_TUNE_STREET

View File

@ -8,7 +8,6 @@ from bemani.common import VersionConstants
class PopnMusicUsaNeko(PopnMusicModernBase):
name: str = "Pop'n Music うさぎと猫と少年の夢"
version: int = VersionConstants.POPN_MUSIC_USANEKO

View File

@ -10,7 +10,6 @@ from bemani.protocol import Node
class ReflecBeatColette(ReflecBeatBase):
name: str = "REFLEC BEAT colette"
version: int = VersionConstants.REFLEC_BEAT_COLETTE
@ -130,7 +129,7 @@ class ReflecBeatColette(ReflecBeatBase):
9: 0,
}
for (eventid, phase) in events.items():
for eventid, phase in events.items():
data = Node.void("data")
event_ctrl.add_child(data)
data.add_child(Node.s32("type", eventid))
@ -168,7 +167,7 @@ class ReflecBeatColette(ReflecBeatBase):
new = Node.void("new")
base.add_child(new)
for (mid, plays) in hitchart:
for mid, plays in hitchart:
d = Node.void("d")
new.add_child(d)
d.add_child(Node.s16("mid", mid))
@ -247,7 +246,7 @@ class ReflecBeatColette(ReflecBeatBase):
)
def add_comments(name: str, selected: List[Tuple[UserID, Achievement]]) -> None:
for (uid, ach) in selected:
for uid, ach in selected:
cmnt = Node.void(name)
root.add_child(cmnt)
cmnt.add_child(Node.s32("uid", uid_mapping[uid].extid))
@ -431,7 +430,7 @@ class ReflecBeatColette(ReflecBeatBase):
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
if userid is not None:
lobbies = self.data.local.lobby.get_all_lobbies(self.game, self.version)
for (user, lobby) in lobbies:
for user, lobby in lobbies:
if limit <= 0:
break

View File

@ -12,7 +12,6 @@ from bemani.data import Config, Data
class ReflecBeatFactory(Factory):
MANAGED_CLASSES: List[Type[Base]] = [
ReflecBeat,
ReflecBeatLimelight,

View File

@ -10,7 +10,6 @@ from bemani.protocol import Node
class ReflecBeatGroovin(ReflecBeatBase):
name: str = "REFLEC BEAT groovin'!!"
version: int = VersionConstants.REFLEC_BEAT_GROOVIN
@ -203,7 +202,7 @@ class ReflecBeatGroovin(ReflecBeatBase):
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
if userid is not None:
lobbies = self.data.local.lobby.get_all_lobbies(self.game, self.version)
for (user, lobby) in lobbies:
for user, lobby in lobbies:
if limit <= 0:
break
@ -318,7 +317,7 @@ class ReflecBeatGroovin(ReflecBeatBase):
profile for profile in all_profiles if profile[1].get_int("lid", -1) in lids
]
for (rootnode, timeoffset) in [
for rootnode, timeoffset in [
(today, 0),
(yesterday, Time.SECONDS_IN_DAY),
]:
@ -334,7 +333,7 @@ class ReflecBeatGroovin(ReflecBeatBase):
# Calculate scores based on attempt
scores_by_user: Dict[UserID, Dict[int, Dict[int, Attempt]]] = {}
for (userid, attempt) in relevant_attempts:
for userid, attempt in relevant_attempts:
if userid not in scores_by_user:
scores_by_user[userid] = {}
if attempt.id not in scores_by_user[userid]:
@ -362,7 +361,7 @@ class ReflecBeatGroovin(ReflecBeatBase):
)
# Output that day's earned points
for (userid, profile) in relevant_profiles:
for userid, profile in relevant_profiles:
data = Node.void("data")
rootnode.add_child(data)
data.add_child(
@ -409,7 +408,7 @@ class ReflecBeatGroovin(ReflecBeatBase):
new = Node.void("new")
base.add_child(new)
for (mid, plays) in hitchart:
for mid, plays in hitchart:
d = Node.void("d")
new.add_child(d)
d.add_child(Node.s16("mid", mid))
@ -546,7 +545,7 @@ class ReflecBeatGroovin(ReflecBeatBase):
)
def add_comments(name: str, selected: List[Tuple[UserID, Achievement]]) -> None:
for (uid, ach) in selected:
for uid, ach in selected:
cmnt = Node.void(name)
root.add_child(cmnt)
cmnt.add_child(Node.s32("uid", uid_mapping[uid].extid))

View File

@ -10,7 +10,6 @@ from bemani.protocol import Node
class ReflecBeatLimelight(ReflecBeatBase):
name: str = "REFLEC BEAT limelight"
version: int = VersionConstants.REFLEC_BEAT_LIMELIGHT
@ -134,7 +133,7 @@ class ReflecBeatLimelight(ReflecBeatBase):
def __add_event_info(self, request: Node) -> None:
events: Dict[int, int] = {}
for (_eventid, _phase) in events.items():
for _eventid, _phase in events.items():
data = Node.void("data")
request.add_child(data)
data.add_child(Node.s32("type", -1))
@ -163,7 +162,7 @@ class ReflecBeatLimelight(ReflecBeatBase):
hitchart = self.data.local.music.get_hit_chart(self.game, self.version, 10)
rank = 1
for (mid, _plays) in hitchart:
for mid, _plays in hitchart:
record = Node.void("record")
originals.add_child(record)
record.add_child(Node.s16("id", mid))
@ -211,7 +210,7 @@ class ReflecBeatLimelight(ReflecBeatBase):
commentnode = Node.void("comment")
root.add_child(commentnode)
for (uid, comment) in comments:
for uid, comment in comments:
lid = ID.parse_machine_id(comment.data.get_str("lid"))
# Look up external data for the request
@ -237,7 +236,7 @@ class ReflecBeatLimelight(ReflecBeatBase):
c.add_child(Node.string("comment", comment.data.get_str("comment")))
c.add_child(Node.bool("is_tweet", comment.data.get_bool("tweet")))
for (uid, status) in statuses:
for uid, status in statuses:
lid = ID.parse_machine_id(status.get_str("lid"))
# Look up external data for the request
@ -408,7 +407,7 @@ class ReflecBeatLimelight(ReflecBeatBase):
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
if userid is not None:
lobbies = self.data.local.lobby.get_all_lobbies(self.game, self.version)
for (user, lobby) in lobbies:
for user, lobby in lobbies:
if limit <= 0:
break

View File

@ -9,7 +9,6 @@ from bemani.protocol import Node
class ReflecBeat(ReflecBeatBase):
name: str = "REFLEC BEAT"
version: int = VersionConstants.REFLEC_BEAT
@ -129,7 +128,7 @@ class ReflecBeat(ReflecBeatBase):
def __add_event_info(self, request: Node) -> None:
events: Dict[int, int] = {}
for (_eventid, _phase) in events.items():
for _eventid, _phase in events.items():
data = Node.void("data")
request.add_child(data)
data.add_child(Node.s32("type", -1))
@ -210,7 +209,7 @@ class ReflecBeat(ReflecBeatBase):
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
if userid is not None:
lobbies = self.data.local.lobby.get_all_lobbies(self.game, self.version)
for (user, lobby) in lobbies:
for user, lobby in lobbies:
if limit <= 0:
break

View File

@ -10,7 +10,6 @@ from bemani.protocol import Node
class ReflecBeatVolzza(ReflecBeatVolzzaBase):
name: str = "REFLEC BEAT VOLZZA"
version: int = VersionConstants.REFLEC_BEAT_VOLZZA
@ -168,7 +167,7 @@ class ReflecBeatVolzza(ReflecBeatVolzzaBase):
scores_by_musicid[score.id] = [None, None, None, None]
scores_by_musicid[score.id][score.chart] = score
for (mid, scores) in scores_by_musicid.items():
for mid, scores in scores_by_musicid.items():
points = [
score.points << 32 if score is not None else 0
for score in scores

View File

@ -10,7 +10,6 @@ from bemani.protocol import Node
class ReflecBeatVolzza2(ReflecBeatVolzzaBase):
name: str = "REFLEC BEAT VOLZZA 2"
version: int = VersionConstants.REFLEC_BEAT_VOLZZA_2
@ -192,7 +191,7 @@ class ReflecBeatVolzza2(ReflecBeatVolzzaBase):
scores_by_musicid[score.id] = [None, None, None, None]
scores_by_musicid[score.id][score.chart] = score
for (mid, scores) in scores_by_musicid.items():
for mid, scores in scores_by_musicid.items():
points = [
score.points << 32 if score is not None else 0
for score in scores

View File

@ -9,7 +9,6 @@ from bemani.protocol import Node
class ReflecBeatVolzzaBase(ReflecBeatBase):
# Clear types according to the game
GAME_CLEAR_TYPE_NO_PLAY: Final[int] = 0
GAME_CLEAR_TYPE_EARLY_FAILED: Final[int] = 1
@ -99,7 +98,7 @@ class ReflecBeatVolzzaBase(ReflecBeatBase):
profile for profile in all_profiles if profile[1].get_int("lid", -1) in lids
]
for (rootnode, timeoffset) in [
for rootnode, timeoffset in [
(today, 0),
(yesterday, Time.SECONDS_IN_DAY),
]:
@ -115,7 +114,7 @@ class ReflecBeatVolzzaBase(ReflecBeatBase):
# Calculate scores based on attempt
scores_by_user: Dict[UserID, Dict[int, Dict[int, Attempt]]] = {}
for (userid, attempt) in relevant_attempts:
for userid, attempt in relevant_attempts:
if userid not in scores_by_user:
scores_by_user[userid] = {}
if attempt.id not in scores_by_user[userid]:
@ -143,7 +142,7 @@ class ReflecBeatVolzzaBase(ReflecBeatBase):
)
# Output that day's earned points
for (userid, profile) in relevant_profiles:
for userid, profile in relevant_profiles:
data = Node.void("data")
rootnode.add_child(data)
data.add_child(
@ -187,7 +186,7 @@ class ReflecBeatVolzzaBase(ReflecBeatBase):
new = Node.void("new")
base.add_child(new)
for (mid, plays) in hitchart:
for mid, plays in hitchart:
d = Node.void("d")
new.add_child(d)
d.add_child(Node.s16("mid", mid))
@ -358,7 +357,7 @@ class ReflecBeatVolzzaBase(ReflecBeatBase):
userid = self.data.remote.user.from_extid(self.game, self.version, extid)
if userid is not None:
lobbies = self.data.local.lobby.get_all_lobbies(self.game, self.version)
for (user, lobby) in lobbies:
for user, lobby in lobbies:
if limit <= 0:
break

View File

@ -140,7 +140,7 @@ class SoundVoltexBase(CoreHandler, CardManagerHandler, PASELIHandler, Base):
]
)
attempts: Dict[int, Dict[int, Dict[str, int]]] = {}
for (_, attempt) in all_attempts:
for _, attempt in all_attempts:
# Terrible temporary structure is terrible.
if attempt.id not in attempts:
attempts[attempt.id] = {}

View File

@ -13,7 +13,6 @@ class SoundVoltexBooth(
EventLogHandler,
SoundVoltexBase,
):
name: str = "SOUND VOLTEX BOOTH"
version: int = VersionConstants.SDVX_BOOTH

View File

@ -12,7 +12,6 @@ from bemani.data import Config, Data
class SoundVoltexFactory(Factory):
MANAGED_CLASSES: List[Type[Base]] = [
SoundVoltexBooth,
SoundVoltexInfiniteInfection,

View File

@ -13,7 +13,6 @@ class SoundVoltexGravityWars(
EventLogHandler,
SoundVoltexBase,
):
name: str = "SOUND VOLTEX III GRAVITY WARS"
version: int = VersionConstants.SDVX_GRAVITY_WARS
@ -171,7 +170,7 @@ class SoundVoltexGravityWars(
):
ids.add((song.id, song.chart))
for (songid, chart) in ids:
for songid, chart in ids:
info = Node.void("info")
limited.add_child(info)
info.add_child(Node.s32("music_id", songid))

View File

@ -3054,7 +3054,7 @@ class SoundVoltexGravityWarsSeason1(
hitchart = Node.void("hitchart")
game.add_child(hitchart)
for (songid, count) in playcounts:
for songid, count in playcounts:
info = Node.void("info")
hitchart.add_child(info)
info.add_child(Node.u32("id", songid))
@ -3072,7 +3072,7 @@ class SoundVoltexGravityWarsSeason1(
game.add_child(hiscore_allover)
# Output records
for (userid, score) in records:
for userid, score in records:
info = Node.void("info")
if userid not in users:
@ -3100,14 +3100,14 @@ class SoundVoltexGravityWarsSeason1(
self.game, self.version, userlist=area_users
)
missing_users = [userid for (userid, _) in records if userid not in users]
for (userid, profile) in self.get_any_profiles(missing_users):
for userid, profile in self.get_any_profiles(missing_users):
users[userid] = profile
hiscore_location = Node.void("hiscore_location")
game.add_child(hiscore_location)
# Output records
for (userid, score) in records:
for userid, score in records:
info = Node.void("info")
if userid not in users:

View File

@ -3842,7 +3842,7 @@ class SoundVoltexGravityWarsSeason2(
hitchart = Node.void("hit")
game.add_child(hitchart)
for (songid, count) in playcounts:
for songid, count in playcounts:
info = Node.void("d")
hitchart.add_child(info)
info.add_child(Node.u32("id", songid))
@ -3866,10 +3866,10 @@ class SoundVoltexGravityWarsSeason2(
missing_users = [
userid for (userid, _) in global_records if userid not in users
] + [userid for (userid, _) in area_records if userid not in users]
for (userid, profile) in self.get_any_profiles(missing_users):
for userid, profile in self.get_any_profiles(missing_users):
users[userid] = profile
for (userid, score) in global_records:
for userid, score in global_records:
if userid not in users:
raise Exception("Logic error, missing profile for user!")
if score.id not in records:
@ -3878,7 +3878,7 @@ class SoundVoltexGravityWarsSeason2(
records[score.id][score.chart] = {}
records[score.id][score.chart]["global"] = (userid, score)
for (userid, score) in area_records:
for userid, score in area_records:
if userid not in users:
raise Exception("Logic error, missing profile for user!")
if score.id not in records:

View File

@ -14,7 +14,6 @@ class SoundVoltexHeavenlyHaven(
EventLogHandler,
SoundVoltexBase,
):
name: str = "SOUND VOLTEX IV HEAVENLY HAVEN"
version: int = VersionConstants.SDVX_HEAVENLY_HAVEN
@ -3266,7 +3265,7 @@ class SoundVoltexHeavenlyHaven(
):
ids.add((song.id, song.chart))
for (songid, chart) in ids:
for songid, chart in ids:
info = Node.void("info")
limited.add_child(info)
info.add_child(Node.s32("music_id", songid))
@ -3478,10 +3477,10 @@ class SoundVoltexHeavenlyHaven(
missing_users = [
userid for (userid, _) in global_records if userid not in users
] + [userid for (userid, _) in area_records if userid not in users]
for (userid, profile) in self.get_any_profiles(missing_users):
for userid, profile in self.get_any_profiles(missing_users):
users[userid] = profile
for (userid, score) in global_records:
for userid, score in global_records:
if userid not in users:
raise Exception("Logic error, missing profile for user!")
if score.id not in records:
@ -3490,7 +3489,7 @@ class SoundVoltexHeavenlyHaven(
records[score.id][score.chart] = {}
records[score.id][score.chart]["global"] = (userid, score)
for (userid, score) in area_records:
for userid, score in area_records:
if userid not in users:
raise Exception("Logic error, missing profile for user!")
if score.id not in records:

View File

@ -14,7 +14,6 @@ class SoundVoltexInfiniteInfection(
EventLogHandler,
SoundVoltexBase,
):
name: str = "SOUND VOLTEX II -infinite infection-"
version: int = VersionConstants.SDVX_INFINITE_INFECTION
@ -1876,7 +1875,7 @@ class SoundVoltexInfiniteInfection(
):
ids.add((song.id, song.chart))
for (songid, chart) in ids:
for songid, chart in ids:
info = Node.void("info")
limited.add_child(info)
info.add_child(Node.s32("music_id", songid))
@ -1975,7 +1974,7 @@ class SoundVoltexInfiniteInfection(
hitchart = Node.void("hitchart")
game.add_child(hitchart)
for (songid, count) in playcounts:
for songid, count in playcounts:
info = Node.void("info")
hitchart.add_child(info)
info.add_child(Node.u32("id", songid))
@ -1993,7 +1992,7 @@ class SoundVoltexInfiniteInfection(
game.add_child(hiscore_allover)
# Output records
for (userid, score) in records:
for userid, score in records:
info = Node.void("info")
if userid not in users:
@ -2021,14 +2020,14 @@ class SoundVoltexInfiniteInfection(
self.game, self.version, userlist=area_users
)
missing_users = [userid for (userid, _) in records if userid not in users]
for (userid, profile) in self.get_any_profiles(missing_users):
for userid, profile in self.get_any_profiles(missing_users):
users[userid] = profile
hiscore_location = Node.void("hiscore_location")
game.add_child(hiscore_location)
# Output records
for (userid, score) in records:
for userid, score in records:
info = Node.void("info")
if userid not in users:

View File

@ -380,7 +380,7 @@ class ReflecBeatLimelight(BaseClient):
blog = Node.void("blog")
pdata.add_child(blog)
for (_, record) in sortedrecords.items():
for _, record in sortedrecords.items():
rec = Node.void("rec")
recordnode.add_child(rec)
rec.add_child(Node.u16("mid", record["id"]))

View File

@ -261,7 +261,7 @@ class ReflecBeat(BaseClient):
blog = Node.void("blog")
pdata.add_child(blog)
for (_, record) in sortedrecords.items():
for _, record in sortedrecords.items():
rec = Node.void("rec")
recordnode.add_child(rec)
rec.add_child(Node.u16("mid", record["id"]))

View File

@ -725,7 +725,7 @@ class GlobalMusicData(BaseGlobalData):
return allscores.get(userid, {}).get(songid, {}).get(songchart)
# First, seed with local scores
for (userid, score) in localscores:
for userid, score in localscores:
add_score(userid, score)
# Second, merge in remote scorse
@ -830,7 +830,7 @@ class GlobalMusicData(BaseGlobalData):
return allscores.get(songid, {}).get(songchart, (None, None))
# First, seed with local records
for (userid, score) in localscores:
for userid, score in localscores:
add_score(userid, score)
# Second, merge in remote records

View File

@ -19,7 +19,6 @@ class GlobalUserData(BaseGlobalData):
updates["area"] = area
def __format_iidx_profile(self, updates: Profile, profile: Profile) -> None:
area = profile.get_int("area", -1)
if area != -1:
updates["pid"] = area

View File

@ -38,7 +38,6 @@ class _BytesEncoder(json.JSONEncoder):
class BaseData:
SESSION_LENGTH: Final[int] = 32
def __init__(self, config: Config, conn: Connection) -> None:

View File

@ -83,7 +83,6 @@ class ArcadeCreationException(Exception):
class MachineData(BaseData):
# This relies on the fact that arcadeid in the arcade_settings table is auto-increment
# and thus will start at 1.
DEFAULT_SETTINGS_ARCADE: Final[ArcadeID] = ArcadeID(-1)

View File

@ -174,7 +174,6 @@ class AccountCreationException(Exception):
class UserData(BaseData):
REF_ID_LENGTH: Final[int] = 16
def from_cardid(self, cardid: str) -> Optional[UserID]:

View File

@ -21,7 +21,7 @@ def perspective_calculate(
uvz: Dict[Point, Point] = {}
minz: Optional[float] = None
maxz: Optional[float] = None
for (texx, texy) in [
for texx, texy in [
(0, 0),
(texwidth, 0),
(0, texheight),

View File

@ -1144,7 +1144,7 @@ class TXP2File(TrackedCoverage, VerboseOutput):
tuples: List[Tuple[str, int]] = [(name, strings[name]) for name in strings]
tuples = sorted(tuples, key=lambda tup: tup[1])
for (string, offset) in tuples:
for string, offset in tuples:
data = pad(data, offset)
data += scramble_text(string, self.text_obfuscated)

View File

@ -3302,7 +3302,6 @@ class SWF(VerboseOutput, TrackedCoverage):
# This appears to be bytecode to execute on a per-frame basis. We execute this every frame and
# only execute up to the point where we equal the current frame.
if imported_tag_initializers_offset is not None:
unk1, length = struct.unpack(
"<HH",
data[

View File

@ -78,7 +78,6 @@ class DXTBuffer:
file = io.BytesIO(filedata)
for row in range(self.block_county):
for col in range(self.block_countx):
# Color 1 color 2, color look up table
c0, c1, ctable = struct.unpack(
"<HHI", self.swapbytes(file.read(8), swap)

View File

@ -285,7 +285,7 @@ def viewarcades() -> Response:
@adminrequired
def viewmachines() -> Response:
games: Dict[str, Dict[int, str]] = {}
for (game, version, name) in Base.all_games():
for game, version, name in Base.all_games():
if game.value not in games:
games[game.value] = {}
games[game.value][version] = name

View File

@ -11,7 +11,6 @@ from bemani.frontend.base import FrontendBase
class BishiBashiFrontend(FrontendBase):
game: GameConstants = GameConstants.BISHI_BASHI
def __init__(self, data: Data, config: Config, cache: Cache) -> None:

View File

@ -9,7 +9,6 @@ from bemani.frontend.base import FrontendBase
class DDRFrontend(FrontendBase):
game: GameConstants = GameConstants.DDR
version: int = 0 # We use a virtual version for DDR to tie charts together

View File

@ -517,7 +517,7 @@ def searchrivals() -> Dict[str, Any]:
matches = set()
profiles = g.data.remote.user.get_all_profiles(GameConstants.DDR, version)
for (userid, profile) in profiles:
for userid, profile in profiles:
if profile.extid == extid or profile.get_str("name").lower() == name.lower():
matches.add(userid)

View File

@ -10,14 +10,14 @@ def get_game_settings(data: Data, arcadeid: ArcadeID) -> List[Dict[str, Any]]:
settings_lut: Dict[GameConstants, Dict[int, Dict[str, Any]]] = {}
all_settings = []
for (game, version, name) in Base.all_games():
for game, version, name in Base.all_games():
if game not in game_lut:
game_lut[game] = {}
settings_lut[game] = {}
game_lut[game][version] = name
settings_lut[game][version] = {}
for (game, version, settings) in Base.all_settings():
for game, version, settings in Base.all_settings():
if not settings:
continue

View File

@ -605,7 +605,7 @@ def searchrivals() -> Dict[str, Any]:
matches = set()
profiles = g.data.remote.user.get_all_profiles(GameConstants.IIDX, version)
for (userid, profile) in profiles:
for userid, profile in profiles:
if profile.extid == extid or profile.get_str("name").lower() == djname.lower():
matches.add(userid)

View File

@ -10,7 +10,6 @@ from bemani.frontend.base import FrontendBase
class IIDXFrontend(FrontendBase):
game: GameConstants = GameConstants.IIDX
valid_charts: List[int] = [

View File

@ -491,7 +491,7 @@ def searchrivals() -> Dict[str, Any]:
matches = set()
profiles = g.data.remote.user.get_all_profiles(GameConstants.JUBEAT, version)
for (userid, profile) in profiles:
for userid, profile in profiles:
if profile.extid == extid or profile.get_str("name").lower() == name.lower():
matches.add(userid)

View File

@ -8,7 +8,6 @@ from bemani.frontend.base import FrontendBase
class JubeatFrontend(FrontendBase):
game: GameConstants = GameConstants.JUBEAT
valid_charts: List[int] = [
@ -38,7 +37,7 @@ class JubeatFrontend(FrontendBase):
VersionConstants.JUBEAT_FESTO: 9,
}
for (game, version, name) in self.all_games():
for game, version, name in self.all_games():
if version in mapping:
yield (game, mapping[version], name)

View File

@ -11,7 +11,6 @@ from bemani.frontend.base import FrontendBase
class MetalGearArcadeFrontend(FrontendBase):
game: GameConstants = GameConstants.MGA
def __init__(self, data: Data, config: Config, cache: Cache) -> None:

View File

@ -16,7 +16,6 @@ from bemani.frontend.base import FrontendBase
class MusecaFrontend(FrontendBase):
game: GameConstants = GameConstants.MUSECA
valid_charts: List[int] = [

View File

@ -426,7 +426,7 @@ def searchrivals() -> Dict[str, Any]:
matches = set()
profiles = g.data.remote.user.get_all_profiles(GameConstants.POPN_MUSIC, version)
for (userid, profile) in profiles:
for userid, profile in profiles:
if profile.extid == extid or profile.get_str("name").lower() == name.lower():
matches.add(userid)

View File

@ -8,7 +8,6 @@ from bemani.frontend.base import FrontendBase
class PopnMusicFrontend(FrontendBase):
game: GameConstants = GameConstants.POPN_MUSIC
valid_charts: List[int] = [

View File

@ -452,7 +452,7 @@ def searchrivals() -> Dict[str, Any]:
matches = set()
profiles = g.data.remote.user.get_all_profiles(GameConstants.REFLEC_BEAT, version)
for (userid, profile) in profiles:
for userid, profile in profiles:
if profile.extid == extid or profile.get_str("name").lower() == name.lower():
matches.add(userid)

View File

@ -10,7 +10,6 @@ from bemani.frontend.base import FrontendBase
class ReflecBeatFrontend(FrontendBase):
game: GameConstants = GameConstants.REFLEC_BEAT
version: int = 0 # We use a virtual version for ReflecBeat to tie charts together

View File

@ -418,7 +418,7 @@ def searchrivals() -> Dict[str, Any]:
matches = set()
profiles = g.data.remote.user.get_all_profiles(GameConstants.SDVX, version)
for (userid, profile) in profiles:
for userid, profile in profiles:
if profile.extid == extid or profile.get_str("name").lower() == name.lower():
matches.add(userid)

Some files were not shown because too many files have changed in this diff Show More