Merge branch 'master' into feature/sounds

This commit is contained in:
RednedEpic 2020-05-04 00:51:22 -05:00
commit 7d67b65777
8 changed files with 98 additions and 9 deletions

View file

@ -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.connector.FloodgateKeyLoader;
import org.geysermc.connector.GeyserConfiguration;
import java.io.File;
@ -46,6 +47,8 @@ public class GeyserBungeeConfiguration implements GeyserConfiguration {
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 GeyserConfiguration {
}
}
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 GeyserConfiguration {
@Override
public Path getFloodgateKeyFile() {
return Paths.get(dataFolder.toString(), config.getString("floodgate-key-file", "public-key.pem"));
return floodgateKey;
}
@Override

View file

@ -116,6 +116,9 @@ public class GeyserBungeePlugin extends Plugin implements GeyserBootstrap {
}
this.geyserLogger = new GeyserBungeeLogger(getLogger(), geyserConfig.isDebugMode());
geyserConfig.loadFloodgate(this);
this.connector = GeyserConnector.start(PlatformType.BUNGEECORD, this);
this.geyserCommandManager = new GeyserBungeeCommandManager(connector);