[功能] 向 authme.admin.whitelistmessage
权限节点添加没有注册资格的玩家尝试入服的提醒
This commit is contained in:
parent
b1bee0967c
commit
110fc7266d
@ -7,6 +7,7 @@ import fr.xephi.authme.initialization.Reloadable;
|
|||||||
import fr.xephi.authme.message.MessageKey;
|
import fr.xephi.authme.message.MessageKey;
|
||||||
import fr.xephi.authme.message.Messages;
|
import fr.xephi.authme.message.Messages;
|
||||||
import fr.xephi.authme.output.ConsoleLoggerFactory;
|
import fr.xephi.authme.output.ConsoleLoggerFactory;
|
||||||
|
import fr.xephi.authme.permission.AdminPermission;
|
||||||
import fr.xephi.authme.permission.PermissionsManager;
|
import fr.xephi.authme.permission.PermissionsManager;
|
||||||
import fr.xephi.authme.permission.PlayerStatePermission;
|
import fr.xephi.authme.permission.PlayerStatePermission;
|
||||||
import fr.xephi.authme.service.AntiBotService;
|
import fr.xephi.authme.service.AntiBotService;
|
||||||
@ -87,6 +88,10 @@ public class OnJoinVerifier implements Reloadable {
|
|||||||
public void checkWhitelist(String name, boolean isAuthAvailable) throws FailedVerificationException {
|
public void checkWhitelist(String name, boolean isAuthAvailable) throws FailedVerificationException {
|
||||||
if (isAuthAvailable || permissionsManager.hasPermissionOffline(name, PlayerStatePermission.WHITELIST)) {
|
if (isAuthAvailable || permissionsManager.hasPermissionOffline(name, PlayerStatePermission.WHITELIST)) {
|
||||||
return;
|
return;
|
||||||
|
} else {
|
||||||
|
bukkitService.getOnlinePlayers().stream()
|
||||||
|
.filter(player -> permissionsManager.hasPermission(player, AdminPermission.WHITELIST_MESSAGE))
|
||||||
|
.forEach(player -> messages.send(player, MessageKey.WHITELIST_KICK, name));
|
||||||
}
|
}
|
||||||
if (whiteListService.shouldKick()) {
|
if (whiteListService.shouldKick()) {
|
||||||
throw new FailedVerificationException(MessageKey.KICK_WHITELIST);
|
throw new FailedVerificationException(MessageKey.KICK_WHITELIST);
|
||||||
|
|||||||
@ -199,6 +199,7 @@ public enum MessageKey {
|
|||||||
|
|
||||||
/** [AntiBotService] AntiBot disabled after %m minutes! */
|
/** [AntiBotService] AntiBot disabled after %m minutes! */
|
||||||
ANTIBOT_AUTO_DISABLED_MESSAGE("antibot.auto_disabled", "%m"),
|
ANTIBOT_AUTO_DISABLED_MESSAGE("antibot.auto_disabled", "%m"),
|
||||||
|
WHITELIST_KICK("misc.whitelist_kick", "%p"),
|
||||||
|
|
||||||
/** The email address is already being used */
|
/** The email address is already being used */
|
||||||
EMAIL_ALREADY_USED_ERROR("email.already_used"),
|
EMAIL_ALREADY_USED_ERROR("email.already_used"),
|
||||||
|
|||||||
@ -67,6 +67,7 @@ misc:
|
|||||||
accounts_owned_other: '玩家 %name 拥有 %count 个账户:'
|
accounts_owned_other: '玩家 %name 拥有 %count 个账户:'
|
||||||
whitelist_enabled: '&c*** 服务器已暂停注册 ***'
|
whitelist_enabled: '&c*** 服务器已暂停注册 ***'
|
||||||
whitelist_disabled: '&a*** 服务器已开放注册 ***'
|
whitelist_disabled: '&a*** 服务器已开放注册 ***'
|
||||||
|
whitelist_kick: '&7玩家 &c%p &7请求加入服务器,但是被拒绝了.'
|
||||||
|
|
||||||
# Session messages
|
# Session messages
|
||||||
session:
|
session:
|
||||||
|
|||||||
@ -184,6 +184,9 @@ permissions:
|
|||||||
authme.bypassantibot:
|
authme.bypassantibot:
|
||||||
description: Permission node to bypass AntiBot protection.
|
description: Permission node to bypass AntiBot protection.
|
||||||
default: op
|
default: op
|
||||||
|
authme.whitelist:
|
||||||
|
description: Permission node to whitelist.
|
||||||
|
default: op
|
||||||
authme.bypasscountrycheck:
|
authme.bypasscountrycheck:
|
||||||
description: Permission to bypass the GeoIp country code check.
|
description: Permission to bypass the GeoIp country code check.
|
||||||
default: false
|
default: false
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user