Add togglable password authentication option

This commit is contained in:
Camotoy 2021-01-11 11:09:12 -05:00
parent c40f9764ec
commit 9eba5525f4
No known key found for this signature in database
GPG key ID: 7EEFB66FE798081F
4 changed files with 8 additions and 1 deletions

View file

@ -74,6 +74,9 @@ public class GeyserConnectConfig {
private int port; private int port;
@JsonProperty("allow-password-authentication")
private boolean allowPasswordAuthentication = true;
@JsonProperty("debug-mode") @JsonProperty("debug-mode")
private boolean debugMode; private boolean debugMode;

View file

@ -71,6 +71,7 @@ public class GeyserProxyBootstrap implements GeyserBootstrap {
text = text.replace("PORT", String.valueOf(multiConfig.getGeyser().getPort())); text = text.replace("PORT", String.valueOf(multiConfig.getGeyser().getPort()));
text = text.replaceAll("MOTD", multiConfig.getMotd()); text = text.replaceAll("MOTD", multiConfig.getMotd());
text = text.replace("PLAYERS", String.valueOf(multiConfig.getMaxPlayers())); text = text.replace("PLAYERS", String.valueOf(multiConfig.getMaxPlayers()));
text = text.replace("ALLOWPASSWORDAUTHENTICATION", String.valueOf(multiConfig.getGeyser().isAllowPasswordAuthentication()));
ObjectMapper objectMapper = new ObjectMapper(new YAMLFactory()); ObjectMapper objectMapper = new ObjectMapper(new YAMLFactory());
geyserConfig = objectMapper.readValue(text, GeyserProxyConfiguration.class); geyserConfig = objectMapper.readValue(text, GeyserProxyConfiguration.class);

View file

@ -25,6 +25,9 @@ geyser:
# The port that will listen for connections # The port that will listen for connections
port: 19133 port: 19133
# If password authentication should be allowed in online mode.
allow-password-authentication: true
# If debug messages should be sent through console, has to be enabled in both places to work # If debug messages should be sent through console, has to be enabled in both places to work
debug-mode: false debug-mode: false

View file

@ -32,7 +32,7 @@ remote:
port: 25565 port: 25565
# Authentication type. Can be offline, online, or floodgate (see https://github.com/GeyserMC/Geyser/wiki/Floodgate). # Authentication type. Can be offline, online, or floodgate (see https://github.com/GeyserMC/Geyser/wiki/Floodgate).
auth-type: online auth-type: online
allow-password-authentication: false allow-password-authentication: ALLOWPASSWORDAUTHENTICATION
# Floodgate uses encryption to ensure use from authorised sources. # Floodgate uses encryption to ensure use from authorised sources.
# This should point to the public key generated by Floodgate (Bungee or CraftBukkit) # This should point to the public key generated by Floodgate (Bungee or CraftBukkit)