Made floodgatePrefixWorkaround configurable

This commit is contained in:
Smart123s
2021-06-29 15:30:11 +02:00
parent 8859ebb454
commit b92911bf26
2 changed files with 25 additions and 12 deletions

View File

@ -117,8 +117,21 @@ public class FastLoginBukkit extends JavaPlugin implements PlatformPlugin<Comman
pluginManager.registerEvents(new ProtocolSupportListener(this, core.getRateLimiter()), this);
} else if (pluginManager.isPluginEnabled("ProtocolLib")) {
ProtocolLibListener.register(this, core.getRateLimiter());
//TODO: make configurable & check if it's needed
ProtocolLibrary.getProtocolManager().addPacketListener(new ManualNameChange(this));
if (isPluginInstalled("floodgate")) {
if (getConfig().getBoolean("floodgatePrefixWorkaround")){
ProtocolLibrary.getProtocolManager().addPacketListener(new ManualNameChange(this));
logger.info("Floodgate prefix injection workaround has been enabled.");
logger.info("If you have problems joining the server, try disabling it in the configuration.");
} else {
logger.warn("We have detected that you are runnging FastLogin alongside Floodgate and ProtocolLib.");
logger.warn("Currently there is an issue with FastLogin that prevents Floodgate name prefixes from showing up "
+ "when it is together used with ProtocolLib.");
logger.warn("If you would like to use Floodgate name prefixes, you can enable an experimental workaround by changing "
+ "the value 'floodgatePrefixWorkaround' to true in config.yml.");
logger.warn("For more information visit https://github.com/games647/FastLogin/issues/493");
}
}
//if server is using paper - we need to set the skin at pre login anyway, so no need for this listener
if (!PaperLib.isPaper() && getConfig().getBoolean("forwardSkin")) {
@ -315,13 +328,6 @@ public class FastLoginBukkit extends JavaPlugin implements PlatformPlugin<Comman
+ "Floodgate 2.0 from https://ci.opencollab.dev/job/GeyserMC/job/Floodgate/job/dev%252F2.0/");
logger.warn("Don't forget to update Geyser to a supported version as well from "
+ "https://ci.opencollab.dev/job/GeyserMC/job/Geyser/job/floodgate-2.0/");
} else if (isPluginInstalled("floodgate") && isPluginInstalled("ProtocolLib")) {
logger.warn("We have detected that you are running FastLogin alongside Floodgate and ProtocolLib.");
logger.warn("Currently there is an issue with FastLogin that prevents Floodgate's name prefixes from " +
"showing up when it is together used with ProtocolLib.");
logger.warn("If you would like to use Floodgate name prefixes, you can replace ProtocolLib with " +
"ProtocolSupport which does not have this issue.");
logger.warn("For more information visit https://github.com/games647/FastLogin/issues/493");
}
}
}

View File

@ -214,9 +214,8 @@ autoLoginFloodgate: false
#
# To prevent conflits from two different players having the same name, it is highly recommended to use a 'username-prefix'
# in floodgate/config.yml
# Note: 'username-prefix' is currently broken when used with FastLogin and ProtocolLib. For more information visit:
# https://github.com/games647/FastLogin/issues/493
# A solution to this is to replace ProtocolLib with ProtocolSupport
# Note: 'username-prefix' is currently broken when used with FastLogin and ProtocolLib.
# A solution to this is to enable 'floodgatePrefixWorkaround' below.
#
# Possible values:
# false: Kick Bedrock players, if they are using an existing Premium Java account's name
@ -243,6 +242,14 @@ allowFloodgateNameConflict: false
# Enabling this might lead to people gaining unauthorized access to other's accounts!
autoRegisterFloodgate: false
# Make FastLogin inject the Floodgate name prefixes, instead of Floodgate.
# This can fix prefixes, if you are using Floodgate alongside ProtocolLib.
# If either of those plugins are not installed, this option will have no effect.
# For more information visit: https://github.com/games647/FastLogin/issues/493
# !!!!!!!! WARNING: FLOODGATE SUPPORT IS AN EXPERIMENTAL FEATURE !!!!!!!!
# Enabling this might lead to people gaining unauthorized access to other's accounts!
floodgatePrefixWorkaround: false
# Database configuration
# Recommended is the use of MariaDB (a better version of MySQL)