forked from GeyserMC/Geyser
Auto load floodgate key if floodgate installed and set authtype (#454)
* Added floodgate key auto loading for Bukkit * Added floodgate key auto loading for Bungee * Added floodgate key auto loading for Velocity and fixed key location * Moved key loading to common
This commit is contained in:
parent
692e46146c
commit
9c6ac1b41c
7 changed files with 99 additions and 7 deletions
|
@ -25,8 +25,9 @@
|
|||
|
||||
package org.geysermc.platform.bungeecord;
|
||||
|
||||
import net.md_5.bungee.api.plugin.Plugin;
|
||||
import net.md_5.bungee.config.Configuration;
|
||||
|
||||
import org.geysermc.common.FloodgateKeyLoader;
|
||||
import org.geysermc.common.IGeyserConfiguration;
|
||||
|
||||
import java.io.File;
|
||||
|
@ -46,6 +47,8 @@ public class GeyserBungeeConfiguration implements IGeyserConfiguration {
|
|||
|
||||
private Map<String, BungeeUserAuthenticationInfo> userAuthInfo = new HashMap<>();
|
||||
|
||||
private Path floodgateKey;
|
||||
|
||||
public GeyserBungeeConfiguration(File dataFolder, Configuration config) {
|
||||
this.dataFolder = dataFolder;
|
||||
this.config = config;
|
||||
|
@ -62,6 +65,11 @@ public class GeyserBungeeConfiguration implements IGeyserConfiguration {
|
|||
}
|
||||
}
|
||||
|
||||
public void loadFloodgate(GeyserBungeePlugin plugin) {
|
||||
Plugin floodgate = plugin.getProxy().getPluginManager().getPlugin("floodgate-bungee");
|
||||
floodgateKey = FloodgateKeyLoader.getKey(plugin.getGeyserLogger(), this, Paths.get(dataFolder.toString(), config.getString("floodgate-key-file", "public-key.pem")), floodgate, floodgate != null ? floodgate.getDataFolder().toPath() : null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BungeeBedrockConfiguration getBedrock() {
|
||||
return bedrockConfig;
|
||||
|
@ -109,7 +117,7 @@ public class GeyserBungeeConfiguration implements IGeyserConfiguration {
|
|||
|
||||
@Override
|
||||
public Path getFloodgateKeyFile() {
|
||||
return Paths.get(dataFolder.toString(), config.getString("floodgate-key-file", "public-key.pem"));
|
||||
return floodgateKey;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -116,6 +116,9 @@ public class GeyserBungeePlugin extends Plugin implements IGeyserBootstrap {
|
|||
}
|
||||
|
||||
this.geyserLogger = new GeyserBungeeLogger(getLogger(), geyserConfig.isDebugMode());
|
||||
|
||||
geyserConfig.loadFloodgate(this);
|
||||
|
||||
this.connector = GeyserConnector.start(PlatformType.BUNGEECORD, this);
|
||||
|
||||
this.geyserCommandManager = new GeyserBungeeCommandManager(connector);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue