change join/leave messages behaviour
This commit is contained in:
parent
131cc22248
commit
0afa5f0535
@ -421,7 +421,9 @@ settings:
|
|||||||
# Do we need to broadcast the welcome message to all server or only to the player? set true for server or false for player
|
# Do we need to broadcast the welcome message to all server or only to the player? set true for server or false for player
|
||||||
broadcastWelcomeMessage: false
|
broadcastWelcomeMessage: false
|
||||||
# Do we need to delay the join/leave message to be displayed only when the player is authenticated ?
|
# Do we need to delay the join/leave message to be displayed only when the player is authenticated ?
|
||||||
delayJoinLeaveMessages: true
|
delayJoinMessage: false
|
||||||
|
removeJoinMessage: false
|
||||||
|
removeLeaveMessage: false
|
||||||
# Do we need to add potion effect Blinding before login/register ?
|
# Do we need to add potion effect Blinding before login/register ?
|
||||||
applyBlindEffect: false
|
applyBlindEffect: false
|
||||||
ExternalBoardOptions:
|
ExternalBoardOptions:
|
||||||
|
|||||||
@ -191,7 +191,15 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
public void onJoinMessage(PlayerJoinEvent event) {
|
public void onJoinMessage(PlayerJoinEvent event) {
|
||||||
final Player player = event.getPlayer();
|
final Player player = event.getPlayer();
|
||||||
if (player == null || !Settings.delayJoinLeaveMessages) {
|
if (player == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Settings.removeJoinMessage) {
|
||||||
|
event.setJoinMessage((String)null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!Settings.delayJoinMessage) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -357,7 +365,7 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Settings.delayJoinLeaveMessages && !Utils.checkAuth(player)) {
|
if (Settings.removeLeaveMessage) {
|
||||||
event.setQuitMessage((String)null);
|
event.setQuitMessage((String)null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -64,7 +64,7 @@ public final class Settings {
|
|||||||
purgeLimitedCreative, purgeAntiXray, purgePermissions,
|
purgeLimitedCreative, purgeAntiXray, purgePermissions,
|
||||||
enableProtection, enableAntiBot, recallEmail, useWelcomeMessage,
|
enableProtection, enableAntiBot, recallEmail, useWelcomeMessage,
|
||||||
broadcastWelcomeMessage, forceRegKick, forceRegLogin,
|
broadcastWelcomeMessage, forceRegKick, forceRegLogin,
|
||||||
checkVeryGames, delayJoinLeaveMessages, noTeleport, applyBlindEffect,
|
checkVeryGames, removeJoinMessage, removeLeaveMessage, delayJoinMessage, noTeleport, applyBlindEffect,
|
||||||
kickPlayersBeforeStopping, allowAllCommandsIfRegIsOptional,
|
kickPlayersBeforeStopping, allowAllCommandsIfRegIsOptional,
|
||||||
customAttributes, generateImage, isRemoveSpeedEnabled, preventOtherCase;
|
customAttributes, generateImage, isRemoveSpeedEnabled, preventOtherCase;
|
||||||
public static String getNickRegex, getUnloggedinGroup, getMySQLHost,
|
public static String getNickRegex, getUnloggedinGroup, getMySQLHost,
|
||||||
@ -241,7 +241,9 @@ public final class Settings {
|
|||||||
getMaxLoginPerIp = configFile.getInt("settings.restrictions.maxLoginPerIp", 0);
|
getMaxLoginPerIp = configFile.getInt("settings.restrictions.maxLoginPerIp", 0);
|
||||||
getMaxJoinPerIp = configFile.getInt("settings.restrictions.maxJoinPerIp", 0);
|
getMaxJoinPerIp = configFile.getInt("settings.restrictions.maxJoinPerIp", 0);
|
||||||
checkVeryGames = configFile.getBoolean("VeryGames.enableIpCheck", false);
|
checkVeryGames = configFile.getBoolean("VeryGames.enableIpCheck", false);
|
||||||
delayJoinLeaveMessages = configFile.getBoolean("settings.delayJoinLeaveMessages", false);
|
removeJoinMessage = configFile.getBoolean("settings.removeJoineMessage", false);
|
||||||
|
removeLeaveMessage = configFile.getBoolean("settings.removeLeaveMessage", false);
|
||||||
|
delayJoinMessage = configFile.getBoolean("settings.delayJoineMessage", false);
|
||||||
noTeleport = configFile.getBoolean("settings.restrictions.noTeleport", false);
|
noTeleport = configFile.getBoolean("settings.restrictions.noTeleport", false);
|
||||||
crazyloginFileName = configFile.getString("Converter.CrazyLogin.fileName", "accounts.db");
|
crazyloginFileName = configFile.getString("Converter.CrazyLogin.fileName", "accounts.db");
|
||||||
getPassRegex = configFile.getString("settings.restrictions.allowedPasswordCharacters", "[\\x21-\\x7E]*");
|
getPassRegex = configFile.getString("settings.restrictions.allowedPasswordCharacters", "[\\x21-\\x7E]*");
|
||||||
|
|||||||
@ -81,8 +81,15 @@ public class RegistrationSettings implements SettingsClass {
|
|||||||
newProperty("settings.broadcastWelcomeMessage", false);
|
newProperty("settings.broadcastWelcomeMessage", false);
|
||||||
|
|
||||||
@Comment("Do we need to delay the join/leave message to be displayed only when the player is authenticated?")
|
@Comment("Do we need to delay the join/leave message to be displayed only when the player is authenticated?")
|
||||||
public static final Property<Boolean> DELAY_JOIN_LEAVE_MESSAGES =
|
public static final Property<Boolean> DELAY_JOIN_MESSAGE =
|
||||||
newProperty("settings.delayJoinLeaveMessages", true);
|
newProperty("settings.delayJoinMessage", false);
|
||||||
|
|
||||||
|
// TODO: comments!
|
||||||
|
public static final Property<Boolean> REMOVE_JOIN_MESSAGE =
|
||||||
|
newProperty("settings.removeJoinMessages", false);
|
||||||
|
|
||||||
|
public static final Property<Boolean> REMOVE_LEAVE_MESSAGE =
|
||||||
|
newProperty("settings.removeLeaveMessages", false);
|
||||||
|
|
||||||
@Comment("Do we need to add potion effect Blinding before login/reigster?")
|
@Comment("Do we need to add potion effect Blinding before login/reigster?")
|
||||||
public static final Property<Boolean> APPLY_BLIND_EFFECT =
|
public static final Property<Boolean> APPLY_BLIND_EFFECT =
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user