geforkt von SteamWar/BungeeCore
Update some stuff
Dieser Commit ist enthalten in:
Ursprung
200c8eb17e
Commit
738189593d
@ -31,6 +31,7 @@ import java.time.Instant;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
public class FightEndsHandler implements SpigotHandler {
|
public class FightEndsHandler implements SpigotHandler {
|
||||||
@ -38,6 +39,7 @@ public class FightEndsHandler implements SpigotHandler {
|
|||||||
private int K = 20;
|
private int K = 20;
|
||||||
private long defaultFightRange = 1000 /* Milliseconds */ * 60 /* Seconds */ * 15L /* Minutes */;
|
private long defaultFightRange = 1000 /* Milliseconds */ * 60 /* Seconds */ * 15L /* Minutes */;
|
||||||
private Map<String, Long> fightRanges = new HashMap<>();
|
private Map<String, Long> fightRanges = new HashMap<>();
|
||||||
|
|
||||||
{
|
{
|
||||||
fightRanges.put("miniwargear", 1000 /* Milliseconds */ * 60 /* Seconds */ * 10L /* Minutes */);
|
fightRanges.put("miniwargear", 1000 /* Milliseconds */ * 60 /* Seconds */ * 10L /* Minutes */);
|
||||||
}
|
}
|
||||||
@ -73,6 +75,13 @@ public class FightEndsHandler implements SpigotHandler {
|
|||||||
blueResult = 0;
|
blueResult = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Set<Integer> teamsIds = fightEndsPacket.getBluePlayers().stream().map(SteamwarUser::get).map(SteamwarUser::getTeam).collect(Collectors.toSet());
|
||||||
|
for (int redPlayer : fightEndsPacket.getRedPlayers()) {
|
||||||
|
if (teamsIds.contains(SteamwarUser.get(redPlayer).getTeam())) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (teamComboExistedAlready(fightEndsPacket.getBluePlayers(), fightEndsPacket.getRedPlayers(), fightEndsPacket.getGameMode())) {
|
if (teamComboExistedAlready(fightEndsPacket.getBluePlayers(), fightEndsPacket.getRedPlayers(), fightEndsPacket.getGameMode())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren