Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-16 21:10:30 +01:00
Add shutdown flag.
Dieser Commit ist enthalten in:
Ursprung
05693425bf
Commit
a7a227ed05
@ -49,6 +49,7 @@ public class VelocityServer implements ProxyServer {
|
||||
private KeyPair serverKeyPair;
|
||||
private final ServerMap servers = new ServerMap();
|
||||
private final CommandManager commandManager = new CommandManager();
|
||||
private boolean shutdown = false;
|
||||
|
||||
private final Map<UUID, ConnectedPlayer> connectionsByUuid = new ConcurrentHashMap<>();
|
||||
private final Map<String, ConnectedPlayer> connectionsByName = new ConcurrentHashMap<>();
|
||||
@ -134,7 +135,16 @@ public class VelocityServer implements ProxyServer {
|
||||
return this.cm.createWorker();
|
||||
}
|
||||
|
||||
public boolean isShutdown() {
|
||||
return shutdown;
|
||||
}
|
||||
|
||||
public void shutdown() {
|
||||
Preconditions.checkState(!shutdown, "Server already shut down");
|
||||
shutdown = true;
|
||||
|
||||
logger.info("Shutting down the proxy...");
|
||||
|
||||
this.cm.shutdown();
|
||||
}
|
||||
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren