[ongeki] Fix play reception time lockout

pull/1/head
Dom Eori 2021-10-07 01:41:01 +09:00
parent 01e1ef17ba
commit 535af15e6a
1 changed files with 16 additions and 2 deletions

View File

@ -12,6 +12,8 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Map;
/**
@ -36,17 +38,29 @@ public class GetGameSettingHandler implements BaseHandler {
@Override
public String handle(Map<String, Object> 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"));
*/
/*
Ongeki is picky about reboot time value, and fixed one doesn't work very well.
So let's not use fixed value. Instead, give a dynamically adjusted time.
*/
LocalDateTime rebootTime = LocalDateTime.now().minusHours(2); // taken from some fork of minime.
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("uuuu-MM-dd HH:mm:ss");
String strRebootTime = rebootTime.format(formatter);
GameSetting gameSetting = new GameSetting(
"1.05.00",
false,
10,
start.getPropertyValue(),
end.getPropertyValue(),
strRebootTime,
strRebootTime,
false,
300,
300,