From ed43e9d3e69f9174da5615834179910c2a4d5ac8 Mon Sep 17 00:00:00 2001 From: Jennifer Taylor Date: Sat, 13 Aug 2022 21:04:43 +0000 Subject: [PATCH] Fix crash on starting game, deduplicate already-written functionality. --- bemani/backend/jubeat/festo.py | 56 +++++++++++++++++----------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/bemani/backend/jubeat/festo.py b/bemani/backend/jubeat/festo.py index 2851ad4..3d4b9a4 100644 --- a/bemani/backend/jubeat/festo.py +++ b/bemani/backend/jubeat/festo.py @@ -2,13 +2,21 @@ from typing import Dict, List, Optional from bemani.backend.jubeat.base import JubeatBase +from bemani.backend.jubeat.common import ( + JubeatDemodataGetNewsHandler, + JubeatLoggerReportHandler, +) from bemani.backend.jubeat.clan import JubeatClan from bemani.common import VersionConstants from bemani.protocol import Node -class JubeatFesto(JubeatBase): +class JubeatFesto( + JubeatDemodataGetNewsHandler, + JubeatLoggerReportHandler, + JubeatBase +): name: str = 'Jubeat Festo' version: int = VersionConstants.JUBEAT_FESTO @@ -128,25 +136,28 @@ class JubeatFesto(JubeatBase): ], )) + # Mapping of what music is allowed by default, if this is set to all 0's + # then the game will crash because it can't figure out what default song + # to choose for new player sort. info.add_child(Node.s32_array( 'white_music_list', [ - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0, + -1, -1, -1, -1, + -1, -1, -1, -1, + -1, -1, -1, -1, + -1, -1, -1, -1, + -1, -1, -1, -1, + -1, -1, -1, -1, + -1, -1, -1, -1, + -1, -1, -1, -1, + -1, -1, -1, -1, + -1, -1, -1, -1, + -1, -1, -1, -1, + -1, -1, -1, -1, + -1, -1, -1, -1, + -1, -1, -1, -1, + -1, -1, -1, -1, + -1, -1, -1, -1, ], )) @@ -350,17 +361,6 @@ class JubeatFesto(JubeatBase): return root - def handle_demodata_get_news_request(self, request: Node) -> Node: - root = Node.void('demodata') - data = Node.void('data') - root.add_child(data) - - officialnews = Node.void('officialnews') - data.add_child(officialnews) - officialnews.set_attribute('count', '0') - - return root - def handle_demodata_get_jbox_list_request(self, request: Node) -> Node: root = Node.void('demodata') return root