3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-11-16 21:10:30 +01:00

Merge pull request #341 from alexstaeding/feature/shutdown-api

Add shutdown methods to ProxyServer
Dieser Commit ist enthalten in:
Andrew Steinborn 2020-08-05 11:35:38 -04:00 committet von GitHub
Commit 3beaeb2df7
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
2 geänderte Dateien mit 23 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -19,6 +19,7 @@ import java.util.Optional;
import java.util.UUID;
import net.kyori.adventure.audience.Audience;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.TextComponent;
import org.checkerframework.checker.nullness.qual.NonNull;
/**
@ -26,6 +27,18 @@ import org.checkerframework.checker.nullness.qual.NonNull;
*/
public interface ProxyServer extends Audience {
/**
* Shuts down the proxy, kicking players with the specified {@param reason}.
*
* @param reason message to kick online players with
*/
void shutdown(TextComponent reason);
/**
* Shuts down the proxy, kicking players with the default reason.
*/
void shutdown();
/**
* Retrieves the player currently connected to this proxy by their Minecraft username. The search
* is case-insensitive.

Datei anzeigen

@ -453,6 +453,16 @@ public class VelocityServer implements ProxyServer, ForwardingAudience {
shutdown(explicitExit, TextComponent.of("Proxy shutting down."));
}
@Override
public void shutdown(TextComponent reason) {
shutdown(true, reason);
}
@Override
public void shutdown() {
shutdown(true);
}
public AsyncHttpClient getAsyncHttpClient() {
return cm.getHttpClient();
}