Skip to content

Commit

Permalink
Add start countdown as config option
Browse files Browse the repository at this point in the history
  • Loading branch information
Pugzy authored Feb 28, 2021
1 parent 843f9af commit 21d2a16
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/main/java/rip/bolt/ingame/config/AppData.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package rip.bolt.ingame.config;

import static tc.oc.pgm.util.text.TextParser.parseDuration;

import java.time.Duration;
import rip.bolt.ingame.Ingame;

public class AppData {
Expand Down Expand Up @@ -30,4 +33,8 @@ public static boolean fullTeamsRequired() {
public static boolean allowRequeue() {
return Ingame.get().getConfig().getBoolean("allow-requeue", true);
}

public static Duration matchStartDuration() {
return parseDuration(Ingame.get().getConfig().getString("match-start-duration", "300s"));
}
}
2 changes: 1 addition & 1 deletion src/main/java/rip/bolt/ingame/ranked/RankedManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void setupMatch(BoltMatch match) {
new SingleRound(
format,
new SingleRoundOptions(
"ranked", cycleTime, Duration.ofSeconds(300), match.getMap(), 1, true, true));
"ranked", cycleTime, AppData.matchStartDuration(), match.getMap(), 1, true, true));
cycleTime = Duration.ofSeconds(5);
format.addRound(ranked);

Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ full-teams-required: true
# enable the requeue command and prompt
allow-requeue: true

# duration to countdown before starting match
match-start-duration: "300s"

api:
url: https://localhost:3000/v1/
key: authorisation-key
Expand Down

0 comments on commit 21d2a16

Please sign in to comment.