Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-11-19 14:30:17 +01:00
Make a copy of the players list when disconnecting them all on shutdown (#928)
Dieser Commit ist enthalten in:
Ursprung
67c2b37337
Commit
225e2a9fb8
@ -61,6 +61,7 @@ import org.geysermc.connector.utils.LocaleUtils;
|
|||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
@ -189,7 +190,9 @@ public class GeyserConnector {
|
|||||||
if (players.size() >= 1) {
|
if (players.size() >= 1) {
|
||||||
bootstrap.getGeyserLogger().info(LanguageUtils.getLocaleStringLog("geyser.core.shutdown.kick.log", players.size()));
|
bootstrap.getGeyserLogger().info(LanguageUtils.getLocaleStringLog("geyser.core.shutdown.kick.log", players.size()));
|
||||||
|
|
||||||
for (GeyserSession playerSession : players) {
|
// Make a copy to prevent ConcurrentModificationException
|
||||||
|
final List<GeyserSession> tmpPlayers = new ArrayList<>(players);
|
||||||
|
for (GeyserSession playerSession : tmpPlayers) {
|
||||||
playerSession.disconnect(LanguageUtils.getPlayerLocaleString("geyser.core.shutdown.kick.message", playerSession.getClientData().getLanguageCode()));
|
playerSession.disconnect(LanguageUtils.getPlayerLocaleString("geyser.core.shutdown.kick.message", playerSession.getClientData().getLanguageCode()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren