ständig wiederholende songs verhindern
parent
063e85bf58
commit
2d473ebdd9
|
|
@ -152,8 +152,19 @@ private void broadcastRoundResult(String gameId) {
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
// nächste Runde starten
|
// nächste Runde starten
|
||||||
|
// ...
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
try { Thread.sleep(4000); } catch (InterruptedException ignored) {}
|
try { Thread.sleep(4000); } catch (InterruptedException ignored) {}
|
||||||
|
// Songs erneut sammeln
|
||||||
|
var currentGame = service.getOrCreateGame(gameId);
|
||||||
|
List<String> allTracks = new ArrayList<>();
|
||||||
|
for (String player : currentGame.players()) {
|
||||||
|
allTracks.addAll(authService.getRecentTracks(player));
|
||||||
|
}
|
||||||
|
if (!allTracks.isEmpty()) {
|
||||||
|
// Neue Runde starten
|
||||||
|
service.startRound(gameId, allTracks);
|
||||||
|
}
|
||||||
broadcastRoundStart(gameId);
|
broadcastRoundStart(gameId);
|
||||||
}).start();
|
}).start();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue