mirror of
https://e.coding.net/circlecloud/AuthMe.git
synced 2025-11-25 21:36:19 +00:00
@@ -319,6 +319,10 @@ public class AuthMe extends JavaPlugin {
|
|||||||
} catch (final Exception e) {
|
} catch (final Exception e) {
|
||||||
ConsoleLogger.writeStackTrace(e);
|
ConsoleLogger.writeStackTrace(e);
|
||||||
ConsoleLogger.showError("无法载入配置文件... 某些配置是错误的, 为了安全考虑 服务器即将关闭!");
|
ConsoleLogger.showError("无法载入配置文件... 某些配置是错误的, 为了安全考虑 服务器即将关闭!");
|
||||||
|
try {
|
||||||
|
Thread.sleep(3000);
|
||||||
|
} catch (final InterruptedException e1) {
|
||||||
|
}
|
||||||
server.shutdown();
|
server.shutdown();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -343,6 +347,7 @@ public class AuthMe extends JavaPlugin {
|
|||||||
} catch (ClassNotFoundException | NoClassDefFoundError e) {
|
} catch (ClassNotFoundException | NoClassDefFoundError e) {
|
||||||
ConsoleLogger.info("You're using Minecraft 1.6.x or older, Log4J support will be disabled");
|
ConsoleLogger.info("You're using Minecraft 1.6.x or older, Log4J support will be disabled");
|
||||||
}
|
}
|
||||||
|
ConsoleLogger.info("已开启密码安全替换 控制台将不会记录密码相关数据...");
|
||||||
}
|
}
|
||||||
|
|
||||||
// AntiBot delay
|
// AntiBot delay
|
||||||
@@ -405,6 +410,7 @@ public class AuthMe extends JavaPlugin {
|
|||||||
|
|
||||||
// Bungeecord hook
|
// Bungeecord hook
|
||||||
if (Settings.bungee) {
|
if (Settings.bungee) {
|
||||||
|
ConsoleLogger.info("已启用 BungeeCord 数据转发...");
|
||||||
Bukkit.getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
|
Bukkit.getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
|
||||||
Bukkit.getMessenger().registerIncomingPluginChannel(this, "BungeeCord", new BungeeCordMessage(this));
|
Bukkit.getMessenger().registerIncomingPluginChannel(this, "BungeeCord", new BungeeCordMessage(this));
|
||||||
}
|
}
|
||||||
@@ -464,10 +470,10 @@ public class AuthMe extends JavaPlugin {
|
|||||||
|
|
||||||
// Configuration Security Warnings
|
// Configuration Security Warnings
|
||||||
if (!Settings.isForceSingleSessionEnabled) {
|
if (!Settings.isForceSingleSessionEnabled) {
|
||||||
ConsoleLogger.showError("WARNING!!! 你关闭了单点登录保护 玩家帐号可能被顶下线!");
|
ConsoleLogger.showError("警告!!! 你关闭了单点登录保护 玩家帐号可能被顶下线!");
|
||||||
}
|
}
|
||||||
if (Settings.getSessionTimeout == 0 && Settings.isSessionsEnabled) {
|
if (Settings.getSessionTimeout == 0 && Settings.isSessionsEnabled) {
|
||||||
ConsoleLogger.showError("WARNING!!! 你配置了Session超时为0 请注意账户的安全问题!");
|
ConsoleLogger.showError("警告!!! 你配置了Session超时为0 请注意账户的安全问题!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Successful message
|
// Successful message
|
||||||
@@ -602,6 +608,10 @@ public class AuthMe extends JavaPlugin {
|
|||||||
} else {
|
} else {
|
||||||
server.getPluginManager().disablePlugin(AuthMe.getInstance());
|
server.getPluginManager().disablePlugin(AuthMe.getInstance());
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
Thread.sleep(3000);
|
||||||
|
} catch (final InterruptedException e1) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show the exception message and stop/unload the server/plugin as defined
|
// Show the exception message and stop/unload the server/plugin as defined
|
||||||
@@ -631,7 +641,7 @@ public class AuthMe extends JavaPlugin {
|
|||||||
if (cleared.isEmpty()) {
|
if (cleared.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ConsoleLogger.info("自动清理数据库: " + cleared.size() + " 个账户已清理!");
|
ConsoleLogger.info("自动清理数据库: 移除 " + cleared.size() + " 个 AuthMe 账户");
|
||||||
if (Settings.purgeEssentialsFile && this.ess != null) {
|
if (Settings.purgeEssentialsFile && this.ess != null) {
|
||||||
dataManager.purgeEssentials(cleared); // name to UUID convertion
|
dataManager.purgeEssentials(cleared); // name to UUID convertion
|
||||||
}
|
}
|
||||||
@@ -646,8 +656,7 @@ public class AuthMe extends JavaPlugin {
|
|||||||
if (Settings.purgeAntiXray) {
|
if (Settings.purgeAntiXray) {
|
||||||
dataManager.purgeAntiXray(cleared); // IDK if it uses UUID or
|
dataManager.purgeAntiXray(cleared); // IDK if it uses UUID or
|
||||||
}
|
}
|
||||||
// names... (Actually it purges
|
// names... (Actually it purges only names!)
|
||||||
// only names!)
|
|
||||||
if (Settings.purgePermissions) {
|
if (Settings.purgePermissions) {
|
||||||
dataManager.purgePermissions(cleared, permission);
|
dataManager.purgePermissions(cleared, permission);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,21 +13,24 @@ public class ConsoleFilter implements Filter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLoggable(LogRecord record) {
|
public boolean isLoggable(final LogRecord record) {
|
||||||
try {
|
try {
|
||||||
if (record == null || record.getMessage() == null)
|
if (record == null || record.getMessage() == null) {
|
||||||
return true;
|
return true;
|
||||||
String logM = record.getMessage().toLowerCase();
|
}
|
||||||
if (!logM.contains("issued server command:"))
|
final String logM = record.getMessage().toLowerCase();
|
||||||
|
if (!logM.contains("issued server command:")) {
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
if (!logM.contains("/login ") && !logM.contains("/l ") && !logM.contains("/reg ") && !logM.contains("/changepassword ") && !logM.contains("/unregister ")
|
if (!logM.contains("/login ") && !logM.contains("/l ") && !logM.contains("/reg ") && !logM.contains("/changepassword ") && !logM.contains("/unregister ")
|
||||||
&& !logM.contains("/authme register ") && !logM.contains("/authme changepassword ") && !logM.contains("/authme reg ") && !logM.contains("/authme cp ")
|
&& !logM.contains("/authme register ") && !logM.contains("/authme changepassword ") && !logM.contains("/authme reg ") && !logM.contains("/authme cp ")
|
||||||
&& !logM.contains("/register "))
|
&& !logM.contains("/register ")) {
|
||||||
return true;
|
return true;
|
||||||
String playername = record.getMessage().split(" ")[0];
|
}
|
||||||
|
final String playername = record.getMessage().split(" ")[0];
|
||||||
record.setMessage(playername + " issued an AuthMe command!");
|
record.setMessage(playername + " issued an AuthMe command!");
|
||||||
return true;
|
return true;
|
||||||
} catch (NullPointerException npe) {
|
} catch (final NullPointerException npe) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,13 +75,12 @@ public class PerformBackup {
|
|||||||
final File dirBackup = new File(AuthMe.getInstance().getDataFolder() + "/backups");
|
final File dirBackup = new File(AuthMe.getInstance().getDataFolder() + "/backups");
|
||||||
|
|
||||||
if (!dirBackup.exists()) {
|
if (!dirBackup.exists()) {
|
||||||
dirBackup.mkdir();
|
dirBackup.mkdirs();
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
copy(new File("plugins" + File.separator + "AuthMe" + File.separator + backend), new File(path + ".db"));
|
copy(new File("plugins" + File.separator + "AuthMe" + File.separator + backend), new File(path + ".db"));
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
} catch (final Exception ex) {
|
} catch (final Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -101,10 +100,10 @@ public class PerformBackup {
|
|||||||
runtimeProcess = Runtime.getRuntime().exec(executeCmd);
|
runtimeProcess = Runtime.getRuntime().exec(executeCmd);
|
||||||
final int processComplete = runtimeProcess.waitFor();
|
final int processComplete = runtimeProcess.waitFor();
|
||||||
if (processComplete == 0) {
|
if (processComplete == 0) {
|
||||||
ConsoleLogger.info("Backup created successfully.");
|
ConsoleLogger.info("备份创建成功.");
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
ConsoleLogger.showError("Could not create the backup!");
|
ConsoleLogger.showError("无法创建备份!");
|
||||||
}
|
}
|
||||||
} catch (final Exception ex) {
|
} catch (final Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
@@ -116,10 +115,10 @@ public class PerformBackup {
|
|||||||
runtimeProcess = Runtime.getRuntime().exec(executeCmd);
|
runtimeProcess = Runtime.getRuntime().exec(executeCmd);
|
||||||
final int processComplete = runtimeProcess.waitFor();
|
final int processComplete = runtimeProcess.waitFor();
|
||||||
if (processComplete == 0) {
|
if (processComplete == 0) {
|
||||||
ConsoleLogger.info("Backup created successfully.");
|
ConsoleLogger.info("备份创建成功.");
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
ConsoleLogger.showError("Could not create the backup!");
|
ConsoleLogger.showError("无法创建备份!");
|
||||||
}
|
}
|
||||||
} catch (final Exception ex) {
|
} catch (final Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ public class Utils {
|
|||||||
if (lookupService != null) {
|
if (lookupService != null) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
ConsoleLogger.info("从 CityCraft 的 Yum 源 下载IP缓存库...");
|
ConsoleLogger.info("[LICENSE] IP数据来自 CityCraft 的 Yum 源 原始数据来自 http://www.maxmind.com");
|
||||||
final File file = new File(Settings.APLUGIN_FOLDER, "GeoIP.dat");
|
final File file = new File(Settings.APLUGIN_FOLDER, "GeoIP.dat");
|
||||||
try {
|
try {
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
@@ -98,6 +98,7 @@ public class Utils {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ConsoleLogger.info("从 CityCraft 的 Yum 源 下载IP缓存库...");
|
||||||
final String url = "http://citycraft.cn/downloads/authme/GeoIP.dat.gz";
|
final String url = "http://citycraft.cn/downloads/authme/GeoIP.dat.gz";
|
||||||
final URL downloadUrl = new URL(url);
|
final URL downloadUrl = new URL(url);
|
||||||
final URLConnection conn = downloadUrl.openConnection();
|
final URLConnection conn = downloadUrl.openConnection();
|
||||||
|
|||||||
@@ -385,9 +385,11 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!Settings.isMovementAllowed) {
|
if (!Settings.isMovementAllowed) {
|
||||||
if (!event.getFrom().getBlock().equals(event.getTo().getBlock())) {
|
final Location from = event.getFrom();
|
||||||
event.setTo(event.getFrom());
|
from.setPitch(event.getTo().getPitch());
|
||||||
}
|
from.setYaw(event.getTo().getYaw());
|
||||||
|
|
||||||
|
event.setTo(from);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -397,7 +399,6 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
|
|
||||||
final int radius = Settings.getMovementRadius;
|
final int radius = Settings.getMovementRadius;
|
||||||
final Location spawn = plugin.getSpawnLocation(player);
|
final Location spawn = plugin.getSpawnLocation(player);
|
||||||
|
|
||||||
if (spawn != null && spawn.getWorld() != null) {
|
if (spawn != null && spawn.getWorld() != null) {
|
||||||
if (!event.getPlayer().getWorld().equals(spawn.getWorld())) {
|
if (!event.getPlayer().getWorld().equals(spawn.getWorld())) {
|
||||||
event.getPlayer().teleport(spawn);
|
event.getPlayer().teleport(spawn);
|
||||||
|
|||||||
@@ -1,57 +1,57 @@
|
|||||||
unknown_user: '&f数据库里找不到此用户'
|
unknown_user: '&f数据库里找不到此用户!'
|
||||||
unsafe_spawn: '&f你退出服务器时的位置不安全,正在传送你到此世界的出生点'
|
unsafe_spawn: '&c你退出服务器时的位置不安全,正在传送你到此世界的出生点!'
|
||||||
not_logged_in: '&c你还未登录!'
|
not_logged_in: '&c你还未登录!'
|
||||||
reg_voluntarily: '&f你可以在服务器里使用这个指令以注册:“/register <密码> <再输入一次以确定密码>”'
|
reg_voluntarily: '&f你可以在服务器里使用这个指令以注册:“/register <密码> <再输入一次以确定密码>”!'
|
||||||
usage_log: '&c正确用法:“/login <密码>”'
|
usage_log: '&c正确用法:“/login <密码>”!'
|
||||||
wrong_pwd: '&c错误的密码'
|
wrong_pwd: '&c错误的密码!'
|
||||||
unregistered: '&c成功删除此用户!'
|
unregistered: '&c成功删除此用户!'
|
||||||
reg_disabled: '&c目前服务器暂时禁止注册,请到服务器论坛以得到更多资讯'
|
reg_disabled: '&c目前服务器暂时禁止注册,请到服务器论坛以得到更多资讯!'
|
||||||
valid_session: '&c欢迎回来,已帮你自动登录到此服务器'
|
valid_session: '&c欢迎回来,已帮你自动登录到此服务器!'
|
||||||
login: '&c已成功登录!'
|
login: '&c已成功登录!'
|
||||||
vb_nonActiv: '&f你的帐号还未激活,请查看你的邮箱!'
|
vb_nonActiv: '&f你的帐号还未激活,请查看你的邮箱!'
|
||||||
user_regged: '&c此用户已经在此服务器注册过'
|
user_regged: '&c此用户已经在此服务器注册过!'
|
||||||
usage_reg: '&c正确用法:“/register <密码> <再输入一次以确定密码>”'
|
usage_reg: '&c正确用法:“/register <密码> <再输入一次以确定密码>”!'
|
||||||
max_reg: '&f你不允许再为你的IP在服务器注册更多用户了!'
|
max_reg: '&f你不允许再为你的IP在服务器注册更多用户了!'
|
||||||
password_error_nick: '&f你不能使用昵称当作密码!'
|
password_error_nick: '&f你不能使用昵称当作密码!'
|
||||||
password_error_unsafe: '&f你不能使用不安全的密码!'
|
password_error_unsafe: '&f你不能使用不安全的密码!'
|
||||||
reg_email_msg: '&c请输入 "/register <邮箱> <确认电子邮件>"'
|
reg_email_msg: '&c请输入 "/register <邮箱> <确认电子邮件>" !'
|
||||||
no_perm: '&c你没有此操作的权限'
|
no_perm: '&c你没有此操作的权限!'
|
||||||
error: '&f发现错误,请联系管理员!'
|
error: '&f发现错误,请联系管理员!'
|
||||||
login_msg: '&c请输入“/login <密码>”以登录'
|
login_msg: '&c请输入“/login <密码>”以登录!'
|
||||||
reg_msg: '&c请输入“/register <密码> <再输入一次以确定密码>”以注册'
|
reg_msg: '&c请输入“/register <密码> <再输入一次以确定密码>”以注册!'
|
||||||
usage_unreg: '&c正确用法:“/unregister <密码>”'
|
usage_unreg: '&c正确用法:“/unregister <密码>”!'
|
||||||
pwd_changed: '&c密码已成功修改!'
|
pwd_changed: '&c密码已成功修改!'
|
||||||
user_unknown: '&c此用户名还未注册过'
|
user_unknown: '&c此用户名还未注册过!'
|
||||||
password_error: '&f两次输入的密码不相同'
|
password_error: '&f两次输入的密码不相同!'
|
||||||
invalid_session: '&f登陆数据异常,请等待登陆结束'
|
invalid_session: '&f登陆数据异常,请等待登陆结束!'
|
||||||
reg_only: '&f只允许注册过的玩家进服!请到http://example.com以注册'
|
reg_only: '&f只允许注册过的玩家进服!请到http://example.com以注册!'
|
||||||
logged_in: '&c你已经登陆过了!'
|
logged_in: '&c你已经登陆过了!'
|
||||||
logout: '&c已成功登出!'
|
logout: '&c已成功登出!'
|
||||||
same_nick: '&f同样的用户名现在在线且已经登录了!'
|
same_nick: '&f同样的用户名现在在线且已经登录了!'
|
||||||
registered: '&c已成功注册!'
|
registered: '&c已成功注册!'
|
||||||
pass_len: '&c你的密码没有达到要求!'
|
pass_len: '&c你的密码没有达到要求!'
|
||||||
reload: '&f配置以及数据已经重新加载完毕!'
|
reload: '&f配置以及数据已经重新加载完毕!'
|
||||||
timeout: '&f给你登录的时间已经过了'
|
timeout: '&f给你登录的时间已经过了!'
|
||||||
usage_changepassword: '&f正确用法:“/changepassword 旧密码 新密码”'
|
usage_changepassword: '&f正确用法:“/changepassword 旧密码 新密码”!'
|
||||||
name_len: '&c你的用户名太短或者太长了'
|
name_len: '&c你的用户名太短或者太长了!'
|
||||||
regex: '&c你的用户名包含非法字母,用户名里允许的字母: REG_EX'
|
regex: '&c你的用户名包含非法字母,用户名里允许的字母: REG_EX !'
|
||||||
add_email: '&c请输入“/email add <你的邮箱> <再输入一次以确认>”以把你的邮箱添加到此帐号'
|
add_email: '&c请输入“/email add <你的邮箱> <再输入一次以确认>”以把你的邮箱添加到此帐号!'
|
||||||
recovery_email: '&c忘了你的密码?请输入:“/email recovery <你的邮箱>”'
|
recovery_email: '&c忘了你的密码?请输入:“/email recovery <你的邮箱>”!'
|
||||||
usage_captcha: '&c正确用法:/captcha <验证码>'
|
usage_captcha: '&c正确用法:/captcha <验证码> !'
|
||||||
wrong_captcha: '&c错误的验证码,请输入:“/captcha <验证码>”'
|
wrong_captcha: '&c错误的验证码,请输入:“/captcha <验证码>”!'
|
||||||
valid_captcha: '&c你的验证码是有效的!'
|
valid_captcha: '&c你的验证码是有效的!'
|
||||||
kick_forvip: '&c有VIP玩家加入了已满的服务器 您被踢出了服务器!'
|
kick_forvip: '&c有VIP玩家加入了已满的服务器 您被踢出了服务器!'
|
||||||
kick_fullserver: '&c抱歉,服务器已满!'
|
kick_fullserver: '&c抱歉,服务器已满!'
|
||||||
usage_email_add: '&f用法: /email add <邮箱> <确认电子邮件> '
|
usage_email_add: '&f用法: /email add <邮箱> <确认电子邮件> !'
|
||||||
usage_email_change: '&f用法: /email change <旧邮箱> <新邮箱> '
|
usage_email_change: '&f用法: /email change <旧邮箱> <新邮箱> !'
|
||||||
usage_email_recovery: '&f用法: /email recovery <邮箱>'
|
usage_email_recovery: '&f用法: /email recovery <邮箱> !'
|
||||||
new_email_invalid: '&f新邮箱无效!'
|
new_email_invalid: '&f新邮箱无效!'
|
||||||
old_email_invalid: '&f旧邮箱无效!'
|
old_email_invalid: '&f旧邮箱无效!'
|
||||||
email_invalid: '&f无效的邮箱'
|
email_invalid: '&f无效的邮箱!'
|
||||||
email_added: '&f邮箱已添加!'
|
email_added: '&f邮箱已添加!'
|
||||||
email_confirm: '&f确认你的邮箱!'
|
email_confirm: '&f确认你的邮箱!'
|
||||||
email_changed: '&f邮箱已改变!'
|
email_changed: '&f邮箱已改变!'
|
||||||
email_send: '&f恢复邮件已发送!'
|
email_send: '&f恢复邮件已发送!'
|
||||||
country_banned: '&f这个服务器禁止该国家登陆!'
|
country_banned: '&f这个服务器禁止该国家登陆!'
|
||||||
antibot_auto_enabled: '[AuthMe] 防机器人程序由于大量异常连接而启用'
|
antibot_auto_enabled: '[AuthMe] 防机器人程序由于大量异常连接而启用!'
|
||||||
antibot_auto_disabled: '[AuthMe] 防机器人程序由于异常连接减少而在 %m 分钟后停止'
|
antibot_auto_disabled: '[AuthMe] 防机器人程序由于异常连接减少而在 %m 分钟后停止!'
|
||||||
Reference in New Issue
Block a user