geforkt von SteamWar/BungeeCore
Update some stuff
Dieser Commit ist enthalten in:
Ursprung
b5528a6c60
Commit
200c8eb17e
@ -28,13 +28,19 @@ import net.md_5.bungee.api.config.ServerInfo;
|
|||||||
|
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
public class FightEndsHandler implements SpigotHandler {
|
public class FightEndsHandler implements SpigotHandler {
|
||||||
|
|
||||||
private int K = 20;
|
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
|
@Override
|
||||||
public void handle(ByteArrayDataInput in, ServerInfo info) {
|
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) {
|
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;
|
int page = 0;
|
||||||
do {
|
do {
|
||||||
List<Fight> fightsPage = Fight.getPage(page, 32);
|
List<Fight> fightsPage = Fight.getPage(page, 32);
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren