diff --git a/pom.xml b/pom.xml index d9e2a9b..3207155 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ icu.samnya aqua - 0.0.13-RELEASE + 0.0.14-RELEASE Aqua Server A multipurpose game server diff --git a/src/main/java/icu/samnyan/aqua/sega/chunithm/handler/impl/GetGameSettingHandler.java b/src/main/java/icu/samnyan/aqua/sega/chunithm/handler/impl/GetGameSettingHandler.java index ab0f06e..0f59ee2 100644 --- a/src/main/java/icu/samnyan/aqua/sega/chunithm/handler/impl/GetGameSettingHandler.java +++ b/src/main/java/icu/samnyan/aqua/sega/chunithm/handler/impl/GetGameSettingHandler.java @@ -4,6 +4,8 @@ import com.fasterxml.jackson.core.JsonProcessingException; import icu.samnyan.aqua.sega.chunithm.handler.BaseHandler; import icu.samnyan.aqua.sega.chunithm.model.response.GetGameSettingResp; import icu.samnyan.aqua.sega.chunithm.model.response.data.GameSetting; +import icu.samnyan.aqua.sega.general.dao.PropertyEntryRepository; +import icu.samnyan.aqua.sega.general.model.PropertyEntry; import icu.samnyan.aqua.sega.util.jackson.StringMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -22,21 +24,29 @@ public class GetGameSettingHandler implements BaseHandler { private final StringMapper mapper; + private final PropertyEntryRepository propertyEntryRepository; + @Autowired - public GetGameSettingHandler(StringMapper mapper) { + public GetGameSettingHandler(StringMapper mapper, PropertyEntryRepository propertyEntryRepository) { this.mapper = mapper; + this.propertyEntryRepository = propertyEntryRepository; } @Override public String handle(Map request) throws JsonProcessingException { + PropertyEntry start = propertyEntryRepository.findByPropertyKey("reboot_start_time") + .orElseGet(() -> new PropertyEntry("reboot_start_time", "2020-01-01 23:59:00.0")); + PropertyEntry end = propertyEntryRepository.findByPropertyKey("reboot_end_time") + .orElseGet(() -> new PropertyEntry("reboot_end_time", "2020-01-01 23:59:00.0")); + GameSetting gameSetting = new GameSetting( 1, false, 10, - 0, - 0, + start.getPropertyValue(), + end.getPropertyValue(), false, 300, 300, diff --git a/src/main/java/icu/samnyan/aqua/sega/chunithm/model/response/data/GameSetting.java b/src/main/java/icu/samnyan/aqua/sega/chunithm/model/response/data/GameSetting.java index ee9a515..14a48ca 100644 --- a/src/main/java/icu/samnyan/aqua/sega/chunithm/model/response/data/GameSetting.java +++ b/src/main/java/icu/samnyan/aqua/sega/chunithm/model/response/data/GameSetting.java @@ -16,8 +16,8 @@ public class GameSetting { @JsonProperty("isMaintenance") private boolean isMaintenance; private int requestInterval; - private int rebootStartTime; - private int rebootEndTime; + private String rebootStartTime; + private String rebootEndTime; @JsonProperty("isBackgroundDistribute") private boolean isBackgroundDistribute; private int maxCountCharacter;