mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Add an additional key searching fallback for Floodgate 2.0
This commit is contained in:
parent
2caf811750
commit
677a8d68f6
1 changed files with 10 additions and 1 deletions
|
@ -33,9 +33,18 @@ import java.nio.file.Path;
|
||||||
|
|
||||||
public class FloodgateKeyLoader {
|
public class FloodgateKeyLoader {
|
||||||
public static Path getKeyPath(GeyserJacksonConfiguration config, Object floodgate, Path floodgateDataFolder, Path geyserDataFolder, GeyserLogger logger) {
|
public static Path getKeyPath(GeyserJacksonConfiguration config, Object floodgate, Path floodgateDataFolder, Path geyserDataFolder, GeyserLogger logger) {
|
||||||
|
if (!config.getRemote().getAuthType().equals("floodgate")) {
|
||||||
|
return geyserDataFolder.resolve(config.getFloodgateKeyFile());
|
||||||
|
}
|
||||||
|
|
||||||
Path floodgateKey = geyserDataFolder.resolve(config.getFloodgateKeyFile());
|
Path floodgateKey = geyserDataFolder.resolve(config.getFloodgateKeyFile());
|
||||||
|
|
||||||
if (!Files.exists(floodgateKey) && config.getRemote().getAuthType().equals("floodgate")) {
|
if (config.getFloodgateKeyFile().equals("public-key.pem")) {
|
||||||
|
logger.info("Floodgate 2.0 doesn't use a public/private key system anymore. We'll search for key.pem instead");
|
||||||
|
floodgateKey = geyserDataFolder.resolve("key.pem");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Files.exists(floodgateKey)) {
|
||||||
if (floodgate != null) {
|
if (floodgate != null) {
|
||||||
Path autoKey = floodgateDataFolder.resolve("key.pem");
|
Path autoKey = floodgateDataFolder.resolve("key.pem");
|
||||||
if (Files.exists(autoKey)) {
|
if (Files.exists(autoKey)) {
|
||||||
|
|
Loading…
Reference in a new issue