mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Fix Floodgate autodetection
This commit is contained in:
parent
8a257181b9
commit
c8afd3436d
10 changed files with 39 additions and 31 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue