mirror of
https://github.com/GeyserMC/Geyser.git
synced 2026-01-04 15:31:36 +00:00
Fix Floodgate autodetection
This commit is contained in:
@@ -25,7 +25,6 @@
|
||||
|
||||
package org.geysermc.geyser;
|
||||
|
||||
import org.geysermc.geyser.api.network.AuthType;
|
||||
import org.geysermc.geyser.configuration.GeyserJacksonConfiguration;
|
||||
import org.geysermc.geyser.text.GeyserLocale;
|
||||
|
||||
@@ -34,10 +33,6 @@ import java.nio.file.Path;
|
||||
|
||||
public class FloodgateKeyLoader {
|
||||
public static Path getKeyPath(GeyserJacksonConfiguration config, Path floodgateDataFolder, Path geyserDataFolder, GeyserLogger logger) {
|
||||
if (config.getRemote().authType() != AuthType.FLOODGATE) {
|
||||
return geyserDataFolder.resolve(config.getFloodgateKeyFile());
|
||||
}
|
||||
|
||||
// Always prioritize Floodgate's key, if it is installed.
|
||||
// This mostly prevents people from trying to copy the key and corrupting it in the process
|
||||
if (floodgateDataFolder != null) {
|
||||
|
||||
@@ -170,5 +170,8 @@ public interface GeyserBootstrap {
|
||||
*/
|
||||
int getServerPort();
|
||||
|
||||
boolean isFloodgatePluginPresent();
|
||||
/**
|
||||
* Tests if Floodgate is installed, loads the Floodgate key if so, and returns the result of Floodgate installed.
|
||||
*/
|
||||
boolean testFloodgatePluginPresent();
|
||||
}
|
||||
|
||||
@@ -324,11 +324,12 @@ public class GeyserImpl implements GeyserApi {
|
||||
}
|
||||
}
|
||||
|
||||
if (config.getRemote().authType() == AuthType.FLOODGATE && !bootstrap.isFloodgatePluginPresent()) {
|
||||
boolean floodgatePresent = bootstrap.testFloodgatePluginPresent();
|
||||
if (config.getRemote().authType() == AuthType.FLOODGATE && !floodgatePresent) {
|
||||
logger.severe(GeyserLocale.getLocaleStringLog("geyser.bootstrap.floodgate.not_installed") + " "
|
||||
+ GeyserLocale.getLocaleStringLog("geyser.bootstrap.floodgate.disabling"));
|
||||
return;
|
||||
} else if (config.isAutoconfiguredRemote() && bootstrap.isFloodgatePluginPresent()) {
|
||||
} else if (config.isAutoconfiguredRemote() && floodgatePresent) {
|
||||
// Floodgate installed means that the user wants Floodgate authentication
|
||||
logger.debug("Auto-setting to Floodgate authentication.");
|
||||
config.getRemote().setAuthType(AuthType.FLOODGATE);
|
||||
|
||||
@@ -148,8 +148,6 @@ public final class GeyserServer {
|
||||
}
|
||||
|
||||
private ServerBootstrap createBootstrap(EventLoopGroup group) {
|
||||
// TODO
|
||||
boolean enableProxyProtocol = this.geyser.getConfig().getBedrock().isEnableProxyProtocol();
|
||||
if (this.geyser.getConfig().isDebugMode()) {
|
||||
this.geyser.getLogger().debug("EventLoop type: " + TRANSPORT.datagramChannel());
|
||||
if (TRANSPORT.datagramChannel() == NioDatagramChannel.class) {
|
||||
|
||||
Reference in New Issue
Block a user