Implemented floodgate support for ViaProxy

This commit is contained in:
RaphiMC 2023-11-04 17:07:35 +01:00
parent cbb84d91bc
commit 4e490634a3
No known key found for this signature in database
GPG key ID: 0F6BB0657A03AC94
2 changed files with 13 additions and 10 deletions

View file

@ -43,6 +43,7 @@ import org.jetbrains.annotations.NotNull;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.UUID;
@ -73,7 +74,7 @@ public class GeyserViaProxyBootstrap implements GeyserBootstrap {
return;
}
config.getRemote().setAuthType(AuthType.OFFLINE);
config.getRemote().setAuthType(Files.isRegularFile(this.config.getFloodgateKeyPath()) ? AuthType.FLOODGATE : AuthType.OFFLINE);
GeyserConfiguration.checkGeyserConfiguration(this.config, this.logger);
this.geyser = GeyserImpl.load(PlatformType.VIAPROXY, this);

View file

@ -308,6 +308,7 @@ public class GeyserImpl implements GeyserApi {
}
}
if (platformType != PlatformType.VIAPROXY) {
boolean floodgatePresent = bootstrap.testFloodgatePluginPresent();
if (config.getRemote().authType() == AuthType.FLOODGATE && !floodgatePresent) {
logger.severe(GeyserLocale.getLocaleStringLog("geyser.bootstrap.floodgate.not_installed") + " "
@ -319,6 +320,7 @@ public class GeyserImpl implements GeyserApi {
config.getRemote().setAuthType(AuthType.FLOODGATE);
}
}
}
String remoteAddress = config.getRemote().address();
// Filters whether it is not an IP address or localhost, because otherwise it is not possible to find out an SRV entry.