From 4e422ed0c3663440fd47d8499b60586a478a0261 Mon Sep 17 00:00:00 2001 From: Dom Eori <4j6dq2zi8@relay.firefox.com> Date: Sun, 13 Mar 2022 03:10:24 +0900 Subject: [PATCH] [chusan] Add override config for rom version --- docs/application.properties | 5 ++++- docs/game_specific_notes.md | 2 +- .../sega/chusan/handler/impl/GetGameSettingHandler.java | 8 +++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/application.properties b/docs/application.properties index 1c45c137..f422bdcd 100644 --- a/docs/application.properties +++ b/docs/application.properties @@ -24,10 +24,13 @@ server.port=80 game.chunithm.team-name= ## Chusan -## The version of your client. If this doesn't match with your game, you will not be able to play some game modes. +## The version of your client data. If this doesn't match with your game, you will not be able to play some game modes. ## Match this with data.conf file in latest option. ## For example, if data.conf says "VerMajor = 2, VerMinor = 5, VerRelease = 4" then this need to be 2.05.04 game.chusan.version=2.00.00 +## The version of your client rom. Same applies as above. +## Match this with version in "Game system information" of test menu. +game.chusan.rom-version=2.00.01 ## This enables team function if you set team name here. Leave this blank to disable it. game.chusan.team-name= diff --git a/docs/game_specific_notes.md b/docs/game_specific_notes.md index 7f0d7d06..b1571529 100644 --- a/docs/game_specific_notes.md +++ b/docs/game_specific_notes.md @@ -30,7 +30,7 @@ Only JP variant is supported. * Profile migration from Chunithm ### Additional notes -* Match `game.chusan.version` key in `application.properties` same as your client version. If not, class mode is disabled due to version mismatch. +* Match `game.chusan.version` and `game.chusan.rom-version` key in `application.properties` same as your client. If not, class mode is disabled due to version mismatch. * Team function can be enabled by changing `game.chusan.team-name` value. Leave this blank to disable team function. * Chusan and Chunithm uses different endpoints and tables. Your progress from Chunithm won't carry over to Chusan. * User box customization requires Web UI, which is not added yet. The only option to do now is editing database. diff --git a/src/main/java/icu/samnyan/aqua/sega/chusan/handler/impl/GetGameSettingHandler.java b/src/main/java/icu/samnyan/aqua/sega/chusan/handler/impl/GetGameSettingHandler.java index 1c86547a..2e4c674e 100644 --- a/src/main/java/icu/samnyan/aqua/sega/chusan/handler/impl/GetGameSettingHandler.java +++ b/src/main/java/icu/samnyan/aqua/sega/chusan/handler/impl/GetGameSettingHandler.java @@ -30,15 +30,17 @@ public class GetGameSettingHandler implements BaseHandler { private final String ALLNET_HOST; private final String ALLNET_PORT; private final String SERVER_PORT; + private final String ROM_VERSION; private final String GAME_VERSION; @Autowired - public GetGameSettingHandler(StringMapper mapper, @Value("${allnet.server.host:}") String ALLNET_HOST, @Value("${allnet.server.port:}") String ALLNET_PORT, @Value("${server.port:}") String SERVER_PORT, @Value("${game.chusan.version:2.00.00}") String GAME_VERSION) { + public GetGameSettingHandler(StringMapper mapper, @Value("${allnet.server.host:}") String ALLNET_HOST, @Value("${allnet.server.port:}") String ALLNET_PORT, @Value("${server.port:}") String SERVER_PORT, @Value("${game.chusan.version:2.00.00}") String GAME_VERSION, @Value("${game.chusan.rom-version:2.00.01}") String ROM_VERSION) { this.mapper = mapper; this.ALLNET_HOST = ALLNET_HOST; this.ALLNET_PORT = ALLNET_PORT; this.SERVER_PORT = SERVER_PORT; this.GAME_VERSION = GAME_VERSION; + this.ROM_VERSION = ROM_VERSION; } @@ -66,8 +68,8 @@ public class GetGameSettingHandler implements BaseHandler { String port = ALLNET_PORT.equals("") ? SERVER_PORT : ALLNET_PORT; GameSetting gameSetting = new GameSetting( - GAME_VERSION, - GAME_VERSION, // Chusan checks server version and disables some game modes if it not same + ROM_VERSION, // Chusan checks these two versions to determine if it can enable game modes + GAME_VERSION, false, 0, rebootStartTime.format(formatter),