SteamWar/BungeeCore
Archiviert
13
2

Ranked #333

Zusammengeführt
Lixfel hat 18 Commits von Ranked nach master 2022-04-11 08:23:14 +02:00 zusammengeführt
Nur Änderungen aus Commit 200c8eb17e werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -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<String, Long> 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<Integer> bluePlayers, List<Integer> 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<Fight> fightsPage = Fight.getPage(page, 32);