[chusan, ongeki] Improve game version override

pull/1/head
Dom Eori 2022-03-11 20:41:22 +09:00
parent 2822ee3dd0
commit 50a177a2d1
2 changed files with 8 additions and 4 deletions

View File

@ -66,7 +66,7 @@ public class GetGameSettingHandler implements BaseHandler {
String port = ALLNET_PORT.equals("") ? SERVER_PORT : ALLNET_PORT;
GameSetting gameSetting = new GameSetting(
"2.00.01",
GAME_VERSION,
GAME_VERSION, // Chusan checks server version and disables some game modes if it not same
false,
0,

View File

@ -10,6 +10,7 @@ import icu.samnyan.aqua.sega.util.jackson.BasicMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.util.Map;
@ -26,10 +27,13 @@ public class GetGameSettingHandler implements BaseHandler {
private final PropertyEntryRepository propertyEntryRepository;
private final String GAME_VERSION;
@Autowired
public GetGameSettingHandler(BasicMapper mapper, PropertyEntryRepository propertyEntryRepository) {
public GetGameSettingHandler(BasicMapper mapper, PropertyEntryRepository propertyEntryRepository, @Value("${game.ongeki.version:1.05.00}") String GAME_VERSION) {
this.mapper = mapper;
this.propertyEntryRepository = propertyEntryRepository;
this.GAME_VERSION = GAME_VERSION;
}
@ -42,8 +46,8 @@ public class GetGameSettingHandler implements BaseHandler {
.orElseGet(() -> new PropertyEntry("reboot_end_time", "2020-01-01 23:59:00.0"));
GameSetting gameSetting = new GameSetting(
"1.05.00",
"", //TODO dynamic
GAME_VERSION,
GAME_VERSION,
false,
10,
start.getPropertyValue(),