From 200c8eb17e5cfef89c0faa73db60bc9ecd1867bb Mon Sep 17 00:00:00 2001 From: yoyosource Date: Fri, 1 Apr 2022 15:13:22 +0200 Subject: [PATCH] Update some stuff --- .../bungeecore/comms/handlers/FightEndsHandler.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/de/steamwar/bungeecore/comms/handlers/FightEndsHandler.java b/src/de/steamwar/bungeecore/comms/handlers/FightEndsHandler.java index 9b28bed..9e58dcc 100644 --- a/src/de/steamwar/bungeecore/comms/handlers/FightEndsHandler.java +++ b/src/de/steamwar/bungeecore/comms/handlers/FightEndsHandler.java @@ -28,13 +28,19 @@ import net.md_5.bungee.api.config.ServerInfo; import java.sql.Timestamp; import java.time.Instant; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; public class FightEndsHandler implements SpigotHandler { private int K = 20; - private long fightRange = 1000 /* Milliseconds */ * 60 /* Seconds */ * 15L /* Minutes */; + private long defaultFightRange = 1000 /* Milliseconds */ * 60 /* Seconds */ * 15L /* Minutes */; + private Map fightRanges = new HashMap<>(); + { + fightRanges.put("miniwargear", 1000 /* Milliseconds */ * 60 /* Seconds */ * 10L /* Minutes */); + } @Override public void handle(ByteArrayDataInput in, ServerInfo info) { @@ -103,7 +109,7 @@ public class FightEndsHandler implements SpigotHandler { } private boolean teamComboExistedAlready(List bluePlayers, List redPlayers, String gameMode) { - long time = Timestamp.from(Instant.now()).getTime() - fightRange; + long time = Timestamp.from(Instant.now()).getTime() - fightRanges.getOrDefault(gameMode, defaultFightRange); int page = 0; do { List fightsPage = Fight.getPage(page, 32);