Skip to content

Commit

Permalink
Add an additional key searching fallback for Floodgate 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim203 committed Mar 24, 2021
1 parent 2caf811 commit 677a8d6
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,18 @@

public class FloodgateKeyLoader {
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());

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) {
Path autoKey = floodgateDataFolder.resolve("key.pem");
if (Files.exists(autoKey)) {
Expand Down

0 comments on commit 677a8d6

Please sign in to comment.