From 532f8d5d62f3c99bd7a3a4560689058933dc1e82 Mon Sep 17 00:00:00 2001 From: Loyisa Date: Sun, 18 Dec 2022 00:48:30 +0800 Subject: [PATCH 1/7] Reworked the translation --- README.md | 10 +- .../java/ru/leymooo/botfilter/BotFilter.java | 14 +- .../leymooo/botfilter/BotFilterCommand.java | 35 ++-- .../ru/leymooo/botfilter/BotFilterThread.java | 2 +- .../java/ru/leymooo/botfilter/Connector.java | 2 +- .../botfilter/caching/PacketUtils.java | 2 +- .../botfilter/captcha/CaptchaGeneration.java | 6 +- .../ru/leymooo/botfilter/config/Settings.java | 158 +++++++++--------- .../botfilter/utils/FakeOnlineUtils.java | 2 +- .../ru/leymooo/botfilter/utils/GeoIp.java | 10 +- .../java/ru/leymooo/botfilter/utils/Sql.java | 20 +-- proxy/src/main/resources/messages.properties | 85 +++++----- 12 files changed, 176 insertions(+), 170 deletions(-) diff --git a/README.md b/README.md index 91fd05f17f..1720416b8c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -BungeeCord with built in AntiBot protection. (Russian lang) +BungeeCord with built in AntiBot protection. (English lang) ========== Videos @@ -10,4 +10,10 @@ Falling check: Download -------- -You can download this protection on [RuBukkit](http://www.rubukkit.org/threads/137038/) or on [Yandex Disk](https://yadi.sk/d/QrSeJWeU3LAq4p) +You can download this protection at [Releases](https://github.com/LoyisaSUS/BungeeCord-BotFilter-ENG/releases/) + +Credit +-------- +[Leymooo](https://github.com/Leymooo) (Original BotFilter developer)
+[koloslolya](https://github.com/SleepyKolosLolya) (Help me translate BotFilter)
+[Maxsimuss](https://github.com/Maxsimuss) (Help me translate BotFilter) \ No newline at end of file diff --git a/proxy/src/main/java/ru/leymooo/botfilter/BotFilter.java b/proxy/src/main/java/ru/leymooo/botfilter/BotFilter.java index 48c32792be..a29e08e0bb 100644 --- a/proxy/src/main/java/ru/leymooo/botfilter/BotFilter.java +++ b/proxy/src/main/java/ru/leymooo/botfilter/BotFilter.java @@ -414,8 +414,8 @@ private void checkForUpdates(boolean startup) Logger logger = BungeeCord.getInstance().getLogger(); try { - logger.log( Level.INFO, "[BotFilter] Проверяю наличие обновлений" ); - URL url = new URL( "https://raw.githubusercontent.com/Leymooo/BungeeCord/master/version.txt" ); + logger.log( Level.INFO, "[BotFilter] Checking for updates..." ); + URL url = new URL( "https://raw.githubusercontent.com/LoyisaSUS/BungeeCord/master/version.txt" ); URLConnection conn = url.openConnection(); conn.setConnectTimeout( 1200 ); conn.setReadTimeout( 1200 ); @@ -425,21 +425,21 @@ private void checkForUpdates(boolean startup) if ( !in.readLine().trim().equalsIgnoreCase( Settings.IMP.BOT_FILTER_VERSION ) ) { - logger.log( Level.INFO, "§c[BotFilter] §aНайдена новая версия!" ); - logger.log( Level.INFO, "§c[BotFilter] §aПожалуйста, обновитесь!" ); - logger.log( Level.INFO, "§c[BotFilter] §ahttp://rubukkit.org/threads/137038" ); + logger.log( Level.INFO, "§c[BotFilter] §aNew update available!" ); + logger.log( Level.INFO, "§c[BotFilter] §aPlease update to latest version!" ); + logger.log( Level.INFO, "§c[BotFilter] §ahttps://github.com/LoyisaSUS/BungeeCord-BotFilter-ENG/releases/" ); if ( startup ) { Thread.sleep( 3500L ); } } else { - logger.log( Level.INFO, "[BotFilter] Обновлений не найдено!" ); + logger.log( Level.INFO, "[BotFilter] You are using the latest version!" ); } } } catch ( IOException | InterruptedException ex ) { - logger.log( Level.WARNING, "[BotFilter] Не могу проверить обновление", ex ); + logger.log( Level.WARNING, "[BotFilter] Can't check the update", ex ); } } diff --git a/proxy/src/main/java/ru/leymooo/botfilter/BotFilterCommand.java b/proxy/src/main/java/ru/leymooo/botfilter/BotFilterCommand.java index bfeb035c6f..351d49c63e 100644 --- a/proxy/src/main/java/ru/leymooo/botfilter/BotFilterCommand.java +++ b/proxy/src/main/java/ru/leymooo/botfilter/BotFilterCommand.java @@ -35,30 +35,30 @@ public void execute(CommandSender sender, String[] args) if ( args.length == 0 ) { sender.sendMessage( "§r--------------- §bBotFilter §cv" + Settings.IMP.BOT_FILTER_VERSION + "§r-----------------" ); - sender.sendMessage( "§r> §lbotfilter reload §6- §aПерезагружить конфиг" ); - sender.sendMessage( "§r> §lbotfilter stat §6- §aПоказать статистику" ); - sender.sendMessage( "§r> §lbotfilter export §6- §aВыгрузить список игроков, которые прошли проверку" ); - sender.sendMessage( "§r> §lbotfilter protection on/off §6- §aВключить или выключить ручной режим 'под атакой'" ); + sender.sendMessage( "§r> §lbotfilter reload §6- §aReload the configuration" ); + sender.sendMessage( "§r> §lbotfilter stat §6- §aShow statistics" ); + sender.sendMessage( "§r> §lbotfilter export §6- §aExport player list what passed the bot filter" ); + sender.sendMessage( "§r> §lbotfilter protection on/off §6- §aEnable or disable manual mode 'under attack'" ); sender.sendMessage( "§r--------------- §bBotFilter §r-----------------" ); } else if ( args[0].equalsIgnoreCase( "reload" ) ) { BungeeCord.getInstance().getBotFilter().disable(); BungeeCord.getInstance().setBotFilter( new BotFilter( false ) ); - sender.sendMessage( "§aКоманда выполнена" ); + sender.sendMessage( "§aCommand executed" ); } else if ( args[0].equalsIgnoreCase( "stat" ) || args[0].equalsIgnoreCase( "stats" ) || args[0].equalsIgnoreCase( "info" ) ) { sendStat( sender ); } else if ( args[0].equalsIgnoreCase( "export" ) ) { export( sender, args ); - sender.sendMessage( "§aКоманда выполнена" ); + sender.sendMessage( "§aCommand executed" ); } else if ( args[0].equalsIgnoreCase( "protection" ) ) { if ( args.length >= 2 ) { boolean enable = args[1].equalsIgnoreCase( "on" ); BungeeCord.getInstance().getBotFilter().setForceProtectionEnabled( enable ); - sender.sendMessage( "§aЗашита " + ( enable ? "включена" : "§cотключена" ) ); + sender.sendMessage( "§aProtection " + ( enable ? "enabled" : "§cdisabled" ) ); } } } @@ -67,10 +67,11 @@ private void sendStat(CommandSender sender) { BotFilter botFilter = BungeeCord.getInstance().getBotFilter(); sender.sendMessage( "§r----------------- §bBotFilter §cv" + Settings.IMP.BOT_FILTER_VERSION + " §r-----------------" ); - sender.sendMessage( "§r> §lОбнаружена атака: " + ( botFilter.isUnderAttack() ? "§cДа" : "§aНет" ) ); - sender.sendMessage( "§r> §lБотов на проверке: " + botFilter.getOnlineOnFilter() ); - sender.sendMessage( "§r> §lПрошло проверку: " + botFilter.getUsersCount() ); - sender.sendMessage( "§r> §lСкачать BotFilter: http://www.rubukkit.org/threads/137038/" ); + sender.sendMessage( "§r> §lUnder attack: " + ( botFilter.isUnderAttack() ? "§cYes" : "§aNo" ) ); + sender.sendMessage( "§r> §lBots on checking: " + botFilter.getOnlineOnFilter() ); + sender.sendMessage( "§r> §lVerified player(s): " + botFilter.getUsersCount() ); + sender.sendMessage( "§r> §lDownload BotFilter(RUS): http://www.rubukkit.org/threads/137038/" ); + sender.sendMessage( "§r> §lDownload BotFilter(ENG): https://github.com/LoyisaSUS/BungeeCord/" ); } private void export(CommandSender sender, String[] args) @@ -79,10 +80,10 @@ private void export(CommandSender sender, String[] args) if ( args.length == 1 ) { - sender.sendMessage( "§r> §lbotfilter export [TIME_IN_SECONDS] §6- §aвыгрузить список тех, кто прошёл" - + " проверку за указаное время. укажите ALL чтобы получить за всё время." ); - sender.sendMessage( "§r> §lbotfilter export [TIME_IN_SECONDS] JOIN §6- §aвыгрузить список тех," - + " кто зашёл на сервер за указанное время (Учитывает и тех кто также и прошёл проверку)." ); + sender.sendMessage( "§r> §lbotfilter export [TIME_IN_SECONDS] §6- §aExport the list of players what " + + "have passed the check for the specified time. Use \"ALL\" to get list for all the time" ); + sender.sendMessage( "§r> §lbotfilter export [TIME_IN_SECONDS] JOIN §6- §aExport the list of players what " + + "have passed the check for the specified time. (Including players what have passed the check)" ); return; } if ( args[1].equalsIgnoreCase( "all" ) ) @@ -120,7 +121,7 @@ private void export(CommandSender sender, String[] args) exportToFile( out, join ); } catch ( Exception e ) { - sender.sendMessage( "§cУкажите число" ); + sender.sendMessage( "§cPlease input a number value" ); } } @@ -132,7 +133,7 @@ private void exportToFile(List out, boolean join) Files.write( outFile, out, StandardCharsets.UTF_8, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING ); } catch ( IOException e ) { - BungeeCord.getInstance().getLogger().log( Level.WARNING, "[BotFilter] Could not export ip's to file", e ); + BungeeCord.getInstance().getLogger().log( Level.WARNING, "[BotFilter] Could not export ips to file", e ); } } diff --git a/proxy/src/main/java/ru/leymooo/botfilter/BotFilterThread.java b/proxy/src/main/java/ru/leymooo/botfilter/BotFilterThread.java index 0ff8233463..5bf0be28cb 100644 --- a/proxy/src/main/java/ru/leymooo/botfilter/BotFilterThread.java +++ b/proxy/src/main/java/ru/leymooo/botfilter/BotFilterThread.java @@ -66,7 +66,7 @@ public static void start() } catch ( Exception e ) { - bungee.getLogger().log( Level.WARNING, "[BotFilter] Непонятная ошибка. Пожалуйста отправте ёё разработчику!", e ); + bungee.getLogger().log( Level.WARNING, "[BotFilter] Unknown error. Please report it to the developer!", e ); } finally { if ( !TO_REMOVE_SET.isEmpty() ) diff --git a/proxy/src/main/java/ru/leymooo/botfilter/Connector.java b/proxy/src/main/java/ru/leymooo/botfilter/Connector.java index a1a700d052..8283d3196b 100644 --- a/proxy/src/main/java/ru/leymooo/botfilter/Connector.java +++ b/proxy/src/main/java/ru/leymooo/botfilter/Connector.java @@ -201,7 +201,7 @@ public void completeCheck() userConnection.setNeedLogin( false ); userConnection.getPendingConnection().finishLogin( userConnection, true ); markDisconnected = true; - LOGGER.log( Level.INFO, "[BotFilter] Игрок (" + name + "|" + ip + ") успешно прошёл проверку" ); + LOGGER.log( Level.INFO, "[BotFilter] Player (" + name + "|" + ip + ") passed verification successfully" ); } @Override diff --git a/proxy/src/main/java/ru/leymooo/botfilter/caching/PacketUtils.java b/proxy/src/main/java/ru/leymooo/botfilter/caching/PacketUtils.java index f42e266c5d..b2642494db 100644 --- a/proxy/src/main/java/ru/leymooo/botfilter/caching/PacketUtils.java +++ b/proxy/src/main/java/ru/leymooo/botfilter/caching/PacketUtils.java @@ -152,7 +152,7 @@ public static void init() kickMessagesGame.put( KickType.FAILED_FALLING, failedMessage ); kickMessagesGame.put( KickType.TIMED_OUT, failedMessage ); kickMessagesGame.put( KickType.COUNTRY, new CachedPacket( createKickPacket( Settings.IMP.MESSAGES.KICK_COUNTRY ), kickGame ) ); - kickMessagesGame.put( KickType.BIG_PACKET, new CachedPacket( createKickPacket( "§cНе удалось проверить на бота. Пожалуйста сообщите об этом администрации. (Был отправлен большой пакет)" ), kickGame ) ); + kickMessagesGame.put( KickType.BIG_PACKET, new CachedPacket( createKickPacket( "§cFailed while checking. Please report it to the administration. (Big packet was sent)" ), kickGame ) ); kickMessagesLogin.put( KickType.PING, new CachedPacket( createKickPacket( String.join( "", Settings.IMP.SERVER_PING_CHECK.KICK_MESSAGE ) ), kickLogin ) ); kickMessagesLogin.put( KickType.MANYCHECKS, new CachedPacket( createKickPacket( Settings.IMP.MESSAGES.KICK_MANY_CHECKS ), kickLogin ) ); kickMessagesLogin.put( KickType.COUNTRY, new CachedPacket( createKickPacket( Settings.IMP.MESSAGES.KICK_COUNTRY ), kickLogin ) ); diff --git a/proxy/src/main/java/ru/leymooo/botfilter/captcha/CaptchaGeneration.java b/proxy/src/main/java/ru/leymooo/botfilter/captcha/CaptchaGeneration.java index bc8e246936..b44049b269 100644 --- a/proxy/src/main/java/ru/leymooo/botfilter/captcha/CaptchaGeneration.java +++ b/proxy/src/main/java/ru/leymooo/botfilter/captcha/CaptchaGeneration.java @@ -54,13 +54,13 @@ public void generateImages() ThreadPoolExecutor ex = (ThreadPoolExecutor) executor; while ( ex.getActiveCount() != 0 ) { - BungeeCord.getInstance().getLogger().log( Level.INFO, "[BotFilter] Генерирую капчу [{0}/900]", 900 - ex.getQueue().size() - ex.getActiveCount() ); + BungeeCord.getInstance().getLogger().log( Level.INFO, "[BotFilter] Generating Captcha... [{0}/900]", 900 - ex.getQueue().size() - ex.getActiveCount() ); try { Thread.sleep( 1000L ); } catch ( InterruptedException ex1 ) { - BungeeCord.getInstance().getLogger().log( Level.WARNING, "[BotFilter] Не могу сгенерировать капчу. Выключаю банджу", ex1 ); + BungeeCord.getInstance().getLogger().log( Level.WARNING, "[BotFilter] Can't generate the Captcha. Shutting down...", ex1 ); System.exit( 0 ); return; } @@ -68,7 +68,7 @@ public void generateImages() CachedCaptcha.generated = true; executor.shutdownNow(); System.gc(); - BungeeCord.getInstance().getLogger().log( Level.INFO, "[BotFilter] Капча сгенерированна за {0} мс", System.currentTimeMillis() - start ); + BungeeCord.getInstance().getLogger().log( Level.INFO, "[BotFilter] Captcha was generated in {0} ms", System.currentTimeMillis() - start ); } diff --git a/proxy/src/main/java/ru/leymooo/botfilter/config/Settings.java b/proxy/src/main/java/ru/leymooo/botfilter/config/Settings.java index a2a4b0b9ac..bc36d05cc3 100644 --- a/proxy/src/main/java/ru/leymooo/botfilter/config/Settings.java +++ b/proxy/src/main/java/ru/leymooo/botfilter/config/Settings.java @@ -13,7 +13,7 @@ public class Settings extends Config @Comment( { - "Все ошибки, баги, предложения и прочее просьба писать на гитхабе " + "Please submit all errors, bugs, suggestions and other requests on github " }) @Final public final String ISSUES = "https://github.com/Leymooo/BungeeCord/issues"; @@ -38,23 +38,23 @@ public class Settings extends Config public SQL SQL; @Comment( { - "Сколько игроков/ботов должно зайти за 1 минуту, чтобы включилась защита", - "Рекомендуемые параметры когда нет рекламы: ", - "До 150 онлайна - 25, до 250 - 30, до 350 - 35, до 550 - 40,45, выше - подстраивать под себя ", - "Во время рекламы или когда токо, токо поставили защиту рекомендуется повышать эти значения" + "How many players / bots should join in a minute, to enable the protection", + "Recommended settings without advertising: ", + "Under 150 players - 25, under 250 - 30, under 350 - 35, under 550 - 40,45, higher - adjust for yourself ", + "During advertising or when just-just setted up the protection, it is recommended to set high these valu. es" }) public int PROTECTION_THRESHOLD = 30; - @Comment("Как долго активна автоматическая защита? В миллисекундах. 1 сек = 1000") + @Comment("How long is automatic protection active? In milliseconds. 1 second = 1000") public int PROTECTION_TIME = 120000; - @Comment("Проверять ли на бота при заходе на сервер во время бот атаки, не зависимо проходил ли проверку или нет") + @Comment("Whether to force check the bot when joining the server during a bot attack, no matter whether the check is passed or not") public boolean FORCE_CHECK_ON_ATTACK = true; - @Comment("Показывать ли онлайн с фильтра") + @Comment("Should we show the player count from the filter?") public boolean SHOW_ONLINE = true; - @Comment("Сколько времени есть у игрока чтобы пройти защиту. В миллисекундах. 1 сек = 1000") + @Comment("How much time does the player have to pass the verification. In milliseconds. 1 second = 1000") public int TIME_OUT = 12700; - @Comment("Включить ли фикс от 'Team 'xxx' already exist in this scoreboard'") + @Comment("Enable fix for 'Team 'xxx' already exist in this scoreboard'") public boolean FIX_SCOREBOARD_TEAMS = true; - @Comment("Записывать ли IP адреса игроков/ботов которые провалили проверку в файл?") + @Comment("Should the IP addresses of the players / bots who failed the verification be logged to a file?") public boolean SAVE_FAILED_IPS_TO_FILE = true; public void reload(File file) @@ -63,117 +63,117 @@ public void reload(File file) save( file ); } - @Comment("Не используйте '\\n', используйте %nl%") + @Comment("Please don't use '\\n', use %nl%") public static class MESSAGES { public String PREFIX = "&b&lBot&d&lFilter"; - public String CHECKING = "%prefix%&7>> &aОжидайте завершения проверки..."; - public String CHECKING_CAPTCHA = "%prefix%&7>> &aВведите номер с картинки в чат"; - public String CHECKING_CAPTCHA_WRONG = "%prefix%&7>> &cВы ввели капчу неправильно, пожалуйста попробуйте ещё раз. У вас &a%s &c%s"; - public String SUCCESSFULLY = "%prefix%&7>> &aПроверка пройдена, приятной игры"; - public String KICK_MANY_CHECKS = "%prefix%%nl%%nl%&cС вашего айпи замечена подозрительная активность%nl%%nl%&6Повторите попытку через 10 минут"; - public String KICK_NOT_PLAYER = "%prefix%%nl%%nl%&cВы не прошли проверку, возможно вы бот%nl%&7&oЕсли это не так, пожалуйста повторите попытку"; - public String KICK_COUNTRY = "%prefix%%nl%%nl%&cВаша страна запрещена на серверве"; - public String KICK_BIG_PING = "%prefix%%nl%%nl%&cУ вас очень высокий пинг, скорее всего вы бот"; + public String CHECKING = "%prefix%&7>> &aPlease wait for verification to complete..."; + public String CHECKING_CAPTCHA = "%prefix%&7>> &aEnter the number from the image into the chat"; + public String CHECKING_CAPTCHA_WRONG = "%prefix%&7>> &cYou entered the captcha incorrectly, please try again. You have &a%s &c%s"; + public String SUCCESSFULLY = "%prefix%&7>> &aVerification passed"; + public String KICK_MANY_CHECKS = "%prefix%%nl%%nl%&cWe have detected suspicious activity from your ip address%nl%%nl%&6Please try again in 10 minutes"; + public String KICK_NOT_PLAYER = "%prefix%%nl%%nl%&You did not pass the verification, maybe you are a bot%nl%&7&oIf that is not so, please try again"; + public String KICK_COUNTRY = "%prefix%%nl%%nl%&cYour country is banned from the server"; + public String KICK_BIG_PING = "%prefix%%nl%%nl%&cYour ping is very high, most likely you are a bot"; @Comment( { - "Title%nl%Subtitle", "Оставьте пустым, чтобы отключить( прм: CHECKING_TITLE = \"\" )", - "Отключение титлов может немного улучшить производительность" + "Title%nl%Subtitle", "You can leave blank to disable the title (ex: CHECKING_TITLE = \"\") ", + "Disabling titles may slightly improve performance" }) - public String CHECKING_TITLE = "&r&lBot&b&lFilter%nl%&aИдёт проверка"; - public String CHECKING_TITLE_SUS = "&rПроверка пройдена%nl%&aПриятной игры"; - public String CHECKING_TITLE_CAPTCHA = " %nl%&rВведите капчу в чат!"; + public String CHECKING_TITLE = "&r&lBot&b&lFilter%nl%&aChecking..."; + public String CHECKING_TITLE_SUS = "&rVerification passed%nl%&aHave a good game"; + public String CHECKING_TITLE_CAPTCHA = " %nl%&rEnter the captcha into the chat!"; } - @Comment("Включить или отключить GeoIp") + @Comment("Enable or disable GeoIp") public static class GEO_IP { @Comment( { - "Когда работает проверка", - "0 - Всегда", - "1 - Только во время бот атаки", - "2 - Отключить" + "When does the check works", + "0 - Always", + "1 - Only during bot attacks", + "2 - Disable" }) public int MODE = 1; @Comment( { - "Как именно работает GeoIp", - "0 - White list(Зайти могут только те страны, которые есть в списке)", - "1 - Black list(Зайти могут только те страны, которых нет в списке)" + "How exactly does GeoIp work", + "0 - White list(Only those countries that are on the list can join)", + "1 - Black list(Only countries that are not on the list can join)" }) public int TYPE = 0; @Comment( { - "Откуда качать GEOIP", - "Меняйте ссылку если по какой-то причине не качается по этой", - "Файл должен заканчиваться на .mmdb или быть запакован в .tar.gz" + "Where to download GEOIP from", + "Change the link if for some reason it doesn't download from this one", + "The file must end in .mmdb or be packed into .tar.gz" }) public String NEW_GEOIP_DOWNLOAD_URL = "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country&license_key=%license_key%&suffix=tar.gz"; @Comment( { - "Если ключ перестанет работать, то для того чтобы получить новый необходимо зарегестироваться на https://www.maxmind.com/", - "и сгенерировать новый ключ на странице https://www.maxmind.com/en/accounts/current/license-key" + "If the key stops working, you need to register at https://www.maxmind.com/", + "and generate a new key here https://www.maxmind.com/en/accounts/current/license-key" }) public String MAXMIND_LICENSE_KEY = "P5g0fVdAQIq8yQau"; @Comment("Разрешённые странны") public List ALLOWED_COUNTRIES = Arrays.asList( "RU", "UA", "BY", "KZ", "EE", "MD", "KG", "AZ", "LT", "LV", "GE", "PL" ); } - @Comment("Включить или отключить проверку на высокий пинг") + @Comment("Enable or disable high ping check") public static class PING_CHECK { @Comment( { - "Когда работает проверка", - "0 - Всегда", - "1 - Только во время бот атаки", - "2 - Отключить" + "When does the check works", + "0 - Always", + "1 - Only during bot attacks", + "2 - Disable" }) public int MODE = 1; - @Comment("Максимальный допустимый пинг") + @Comment("Maximum allowed ping") public int MAX_PING = 350; } - @Comment("Включить или отключить проверку на прямое подключение") + @Comment("Enable or disable Direct Connect check") public static class SERVER_PING_CHECK { @Comment( { - "Когда работает проверка", - "0 - Всегда", - "1 - Только во время бот атаки", - "2 - Отключить", - "По умолчанию отключено, по скольку работает не очень стабильно, во время сильных атак" + "When the check works", + "0 - Always", + "1 - Only during bot attacks", + "2 - Disable", + "Disabled by default, because it is very unstable against strong attacks" }) public int MODE = 2; - @Comment("В течении какого времени можно заходить на сервер после получения мотд сервера") + @Comment("When is it allowed to join the server after receiving server's motd") public int CACHE_TIME = 12; public List KICK_MESSAGE = new ArrayList() { { add( "%nl%" ); add( "%nl%" ); - add( "&cВы были кикнуты! Не используйте прямое подключение" ); + add( "&cYou've been kicked! Please don't use direct connection" ); add( "%nl%" ); add( "%nl%" ); - add( "&bДля того чтобы зайти на сервер:" ); + add( "&bTo join the server:" ); add( "%nl%" ); - add( "&71) &rДобавте сервер в &lсписок серверов." ); + add( "&71) &rAdd the server to the &lserver list." ); add( "%nl%" ); - add( "&lНаш айпи &8>> &b&lIP" ); + add( "&lOur IP &8>> &b&lIP" ); add( "%nl%" ); add( "%nl%" ); - add( "&72) &rОбновите список серверов. " ); + add( "&72) &rRefresh the server list. " ); add( "%nl%" ); - add( "&oЧтобы его обновить нажмите кнопку &c&lОбновить &r&oили &c&lRefresh" ); + add( "&oTo refresh it, click the &c&lRefresh&r button" ); add( "%nl%" ); add( "%nl%" ); - add( "&73) &rПодождите &c1-3&r секунды и заходите!" ); + add( "&73) &rWait &c1-3&r seconds and join the server!" ); } }; @@ -181,33 +181,33 @@ public static class SERVER_PING_CHECK @Comment( { - "Настройка как именно будет работать защита", - "0 - Только проверка с помошью капчи", - "1 - Проверка на падение + капча", - "2 - Проверка на падение, если провалилась, то капча" + "Setting up exactly how the protection will work", + "0 - Only check with captcha", + "1 - Fall check + captcha", + "2 - Fall check, if it failed, then captcha" }) public static class PROTECTION { - @Comment("Режим работы пока нет атаки") + @Comment("Operation mode while there is no attack") public int NORMAL = 2; - @Comment("Режим работы во время атаки") + @Comment("Operation mode during the attack") public int ON_ATTACK = 1; @Comment( { - "Включить ли постоянную проверку игроков при заходе?", - "Включая эту функци, не забудьте увелечить лимиты у protection-threshold" + "Enable constant checking of the players?", + "When enabling this feature, don't forget to set the protection-threshold value higher" }) public boolean ALWAYS_CHECK = false; @Comment( { - "Проверять ли игроков у которых ип 127.0.0.1?", "Может быть полезным при использовании Geyser", - "0 - проверять", "1 - отключить проверку", "2 - проверять при каждом заходе" + "Check players with ip 127.0.0.1?", "May be useful when using Geyser", + "0 - check", "1 - don't check", "2 - check every time" }) public int CHECK_LOCALHOST = 0; - @Comment("Отключить ли проверку для клиентов с Geyser-standalone? Тип авторищации должен быть floodgate.") + @Comment("Disable check for Geyser-standalone clients? auth-type must be set to floodgate") public boolean SKIP_GEYSER = false; /* @Comment( @@ -222,33 +222,33 @@ public static class PROTECTION */ } - @Comment("Настройка датабазы") + @Comment("Database configuration") public static class SQL { - @Comment("Тип датабазы. sqlite или mysql") + @Comment("Database type. sqlite or mysql") public String STORAGE_TYPE = "sqlite"; - @Comment("Через сколько дней удалять игроков из датабазы, которые прошли проверку и больше не заходили. 0 или меньше чтобы отключить") + @Comment("After how many days, remove players from the database who have passed the verification and never logged in again. 0 or less to disable it") public int PURGE_TIME = 14; - @Comment("Настройки для mysql") + @Comment("Mysql configuration") public String HOSTNAME = "127.0.0.1"; public int PORT = 3306; public String USER = "user"; public String PASSWORD = "password"; public String DATABASE = "database"; - @Comment("Интервал в милисекундах, как часто синхронизировать базу данных если используется мультибанжа") + @Comment("Interval in millieseconds. How often it will synchronize data bases if multibungee is used.") public int SYNC_INTERVAL = -1; } - @Comment("Настройка виртуального мира") + @Comment("Virtual world settings") public static class DIMENSIONS { @Comment( { - "Какой мир использовать", - "0 - Обычный мир", - "1 - Ад", - "2 - Энд" + "Which world to use", + "0 - Standard world", + "1 - Nether", + "2 - End" }) public int TYPE = 0; } diff --git a/proxy/src/main/java/ru/leymooo/botfilter/utils/FakeOnlineUtils.java b/proxy/src/main/java/ru/leymooo/botfilter/utils/FakeOnlineUtils.java index 56c346bd97..9f174b9928 100644 --- a/proxy/src/main/java/ru/leymooo/botfilter/utils/FakeOnlineUtils.java +++ b/proxy/src/main/java/ru/leymooo/botfilter/utils/FakeOnlineUtils.java @@ -28,7 +28,7 @@ public FakeOnlineUtils() multiple = Float.parseFloat( boost ); } catch ( NumberFormatException e ) { - BungeeCord.getInstance().getLogger().log( Level.WARNING, "[BotFilter] Не могу активировать фейк онлайн: {0}", e.getMessage() ); + BungeeCord.getInstance().getLogger().log( Level.WARNING, "[BotFilter] Can't enable fake online: {0}", e.getMessage() ); return; } enabled = true; diff --git a/proxy/src/main/java/ru/leymooo/botfilter/utils/GeoIp.java b/proxy/src/main/java/ru/leymooo/botfilter/utils/GeoIp.java index af38d4bcf5..1668343bc2 100644 --- a/proxy/src/main/java/ru/leymooo/botfilter/utils/GeoIp.java +++ b/proxy/src/main/java/ru/leymooo/botfilter/utils/GeoIp.java @@ -104,7 +104,7 @@ private void setupDataBase(boolean startup) reader = new DatabaseReader.Builder( file ).withCache( new CHMCache( 4096 * 4 ) ).build(); } catch ( IOException ex ) { - LOGGER.log( Level.WARNING, "[BotFilter] На могу подключиться к GeoLite2 датабазе. Перекачиваю", ex ); + LOGGER.log( Level.WARNING, "[BotFilter] Cannot connect to GeoLite2 database. Redownloading...", ex ); file.delete(); setupDataBase( true ); } @@ -113,7 +113,7 @@ private void setupDataBase(boolean startup) private void downloadDataBase(final File out) { - LOGGER.log( Level.INFO, "[BotFilter] Скачиваю GeoLite2 датабазу" ); + LOGGER.log( Level.INFO, "[BotFilter] Downloading GeoLite2 database..." ); long start = System.currentTimeMillis(); try { @@ -151,10 +151,10 @@ private void downloadDataBase(final File out) { setupDataBase( false ); } - LOGGER.log( Level.WARNING, "[BotFilter] Не могу скачать GeoLite2 датабазу", ex ); + LOGGER.log( Level.WARNING, "[BotFilter] Can't download GeoLite2 database", ex ); return; } - LOGGER.log( Level.INFO, "[BotFilter] GeoLite2 загружена ({0}мс)", System.currentTimeMillis() - start ); + LOGGER.log( Level.INFO, "[BotFilter] GeoLite2 database loaded ({0}ms)", System.currentTimeMillis() - start ); } private void saveToFile(InputStream stream, File out) throws IOException @@ -169,7 +169,7 @@ private void saveToFile(InputStream stream, File out) throws IOException { fis.close(); out.delete(); - LOGGER.log( Level.WARNING, "[BotFilter] Не удалось скачать GeoLite2 датабазу. Удаляю недокачанный файл." ); + LOGGER.log( Level.WARNING, "[BotFilter] Unable to download GeoLite2 database. Removing temp file..." ); return; } fis.write( buffer, 0, count ); diff --git a/proxy/src/main/java/ru/leymooo/botfilter/utils/Sql.java b/proxy/src/main/java/ru/leymooo/botfilter/utils/Sql.java index 757d7bab84..786bd5a737 100644 --- a/proxy/src/main/java/ru/leymooo/botfilter/utils/Sql.java +++ b/proxy/src/main/java/ru/leymooo/botfilter/utils/Sql.java @@ -57,7 +57,7 @@ private void setupConnect() return; } this.connection = null; - logger.info( "[BotFilter] Подключаюсь к базе данных..." ); + logger.info( "[BotFilter] Connecting to the database..." ); long start = System.currentTimeMillis(); if ( Settings.IMP.SQL.STORAGE_TYPE.equalsIgnoreCase( "mysql" ) ) { @@ -68,7 +68,7 @@ private void setupConnect() Class.forName( "org.sqlite.JDBC" ); connectToDatabase( "JDBC:sqlite:BotFilter/database.db", null, null ); } - logger.log( Level.INFO, "[BotFilter] Подключено ({0} мс)", System.currentTimeMillis() - start ); + logger.log( Level.INFO, "[BotFilter] Database connected ({0} ms)", System.currentTimeMillis() - start ); createTable(); alterLastJoinColumn(); clearOldUsers(); @@ -124,7 +124,7 @@ private void alterLastJoinColumn() } } catch ( Exception e ) { - logger.log( Level.WARNING, "[BotFilter] Ошибка при добавлении столбца в таблицу", e ); + logger.log( Level.WARNING, "[BotFilter] Error has occurred with adding a column to the table", e ); } } @@ -139,12 +139,12 @@ private void clearOldUsers() throws SQLException long until = calendar.getTimeInMillis(); int before = botFilter.getUsersCount(); botFilter.getUserCache().entrySet().removeIf( (entry) -> entry.getValue().getLastJoin() < until ); - logger.log( Level.INFO, "[BotFilter] Удалено {0} аккаунтов из памяти", before - botFilter.getUsersCount() ); + logger.log( Level.INFO, "[BotFilter] Removed {0} accounts from memory", before - botFilter.getUsersCount() ); if ( this.connection != null ) { try ( PreparedStatement statement = connection.prepareStatement( "DELETE FROM `Users` WHERE `LastJoin` < " + until + ";" ) ) { - logger.log( Level.INFO, "[BotFilter] Удалено {0} аккаунтов из датабазы", statement.executeUpdate() ); + logger.log( Level.INFO, "[BotFilter] Removed {0} accounts from the database", statement.executeUpdate() ); } } } @@ -186,11 +186,11 @@ private void syncUsers() botFilter.addUserToCache( botFilterUser ); i++; } - logger.log( Level.INFO, "[BotFilter] Синхронизировано ({0}) новых проверок", i ); + logger.log( Level.INFO, "[BotFilter] Synchronized ({0}) new checks", i ); lastSync = curr; } catch ( Exception e ) { - logger.log( Level.WARNING, "[BotFilter] Не удалось синхронизировать проверки", e ); + logger.log( Level.WARNING, "[BotFilter] Check synchronization failed", e ); setupConnect(); } } @@ -216,7 +216,7 @@ private void loadUsers() throws SQLException botFilter.addUserToCache( botFilterUser ); i++; } - logger.log( Level.INFO, "[BotFilter] Белый список игроков успешно загружен ({0})", i ); + logger.log( Level.INFO, "[BotFilter] Player whitelist loaded successfully ({0})", i ); } } @@ -270,7 +270,7 @@ public void saveUser(BotFilterUser botFilterUser) } } catch ( SQLException ex ) { - logger.log( Level.WARNING, "[BotFilter] Не могу выполнить запрос к базе данных", ex ); + logger.log( Level.WARNING, "[BotFilter] Can't query the database", ex ); logger.log( Level.WARNING, sql ); setupConnect(); } @@ -288,7 +288,7 @@ public void tryCleanUP() } catch ( SQLException ex ) { setupConnect(); - logger.log( Level.WARNING, "[BotFilter] Не могу очистить пользователей", ex ); + logger.log( Level.WARNING, "[BotFilter] Can't clear user list", ex ); } } diff --git a/proxy/src/main/resources/messages.properties b/proxy/src/main/resources/messages.properties index e19ff964d2..231dd866ea 100644 --- a/proxy/src/main/resources/messages.properties +++ b/proxy/src/main/resources/messages.properties @@ -1,43 +1,42 @@ -alert=\u00A78[\u00A74\u041E\u0431\u044A\u044F\u0432\u043B\u0435\u043D\u0438\u0435\u00A78]\u00A7r -already_connected=\u00A7c\u0412\u044B \u0443\u0436\u0435 \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u044B \u043A \u044D\u0442\u043E\u043C\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0432\u0443! -already_connected_proxy=\u00A7c\u0418\u0433\u0440\u043E\u043A \u0441 \u0442\u0430\u043A\u0438\u043C-\u0436\u0435 \u043D\u0438\u043A\u043E\u043C \u0443\u0436\u0435 \u0438\u0433\u0440\u0430\u0435\u0442 \u043D\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435! -already_connecting=\u00A7a\u041F\u043E\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435... -command_list=\u00A7a[{0}] \u00A7e({1}): \u00A7r{2} -connect_kick=\u00A7c\u0412\u044B \u0431\u044B\u043B\u0438 \u043A\u0438\u043A\u043D\u0443\u0442\u044B \u043F\u0440\u0438 \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0438 \u043A \u0441\u0435\u0440\u0432\u0435\u0440\u0443 {0}: {1} -current_server=\u00A76\u0412\u044B \u0443\u0436\u0435 \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u044B \u043A \u0441\u0435\u0440\u0432\u0435\u0440\u0443 {0}. -fallback_kick=\u00A7c\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0412\u0430\u0441 \u043A \u043E\u0441\u043D\u043E\u0432\u043D\u043E\u043C\u0443 \u0438\u043B\u0438 \u0437\u0430\u043F\u0430\u0441\u043D\u043E\u043C\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0443. \u0412\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u043D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u043E \u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043D \u0430\u0434\u0440\u0435\u0441/\u043F\u043E\u0440\u0442/\u0431\u0440\u0430\u043D\u0434\u043C\u0430\u0443\u044D\u0440? {0} -fallback_lobby=\u00A7c\u041D\u0435 \u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u044C\u0441\u044F \u043D\u0430 \u044D\u0442\u043E\u0442 \u0441\u0435\u0440\u0432\u0435\u0440, \u0432\u044B \u0431\u044B\u043B\u0438 \u043F\u0435\u0440\u0435\u043C\u0435\u0449\u0435\u043D\u044B \u043D\u0430 \u0437\u0430\u043F\u0430\u0441\u043D\u043E\u0439 \u0441\u0435\u0440\u0432\u0435\u0440. -lost_connection=\u00A7c[Proxy] \u041F\u043E\u0442\u0435\u0440\u044F\u043D\u043E \u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043E\u043C. -mojang_fail=\u00A7c\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u044C\u0441\u044F \u043A \u0441\u0435\u0440\u0432\u0435\u0440\u0443 Mojang, \u043F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435 \u043F\u043E\u043F\u044B\u0442\u043A\u0443 \u0447\u0443\u0442\u044C \u043F\u043E\u0437\u0436\u0435! -no_permission=\u00A7c\u0412\u044B \u043D\u0435 \u043C\u043E\u0436\u0435\u0442\u0435 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u044D\u0442\u0443 \u043A\u043E\u043C\u0430\u043D\u0434\u0443! -no_server=\u00A7c\u0423\u043A\u0430\u0437\u0430\u043D\u043D\u043E\u0433\u043E \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442. -no_server_permission=\u00A7c\u0412\u044B \u043D\u0435 \u043C\u043E\u0436\u0435\u0442\u0435 \u0437\u0430\u0439\u0442\u0438 \u043D\u0430 \u044D\u0442\u043E\u0442 \u0441\u0435\u0440\u0432\u0435\u0440. -outdated_client=\u00A7c\u0421\u0435\u0440\u0432\u0435\u0440 \u0440\u0430\u0431\u043E\u0442\u0430\u0435\u0442 \u043D\u0430 \u0432\u0435\u0440\u0441\u0438\u0438 \u00A7a{0} -outdated_server=\u00A7c\u0421\u0435\u0440\u0432\u0435\u0440 \u0440\u0430\u0431\u043E\u0442\u0430\u0435\u0442 \u043D\u0430 \u0432\u0435\u0440\u0441\u0438\u0438 \u00A7a{0} -proxy_full=\u00A7c\u0421\u0435\u0440\u0432\u0435\u0440 \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D! -restart=\u00A7a\u0421\u0435\u0440\u0432\u0435\u0440 \u043F\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044F.... -server_list=\u00A76\u0414\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430: -server_went_down=\u00A7c\u0421\u0435\u0440\u0432\u0435\u0440, \u043D\u0430 \u043A\u043E\u0442\u043E\u0440\u043E\u043C \u0412\u044B \u0438\u0433\u0440\u0430\u043B\u0438, \u0432\u044B\u043A\u043B\u044E\u0447\u0438\u043B\u0441\u044F, \u0412\u044B \u0431\u044B\u043B\u0438 \u043F\u0435\u0440\u0435\u043C\u0435\u0449\u0435\u043D\u044B \u0432 \u043B\u043E\u0431\u0431\u0438. -total_players=\u00A7a\u0418\u0433\u0440\u043E\u043A\u043E\u0432 \u043E\u043D\u043B\u0430\u0439\u043D: \u00A7b{0} -name_too_long=\u00A7c\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0430\u044F \u0434\u043B\u0438\u043D\u0430 \u043D\u0438\u043A\u0430 16 \u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432 -name_invalid=\u00A7c\u0412 \u0432\u0430\u0448\u0435\u043C \u043D\u0438\u043A\u0435 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044F \u043D\u0435 \u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u044B\u0435 \u0441\u0438\u043C\u0432\u043E\u043B\u044B. -ping_cannot_connect=\u00A7c\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u044C\u0441\u044F \u043A \u0441\u0435\u0440\u0432\u0435\u0440\u0443. \u0421\u043E\u043E\u0431\u0449\u0438\u0442\u0435 \u0430\u0434\u043C\u0438\u043D\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438. -offline_mode_player=\u00A7c\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 \u043B\u0438\u0446\u0435\u043D\u0437\u0438\u043E\u043D\u043D\u044B\u0439 \u0430\u043A\u043A\u0430\u0443\u043D\u0442, \u0447\u0442\u043E\u0431\u044B \u0437\u0430\u0439\u0442\u0438 \u043D\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 -message_needed=\u00A7c\u0412\u044B \u0434\u043E\u043B\u0436\u043D\u044B \u0443\u043A\u0430\u0437\u0430\u0442\u044C \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435. -error_occurred_player=\u00A7c\u041F\u0440\u043E\u0438\u0437\u043E\u0448\u043B\u0430 \u043E\u0448\u0438\u0431\u043A\u0438 \u043F\u0440\u0438 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0435 \u0432\u0430\u0448\u0435\u0433\u043E \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F. (\u041D\u0430\u0432\u0435\u0434\u0438\u0442\u0435 \u0434\u043B\u044F \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u0438) -error_occurred_console=\u00A7c\u041F\u0440\u043E\u0438\u0437\u043E\u0448\u043B\u0430 \u043E\u0448\u0438\u0431\u043A\u0438 \u043F\u0440\u0438 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0435 \u0432\u0430\u0448\u0435\u0433\u043E \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F: {0} -click_to_connect=\u00A7a\u041D\u0430\u0436\u043C\u0438\u0442\u0435 \u0447\u0442\u043E\u0431\u044B \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u044C\u0441\u044F \u043D\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 -username_needed=\u00A7c\u041F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430 \u0443\u043A\u0430\u0436\u0438\u0442\u0435 \u0438\u043C\u044F \u0438\u0433\u0440\u043E\u043A\u0430. -user_not_online=\u00A7c\u0414\u0430\u043D\u043D\u044B\u0439 \u0438\u0433\u0440\u043E\u043A \u043D\u0435 \u043E\u043D\u043B\u0430\u0439\u043D. -user_online_at=\u00A7r\u0418\u0433\u0440\u043E\u043A \u00A7a{0} \u00A7r\u0438\u0433\u0440\u0430\u0435\u0442 \u043D\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u00A7a{1} -send_cmd_usage=\u00A7c\u041D\u0435\u0434\u043E\u0441\u0442\u0430\u0442\u043E\u0447\u043D\u043E \u0430\u0440\u0433\u0443\u043C\u0435\u043D\u0442\u043E\u0432 \u0432 \u043A\u043E\u043C\u0430\u043D\u0434\u0435, \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435: /send -player_only=\u00A7c\u0422\u043E\u043B\u044C\u043A\u043E \u0438\u0433\u0440\u043E\u043A\u0438 \u043C\u043E\u0433\u0443\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u044D\u0442\u0443 \u043A\u043E\u043C\u0430\u043D\u0434\u0443 -you_got_summoned=\u00A76\u0412\u044B \u0431\u044B\u043B\u0438 \u043F\u0435\u0440\u0435\u043C\u0435\u0448\u0435\u043D\u044B \u043D\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u00A7a{0} \u00A76\u0438\u0433\u0440\u043E\u043A\u043E\u043C \u00A7a{1} -command_perms_groups=\u00A76\u0412\u0430\u0448\u0438 \u0442\u0435\u043A\u0443\u0449\u0438\u0435 \u0433\u0440\u0443\u043F\u043F\u044B:\u00A7a {0} -command_perms_permission=\u00A79- {0} -command_ip=\u00A79IP \u0438\u0433\u0440\u043E\u043A\u0430 \u00A7a{0}\u00A79: \u00A7a{1} -illegal_chat_characters=\u00a7cillegal characters in chat ({0}) -secure_profile_required=A secure profile is required to join this server. -secure_profile_expired=Secure profile expired. -secure_profile_invalid=Secure profile invalid. -kick_message=\u00a7cYou have been kicked off the proxy. +alert=\u00a78[\u00a74Alert\u00a78]\u00a7r +already_connected=\u00a7cYou are already connected to this server! +already_connected_proxy=\u00a7cYou are already connected to this proxy! +already_connecting=\u00a7cAlready connecting to this server! +command_list=\u00a7a[{0}] \u00a7e({1}): \u00a7r{2} +connect_kick=\u00a7cKicked whilst connecting to {0}: {1} +current_server=\u00a76You are currently connected to {0}. +fallback_kick=\u00a7cCould not connect to a default or fallback server. Incorrectly configured address/port/firewall? {0} +fallback_lobby=\u00a7cCould not connect to target server, you have been moved to a fallback server. +lost_connection=\u00a7cProxy lost connection to server. +mojang_fail=\u00a7cError occurred while contacting login servers, are they down? +no_permission=\u00a7cYou do not have permission to execute this command! +no_server=\u00a7cThe specified server does not exist. +no_server_permission=\u00a7cYou don''t have permission to access this server. +outdated_client=\u00a7cOutdated client! Please use {0} +outdated_server=\u00a7cOutdated server! I''m still on {0} +proxy_full=\u00a7cServer is full! +restart=\u00a7cThe proxy server is restarting +server_list=\u00a76You may connect to the following servers at this time: +server_went_down=\u00a7cThe server you were previously on went down, you have been connected to a fallback server +total_players=Total players online: {0} +name_invalid=\u00a7cUsername contains invalid characters. +ping_cannot_connect=\u00a7cCould not request status from target server. +offline_mode_player=\u00a7cNot authenticated with Minecraft.net +secure_profile_required=\u00a7cA secure profile is required to join this server. +secure_profile_expired=\u00a7cSecure profile expired. +secure_profile_invalid=\u00a7cSecure profile invalid. +message_needed=\u00a7cYou must supply a message. +error_occurred_player=\u00a7cAn error occurred while parsing your message. (Hover for details) +error_occurred_console=\u00a7cAn error occurred while parsing your message: {0} +click_to_connect=Click to connect to the server +username_needed=\u00a7cPlease follow this command by a username. +user_not_online=\u00a7cThat user is not online. +user_online_at=\u00a7a{0} \u00a7ris online at {1} +send_cmd_usage=\u00a7cNot enough arguments, usage: /send +player_only=\u00a7cOnly in game players can use this command +you_got_summoned=\u00a76Summoned to {0} by {1} +command_perms_groups=\u00a76You have the following groups: {0} +command_perms_permission=\u00a79- {0} +command_ip=\u00a79IP of {0} is {1} +illegal_chat_characters=\u00a7cIllegal characters in chat ({0}) +kick_message=\u00a7cYou have been kicked off the proxy. \ No newline at end of file From ff6d2f96def309cd859982e6cc2717343e55a6b5 Mon Sep 17 00:00:00 2001 From: Loyisa Date: Sun, 18 Dec 2022 20:00:20 +0800 Subject: [PATCH 2/7] Add an untranslated string --- .../main/java/ru/leymooo/botfilter/caching/PacketUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proxy/src/main/java/ru/leymooo/botfilter/caching/PacketUtils.java b/proxy/src/main/java/ru/leymooo/botfilter/caching/PacketUtils.java index b2642494db..35c6722949 100644 --- a/proxy/src/main/java/ru/leymooo/botfilter/caching/PacketUtils.java +++ b/proxy/src/main/java/ru/leymooo/botfilter/caching/PacketUtils.java @@ -135,8 +135,8 @@ public static void init() messages = new CachedMessage[] { - new CachedMessage( Settings.IMP.MESSAGES.CHECKING_CAPTCHA_WRONG.replaceFirst( "%s", "2" ).replaceFirst( "%s", "попытки" ) ), - new CachedMessage( Settings.IMP.MESSAGES.CHECKING_CAPTCHA_WRONG.replaceFirst( "%s", "1" ).replaceFirst( "%s", "попытка" ) ), + new CachedMessage( Settings.IMP.MESSAGES.CHECKING_CAPTCHA_WRONG.replaceFirst( "%s", "2" ).replaceFirst( "%s", "chances" ) ), + new CachedMessage( Settings.IMP.MESSAGES.CHECKING_CAPTCHA_WRONG.replaceFirst( "%s", "1" ).replaceFirst( "%s", "chances" ) ), new CachedMessage( Settings.IMP.MESSAGES.CHECKING ), new CachedMessage( Settings.IMP.MESSAGES.CHECKING_CAPTCHA ), new CachedMessage( Settings.IMP.MESSAGES.SUCCESSFULLY ) From 08dcf43d127181eebe121cd24f35c86aef26a6c6 Mon Sep 17 00:00:00 2001 From: Loyisa Date: Sun, 18 Dec 2022 20:46:42 +0800 Subject: [PATCH 3/7] fix KICK_NOT_PLAYER --- proxy/src/main/java/ru/leymooo/botfilter/config/Settings.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy/src/main/java/ru/leymooo/botfilter/config/Settings.java b/proxy/src/main/java/ru/leymooo/botfilter/config/Settings.java index bc36d05cc3..5d2d90cf17 100644 --- a/proxy/src/main/java/ru/leymooo/botfilter/config/Settings.java +++ b/proxy/src/main/java/ru/leymooo/botfilter/config/Settings.java @@ -73,7 +73,7 @@ public static class MESSAGES public String CHECKING_CAPTCHA_WRONG = "%prefix%&7>> &cYou entered the captcha incorrectly, please try again. You have &a%s &c%s"; public String SUCCESSFULLY = "%prefix%&7>> &aVerification passed"; public String KICK_MANY_CHECKS = "%prefix%%nl%%nl%&cWe have detected suspicious activity from your ip address%nl%%nl%&6Please try again in 10 minutes"; - public String KICK_NOT_PLAYER = "%prefix%%nl%%nl%&You did not pass the verification, maybe you are a bot%nl%&7&oIf that is not so, please try again"; + public String KICK_NOT_PLAYER = "%prefix%%nl%%nl%&cYou did not pass the verification, maybe you are a bot%nl%&7&oIf that is not so, please try again"; public String KICK_COUNTRY = "%prefix%%nl%%nl%&cYour country is banned from the server"; public String KICK_BIG_PING = "%prefix%%nl%%nl%&cYour ping is very high, most likely you are a bot"; @Comment( From 1414f8fad491cb3e150fd3c96ba1d2c9360c243a Mon Sep 17 00:00:00 2001 From: Loyisa Date: Sun, 18 Dec 2022 21:06:16 +0800 Subject: [PATCH 4/7] Update BungeeCordLauncher.java --- proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java index 7b866b8114..81fce0c9c8 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java @@ -45,7 +45,7 @@ public static void main(String[] args) throws Exception BungeeCord bungee = new BungeeCord(); ProxyServer.setInstance( bungee ); - bungee.getLogger().log( Level.WARNING, "Включаю BungeeCord BotFilter {0} от vk.com/Leymooo_s (http://rubukkit.org/threads/137038)", bungee.getGameVersion() ); //BotFilter + bungee.getLogger().log( Level.WARNING, "Enabled BungeeCord BotFilter-ENG {0} from https://github.com/LoyisaSUS/BungeeCord-BotFilter-ENG", bungee.getGameVersion() ); //BotFilter bungee.start(); if ( !options.has( "noconsole" ) ) @@ -55,7 +55,7 @@ public static void main(String[] args) throws Exception { if ( !bungee.getPluginManager().dispatchCommand( ConsoleCommandSender.getInstance(), line ) ) { - bungee.getConsole().sendMessage( new ComponentBuilder( "Команда не найдена :(" ).color( ChatColor.RED ).create() ); //BotFilter + bungee.getConsole().sendMessage( new ComponentBuilder( "Command not found" ).color( ChatColor.RED ).create() ); //BotFilter } } } From 0b18f33fa376b4aff20964316f6dc52870eea891 Mon Sep 17 00:00:00 2001 From: Loyisa Date: Sun, 18 Dec 2022 21:18:10 +0800 Subject: [PATCH 5/7] Add untranslated strings --- proxy/src/main/java/ru/leymooo/botfilter/BotFilter.java | 2 +- proxy/src/main/java/ru/leymooo/botfilter/config/Config.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/proxy/src/main/java/ru/leymooo/botfilter/BotFilter.java b/proxy/src/main/java/ru/leymooo/botfilter/BotFilter.java index a29e08e0bb..f0f9a4d222 100644 --- a/proxy/src/main/java/ru/leymooo/botfilter/BotFilter.java +++ b/proxy/src/main/java/ru/leymooo/botfilter/BotFilter.java @@ -103,7 +103,7 @@ public void disable() { if ( connector.getUserConnection() != null ) { - connector.getUserConnection().disconnect( "§c[BotFilter] §aПерезагрузка фильтра" ); + connector.getUserConnection().disconnect( "§c[BotFilter] §aFilter reloading..." ); } connector.setState( CheckState.FAILED ); } diff --git a/proxy/src/main/java/ru/leymooo/botfilter/config/Config.java b/proxy/src/main/java/ru/leymooo/botfilter/config/Config.java index 2fc00efe5a..725b1b3214 100644 --- a/proxy/src/main/java/ru/leymooo/botfilter/config/Config.java +++ b/proxy/src/main/java/ru/leymooo/botfilter/config/Config.java @@ -93,7 +93,7 @@ public boolean load(File file) } } catch ( IOException ex ) { - BungeeCord.getInstance().getLogger().log( Level.WARNING, "[BotFilter] Не могу загрузить конфиг ", ex ); + BungeeCord.getInstance().getLogger().log( Level.WARNING, "[BotFilter] Can't load the config ", ex ); return false; } set( yml, "" ); From ff2d5dfd27a5ac8450255fac4eb56fe6bcf913fa Mon Sep 17 00:00:00 2001 From: Loyisa Date: Mon, 19 Dec 2022 00:35:16 +0800 Subject: [PATCH 6/7] fix update checker --- proxy/src/main/java/ru/leymooo/botfilter/BotFilter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy/src/main/java/ru/leymooo/botfilter/BotFilter.java b/proxy/src/main/java/ru/leymooo/botfilter/BotFilter.java index f0f9a4d222..6e292f37d0 100644 --- a/proxy/src/main/java/ru/leymooo/botfilter/BotFilter.java +++ b/proxy/src/main/java/ru/leymooo/botfilter/BotFilter.java @@ -415,7 +415,7 @@ private void checkForUpdates(boolean startup) try { logger.log( Level.INFO, "[BotFilter] Checking for updates..." ); - URL url = new URL( "https://raw.githubusercontent.com/LoyisaSUS/BungeeCord/master/version.txt" ); + URL url = new URL( "https://raw.githubusercontent.com/LoyisaSUS/BungeeCord-BotFilter-ENG/master/version.txt" ); URLConnection conn = url.openConnection(); conn.setConnectTimeout( 1200 ); conn.setReadTimeout( 1200 ); From d812735d72b960941a1a89750a0fd55bfe576b86 Mon Sep 17 00:00:00 2001 From: Loyisa Date: Mon, 19 Dec 2022 15:54:48 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E6=B8=A3=E7=BF=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 20 +-- .../net/md_5/bungee/BungeeCordLauncher.java | 2 +- .../java/ru/leymooo/botfilter/BotFilter.java | 22 +-- .../leymooo/botfilter/BotFilterCommand.java | 23 +-- .../ru/leymooo/botfilter/BotFilterThread.java | 4 +- .../java/ru/leymooo/botfilter/Connector.java | 24 +-- .../botfilter/caching/PacketUtils.java | 8 +- .../botfilter/captcha/CaptchaGeneration.java | 6 +- .../ru/leymooo/botfilter/config/Settings.java | 160 +++++++++--------- .../leymooo/botfilter/utils/FailedUtils.java | 2 +- .../botfilter/utils/FakeOnlineUtils.java | 2 +- .../ru/leymooo/botfilter/utils/GeoIp.java | 12 +- .../java/ru/leymooo/botfilter/utils/Sql.java | 22 +-- 13 files changed, 154 insertions(+), 153 deletions(-) diff --git a/README.md b/README.md index 1720416b8c..67fe623e36 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,19 @@ -BungeeCord with built in AntiBot protection. (English lang) +BungeeCord, 但是内置反假人. (Simplified Chinese) ========== -Videos +视频演示 -------- -Captcha+Falling check: +验证码+重力检查: [![Only captcha](https://i.ytimg.com/vi/S27EbttIG-8/1.jpg)](https://youtu.be/S27EbttIG-8) -Falling check: +重力检查: [![Only captcha](https://i.ytimg.com/vi/23O16oJyvl8/1.jpg)](https://youtu.be/23O16oJyvl8) -Download +下载 -------- -You can download this protection at [Releases](https://github.com/LoyisaSUS/BungeeCord-BotFilter-ENG/releases/) +你可以在[Releases](https://github.com/LoyisaSUS/BungeeCord-BotFilter-ZHCN/releases/) 下载 -Credit +特别鸣谢 -------- -[Leymooo](https://github.com/Leymooo) (Original BotFilter developer)
-[koloslolya](https://github.com/SleepyKolosLolya) (Help me translate BotFilter)
-[Maxsimuss](https://github.com/Maxsimuss) (Help me translate BotFilter) \ No newline at end of file +[Leymooo](https://github.com/Leymooo) (BotFilter 开发者)
+[koloslolya](https://github.com/SleepyKolosLolya) (帮助了我翻译 BotFilter (俄->英))
+[Maxsimuss](https://github.com/Maxsimuss) (帮助了我翻译 BotFilter (俄->英))
\ No newline at end of file diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java index 81fce0c9c8..a247ac3a74 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java @@ -45,7 +45,7 @@ public static void main(String[] args) throws Exception BungeeCord bungee = new BungeeCord(); ProxyServer.setInstance( bungee ); - bungee.getLogger().log( Level.WARNING, "Enabled BungeeCord BotFilter-ENG {0} from https://github.com/LoyisaSUS/BungeeCord-BotFilter-ENG", bungee.getGameVersion() ); //BotFilter + bungee.getLogger().log( Level.WARNING, "Enabled BungeeCord BotFilter-ZHCN {0} from https://github.com/LoyisaSUS/BungeeCord-BotFilter-ZHCN", bungee.getGameVersion() ); //BotFilter bungee.start(); if ( !options.has( "noconsole" ) ) diff --git a/proxy/src/main/java/ru/leymooo/botfilter/BotFilter.java b/proxy/src/main/java/ru/leymooo/botfilter/BotFilter.java index 6e292f37d0..97612e1201 100644 --- a/proxy/src/main/java/ru/leymooo/botfilter/BotFilter.java +++ b/proxy/src/main/java/ru/leymooo/botfilter/BotFilter.java @@ -103,7 +103,7 @@ public void disable() { if ( connector.getUserConnection() != null ) { - connector.getUserConnection().disconnect( "§c[BotFilter] §aFilter reloading..." ); + connector.getUserConnection().disconnect( "§c[BotFilter] §a重载反假人模块中..." ); } connector.setState( CheckState.FAILED ); } @@ -351,7 +351,7 @@ public void checkAsyncIfNeeded(InitialHandler handler) if ( !Settings.IMP.PROTECTION.ALWAYS_CHECK && ManyChecksUtils.isManyChecks( address ) ) { PacketUtils.kickPlayer( KickType.MANYCHECKS, Protocol.LOGIN, ch, version ); - bungee.getLogger().log( Level.INFO, "(BF) [{0}] disconnected: Too many checks in 10 min", address ); + bungee.getLogger().log( Level.INFO, "(BF) [{0}] 已断开: 玩家在10分钟之内数次未通过验证", address ); return; } @@ -359,7 +359,7 @@ public void checkAsyncIfNeeded(InitialHandler handler) if ( ping.needCheck() && ping.needKickOrRemove( address ) ) { PacketUtils.kickPlayer( KickType.PING, Protocol.LOGIN, ch, version ); - bungee.getLogger().log( Level.INFO, "(BF) [{0}] disconnected: The player did not ping the server", address.getHostAddress() ); + bungee.getLogger().log( Level.INFO, "(BF) [{0}] 已断开: 玩家没有ping过服务器", address.getHostAddress() ); return; } @@ -377,7 +377,7 @@ public void checkAsyncIfNeeded(InitialHandler handler) if ( checkGeoIp( address ) ) { PacketUtils.kickPlayer( KickType.COUNTRY, Protocol.LOGIN, ch, version ); - bungee.getLogger().log( Level.INFO, "(BF) [{0}] disconnected: Country is not allowed", + bungee.getLogger().log( Level.INFO, "(BF) [{0}] 已断开: 不允许的国家", address.getHostAddress() ); return; } @@ -414,8 +414,8 @@ private void checkForUpdates(boolean startup) Logger logger = BungeeCord.getInstance().getLogger(); try { - logger.log( Level.INFO, "[BotFilter] Checking for updates..." ); - URL url = new URL( "https://raw.githubusercontent.com/LoyisaSUS/BungeeCord-BotFilter-ENG/master/version.txt" ); + logger.log( Level.INFO, "[BotFilter] 检查更新中..." ); + URL url = new URL( "https://raw.githubusercontent.com/LoyisaSUS/BungeeCord-BotFilter-ZHCN/master/version.txt" ); URLConnection conn = url.openConnection(); conn.setConnectTimeout( 1200 ); conn.setReadTimeout( 1200 ); @@ -425,21 +425,21 @@ private void checkForUpdates(boolean startup) if ( !in.readLine().trim().equalsIgnoreCase( Settings.IMP.BOT_FILTER_VERSION ) ) { - logger.log( Level.INFO, "§c[BotFilter] §aNew update available!" ); - logger.log( Level.INFO, "§c[BotFilter] §aPlease update to latest version!" ); - logger.log( Level.INFO, "§c[BotFilter] §ahttps://github.com/LoyisaSUS/BungeeCord-BotFilter-ENG/releases/" ); + logger.log( Level.INFO, "§c[BotFilter] §a有新的更新可用!" ); + logger.log( Level.INFO, "§c[BotFilter] §a请更新到最新版本!" ); + logger.log( Level.INFO, "§c[BotFilter] §ahttps://github.com/LoyisaSUS/BungeeCord-BotFilter-ZHCN/releases/" ); if ( startup ) { Thread.sleep( 3500L ); } } else { - logger.log( Level.INFO, "[BotFilter] You are using the latest version!" ); + logger.log( Level.INFO, "[BotFilter] 你正在使用最新的版本!" ); } } } catch ( IOException | InterruptedException ex ) { - logger.log( Level.WARNING, "[BotFilter] Can't check the update", ex ); + logger.log( Level.WARNING, "[BotFilter] 无法检查更新", ex ); } } diff --git a/proxy/src/main/java/ru/leymooo/botfilter/BotFilterCommand.java b/proxy/src/main/java/ru/leymooo/botfilter/BotFilterCommand.java index 351d49c63e..3c3376f863 100644 --- a/proxy/src/main/java/ru/leymooo/botfilter/BotFilterCommand.java +++ b/proxy/src/main/java/ru/leymooo/botfilter/BotFilterCommand.java @@ -35,30 +35,30 @@ public void execute(CommandSender sender, String[] args) if ( args.length == 0 ) { sender.sendMessage( "§r--------------- §bBotFilter §cv" + Settings.IMP.BOT_FILTER_VERSION + "§r-----------------" ); - sender.sendMessage( "§r> §lbotfilter reload §6- §aReload the configuration" ); - sender.sendMessage( "§r> §lbotfilter stat §6- §aShow statistics" ); - sender.sendMessage( "§r> §lbotfilter export §6- §aExport player list what passed the bot filter" ); - sender.sendMessage( "§r> §lbotfilter protection on/off §6- §aEnable or disable manual mode 'under attack'" ); + sender.sendMessage( "§r> §lbotfilter reload §6- §a重载配置文件" ); + sender.sendMessage( "§r> §lbotfilter stat §6- §a显示统计数据" ); + sender.sendMessage( "§r> §lbotfilter export §6- §a导出通过假人验证的玩家列表" ); + sender.sendMessage( "§r> §lbotfilter protection on/off §6- §a手动启用或禁用'受到攻击'模式" ); sender.sendMessage( "§r--------------- §bBotFilter §r-----------------" ); } else if ( args[0].equalsIgnoreCase( "reload" ) ) { BungeeCord.getInstance().getBotFilter().disable(); BungeeCord.getInstance().setBotFilter( new BotFilter( false ) ); - sender.sendMessage( "§aCommand executed" ); + sender.sendMessage( "§a指令已执行" ); } else if ( args[0].equalsIgnoreCase( "stat" ) || args[0].equalsIgnoreCase( "stats" ) || args[0].equalsIgnoreCase( "info" ) ) { sendStat( sender ); } else if ( args[0].equalsIgnoreCase( "export" ) ) { export( sender, args ); - sender.sendMessage( "§aCommand executed" ); + sender.sendMessage( "§a指令已执行" ); } else if ( args[0].equalsIgnoreCase( "protection" ) ) { if ( args.length >= 2 ) { boolean enable = args[1].equalsIgnoreCase( "on" ); BungeeCord.getInstance().getBotFilter().setForceProtectionEnabled( enable ); - sender.sendMessage( "§aProtection " + ( enable ? "enabled" : "§cdisabled" ) ); + sender.sendMessage( "§a保护已 " + ( enable ? "启用" : "§c禁用" ) ); } } } @@ -67,11 +67,12 @@ private void sendStat(CommandSender sender) { BotFilter botFilter = BungeeCord.getInstance().getBotFilter(); sender.sendMessage( "§r----------------- §bBotFilter §cv" + Settings.IMP.BOT_FILTER_VERSION + " §r-----------------" ); - sender.sendMessage( "§r> §lUnder attack: " + ( botFilter.isUnderAttack() ? "§cYes" : "§aNo" ) ); - sender.sendMessage( "§r> §lBots on checking: " + botFilter.getOnlineOnFilter() ); - sender.sendMessage( "§r> §lVerified player(s): " + botFilter.getUsersCount() ); + sender.sendMessage( "§r> §l受到攻击: " + ( botFilter.isUnderAttack() ? "§cYes" : "§aNo" ) ); + sender.sendMessage( "§r> §l验证中的玩家/假人: " + botFilter.getOnlineOnFilter() ); + sender.sendMessage( "§r> §l已通过验证的玩家: " + botFilter.getUsersCount() ); sender.sendMessage( "§r> §lDownload BotFilter(RUS): http://www.rubukkit.org/threads/137038/" ); - sender.sendMessage( "§r> §lDownload BotFilter(ENG): https://github.com/LoyisaSUS/BungeeCord/" ); + sender.sendMessage( "§r> §lDownload BotFilter(ENG): https://github.com/LoyisaSUS/BungeeCord-BotFilter-ENG" ); + sender.sendMessage( "§r> §l下载 BotFilter(简体中文): https://github.com/LoyisaSUS/BungeeCord-BotFilter-ZHCN" ); } private void export(CommandSender sender, String[] args) diff --git a/proxy/src/main/java/ru/leymooo/botfilter/BotFilterThread.java b/proxy/src/main/java/ru/leymooo/botfilter/BotFilterThread.java index 5bf0be28cb..c981b07241 100644 --- a/proxy/src/main/java/ru/leymooo/botfilter/BotFilterThread.java +++ b/proxy/src/main/java/ru/leymooo/botfilter/BotFilterThread.java @@ -50,7 +50,7 @@ public static void start() if ( ( currTime - connector.getJoinTime() ) >= Settings.IMP.TIME_OUT ) { connector.failed( KickType.TIMED_OUT, state == BotFilter.CheckState.CAPTCHA_ON_POSITION_FAILED - ? "Too long fall check" : "Captcha not entered" ); + ? "重力检查超时" : "未输入验证码" ); TO_REMOVE_SET.add( entryset.getKey() ); continue; } else if ( state == BotFilter.CheckState.CAPTCHA_ON_POSITION_FAILED || state == BotFilter.CheckState.ONLY_POSITION ) @@ -66,7 +66,7 @@ public static void start() } catch ( Exception e ) { - bungee.getLogger().log( Level.WARNING, "[BotFilter] Unknown error. Please report it to the developer!", e ); + bungee.getLogger().log( Level.WARNING, "[BotFilter] 未知错误. 请向开发者报告!", e ); } finally { if ( !TO_REMOVE_SET.isEmpty() ) diff --git a/proxy/src/main/java/ru/leymooo/botfilter/Connector.java b/proxy/src/main/java/ru/leymooo/botfilter/Connector.java index 8283d3196b..a5069884fa 100644 --- a/proxy/src/main/java/ru/leymooo/botfilter/Connector.java +++ b/proxy/src/main/java/ru/leymooo/botfilter/Connector.java @@ -104,7 +104,7 @@ public void spawn() PacketUtils.titles[1].writeTitle( channel, version ); } sendPing(); - LOGGER.log( Level.INFO, toString() + " has connected" ); + LOGGER.log( Level.INFO, toString() + " 已连接" ); } @@ -128,7 +128,7 @@ public void handle(PacketWrapper packet) throws Exception //There are no unknown packets which player will send and will be longer than 2048 bytes during check if ( packet.packet == null && packet.buf.readableBytes() > 2048 ) { - failed( KickType.BIG_PACKET, "Sent packet larger than 2048 bytes (" + packet.buf.readableBytes() + ")" ); + failed( KickType.BIG_PACKET, "发送的数据包大于2048字节 (" + packet.buf.readableBytes() + ")" ); } } @@ -140,7 +140,7 @@ public void disconnected(ChannelWrapper channel) throws Exception case ONLY_CAPTCHA: case ONLY_POSITION: case CAPTCHA_POSITION: - String info = "(BF) [" + name + "|" + ip + "] left from server during check"; + String info = "(BF) [" + name + "|" + ip + "] 在验证时退出了服务器"; LOGGER.log( Level.INFO, info ); FailedUtils.addIpToQueue( ip, KickType.LEAVED ); break; @@ -176,7 +176,7 @@ public void completeCheck() changeStateToCaptcha(); } else { - failed( KickType.FAILED_FALLING, "Too fast check passed" ); + failed( KickType.FAILED_FALLING, "过快的通过验证" ); } } return; @@ -184,7 +184,7 @@ public void completeCheck() int devide = lastSend == 0 ? sentPings : sentPings - 1; if ( botFilter.checkBigPing( totalping / ( devide <= 0 ? 1 : devide ) ) ) { - failed( KickType.PING, "Big ping" ); + failed( KickType.PING, "延迟过高" ); return; } state = CheckState.SUCCESSFULLY; @@ -201,7 +201,7 @@ public void completeCheck() userConnection.setNeedLogin( false ); userConnection.getPendingConnection().finishLogin( userConnection, true ); markDisconnected = true; - LOGGER.log( Level.INFO, "[BotFilter] Player (" + name + "|" + ip + ") passed verification successfully" ); + LOGGER.log( Level.INFO, "[BotFilter] 玩家 (" + name + "|" + ip + ") 成功地通过了验证" ); } @Override @@ -227,7 +227,7 @@ public void onMove() changeStateToCaptcha(); } else { - failed( KickType.FAILED_FALLING, "Failed position check" ); + failed( KickType.FAILED_FALLING, "重力检查失败" ); } return; } @@ -281,7 +281,7 @@ private void handleChat(String message) { if ( message.length() > 256 ) { - failed( KickType.FAILED_CAPTCHA, "Too long message" ); + failed( KickType.FAILED_CAPTCHA, "消息过长" ); return; } if ( message.replace( "/", "" ).equals( captchaAnswer ) ) @@ -293,7 +293,7 @@ private void handleChat(String message) sendCaptcha(); } else { - failed( KickType.FAILED_CAPTCHA, "Failed captcha check" ); + failed( KickType.FAILED_CAPTCHA, "验证码检查失败" ); } } } @@ -312,7 +312,7 @@ public void handle(KeepAlive keepAlive) throws Exception { if ( lastSend == 0 ) { - failed( KickType.PING, "Tried send fake ping" ); + failed( KickType.PING, "尝试发送虚假的 keepAlive 包" ); return; } long ping = System.currentTimeMillis() - lastSend; @@ -330,7 +330,7 @@ public void handle(PluginMessage pluginMessage) throws Exception if ( pluginMessagesBytes > MAX_PLUGIN_MESSAGES_BYTES ) { - failed( KickType.BIG_PACKET, "Bad PluginMessage's" ); + failed( KickType.BIG_PACKET, "错误的PluginMessage" ); return; } @@ -384,7 +384,7 @@ public void failed(KickType type, String kickMessage) state = CheckState.FAILED; PacketUtils.kickPlayer( type, Protocol.GAME, userConnection.getCh(), version ); markDisconnected = true; - LOGGER.log( Level.INFO, "(BF) [" + name + "|" + ip + "] check failed: " + kickMessage ); + LOGGER.log( Level.INFO, "(BF) [" + name + "|" + ip + "] 验证失败: " + kickMessage ); if ( type != KickType.BIG_PACKET ) { FailedUtils.addIpToQueue( ip, type ); diff --git a/proxy/src/main/java/ru/leymooo/botfilter/caching/PacketUtils.java b/proxy/src/main/java/ru/leymooo/botfilter/caching/PacketUtils.java index 35c6722949..7c3af4fae2 100644 --- a/proxy/src/main/java/ru/leymooo/botfilter/caching/PacketUtils.java +++ b/proxy/src/main/java/ru/leymooo/botfilter/caching/PacketUtils.java @@ -135,8 +135,8 @@ public static void init() messages = new CachedMessage[] { - new CachedMessage( Settings.IMP.MESSAGES.CHECKING_CAPTCHA_WRONG.replaceFirst( "%s", "2" ).replaceFirst( "%s", "chances" ) ), - new CachedMessage( Settings.IMP.MESSAGES.CHECKING_CAPTCHA_WRONG.replaceFirst( "%s", "1" ).replaceFirst( "%s", "chances" ) ), + new CachedMessage( Settings.IMP.MESSAGES.CHECKING_CAPTCHA_WRONG.replaceFirst( "%s", "2" ).replaceFirst( "%s", "次" ) ), + new CachedMessage( Settings.IMP.MESSAGES.CHECKING_CAPTCHA_WRONG.replaceFirst( "%s", "1" ).replaceFirst( "%s", "次" ) ), new CachedMessage( Settings.IMP.MESSAGES.CHECKING ), new CachedMessage( Settings.IMP.MESSAGES.CHECKING_CAPTCHA ), new CachedMessage( Settings.IMP.MESSAGES.SUCCESSFULLY ) @@ -152,7 +152,7 @@ public static void init() kickMessagesGame.put( KickType.FAILED_FALLING, failedMessage ); kickMessagesGame.put( KickType.TIMED_OUT, failedMessage ); kickMessagesGame.put( KickType.COUNTRY, new CachedPacket( createKickPacket( Settings.IMP.MESSAGES.KICK_COUNTRY ), kickGame ) ); - kickMessagesGame.put( KickType.BIG_PACKET, new CachedPacket( createKickPacket( "§cFailed while checking. Please report it to the administration. (Big packet was sent)" ), kickGame ) ); + kickMessagesGame.put( KickType.BIG_PACKET, new CachedPacket( createKickPacket( "§c验证失败。请向服务器管理员报告。(数据包大小异常)" ), kickGame ) ); kickMessagesLogin.put( KickType.PING, new CachedPacket( createKickPacket( String.join( "", Settings.IMP.SERVER_PING_CHECK.KICK_MESSAGE ) ), kickLogin ) ); kickMessagesLogin.put( KickType.MANYCHECKS, new CachedPacket( createKickPacket( Settings.IMP.MESSAGES.KICK_MANY_CHECKS ), kickLogin ) ); kickMessagesLogin.put( KickType.COUNTRY, new CachedPacket( createKickPacket( Settings.IMP.MESSAGES.KICK_COUNTRY ), kickLogin ) ); @@ -253,7 +253,7 @@ public static int rewriteVersion(int version) int rewritten = VERSION_REWRITE[version]; if ( rewritten == -1 ) { - throw new IllegalArgumentException( "Version is not supported" ); + throw new IllegalArgumentException( "不支持的版本" ); } return rewritten; } diff --git a/proxy/src/main/java/ru/leymooo/botfilter/captcha/CaptchaGeneration.java b/proxy/src/main/java/ru/leymooo/botfilter/captcha/CaptchaGeneration.java index b44049b269..dfac778250 100644 --- a/proxy/src/main/java/ru/leymooo/botfilter/captcha/CaptchaGeneration.java +++ b/proxy/src/main/java/ru/leymooo/botfilter/captcha/CaptchaGeneration.java @@ -54,13 +54,13 @@ public void generateImages() ThreadPoolExecutor ex = (ThreadPoolExecutor) executor; while ( ex.getActiveCount() != 0 ) { - BungeeCord.getInstance().getLogger().log( Level.INFO, "[BotFilter] Generating Captcha... [{0}/900]", 900 - ex.getQueue().size() - ex.getActiveCount() ); + BungeeCord.getInstance().getLogger().log( Level.INFO, "[BotFilter] 生成验证码中... [{0}/900]", 900 - ex.getQueue().size() - ex.getActiveCount() ); try { Thread.sleep( 1000L ); } catch ( InterruptedException ex1 ) { - BungeeCord.getInstance().getLogger().log( Level.WARNING, "[BotFilter] Can't generate the Captcha. Shutting down...", ex1 ); + BungeeCord.getInstance().getLogger().log( Level.WARNING, "[BotFilter] 生成验证码失败! 关闭中...", ex1 ); System.exit( 0 ); return; } @@ -68,7 +68,7 @@ public void generateImages() CachedCaptcha.generated = true; executor.shutdownNow(); System.gc(); - BungeeCord.getInstance().getLogger().log( Level.INFO, "[BotFilter] Captcha was generated in {0} ms", System.currentTimeMillis() - start ); + BungeeCord.getInstance().getLogger().log( Level.INFO, "[BotFilter] 验证码生成成功! 耗时: {0} ms", System.currentTimeMillis() - start ); } diff --git a/proxy/src/main/java/ru/leymooo/botfilter/config/Settings.java b/proxy/src/main/java/ru/leymooo/botfilter/config/Settings.java index 5d2d90cf17..576f842ccc 100644 --- a/proxy/src/main/java/ru/leymooo/botfilter/config/Settings.java +++ b/proxy/src/main/java/ru/leymooo/botfilter/config/Settings.java @@ -13,7 +13,7 @@ public class Settings extends Config @Comment( { - "Please submit all errors, bugs, suggestions and other requests on github " + "请在github上提交所有错误、bug、建议和其他请求 " }) @Final public final String ISSUES = "https://github.com/Leymooo/BungeeCord/issues"; @@ -38,23 +38,23 @@ public class Settings extends Config public SQL SQL; @Comment( { - "How many players / bots should join in a minute, to enable the protection", - "Recommended settings without advertising: ", - "Under 150 players - 25, under 250 - 30, under 350 - 35, under 550 - 40,45, higher - adjust for yourself ", - "During advertising or when just-just setted up the protection, it is recommended to set high these valu. es" + "当1分钟内有多少玩家/假人进入服务器时,自动启用保护", + "无推广/活动时的推荐数值: ", + "低于150名玩家 - 25, 低于250 - 30, 低于350 - 35, 低于550 - 40,45, 更多玩家 - 自行调整 ", + "在推广/活动时期或刚设置保护的时候, 推荐将这些数值调高" }) public int PROTECTION_THRESHOLD = 30; - @Comment("How long is automatic protection active? In milliseconds. 1 second = 1000") + @Comment("自动保护的持续时间, 以毫秒为单位. 1秒=1000毫秒") public int PROTECTION_TIME = 120000; - @Comment("Whether to force check the bot when joining the server during a bot attack, no matter whether the check is passed or not") + @Comment("在被假人攻击时, 进入服务器是否强制检查. 不论通过与否, 都会被强制检查") public boolean FORCE_CHECK_ON_ATTACK = true; - @Comment("Should we show the player count from the filter?") + @Comment("是否在在线人数上加上在过滤器中(验证中)的玩家?") public boolean SHOW_ONLINE = true; - @Comment("How much time does the player have to pass the verification. In milliseconds. 1 second = 1000") + @Comment("玩家必须在多少时间内完成验证, 以毫秒为单位. 1秒=1000毫秒") public int TIME_OUT = 12700; - @Comment("Enable fix for 'Team 'xxx' already exist in this scoreboard'") + @Comment("是否启用客户端 'Team 'xxx' already exist in this scoreboard' 报错的修复?") public boolean FIX_SCOREBOARD_TEAMS = true; - @Comment("Should the IP addresses of the players / bots who failed the verification be logged to a file?") + @Comment("是否将未通过验证的玩家/假人的IP记录到文件中?") public boolean SAVE_FAILED_IPS_TO_FILE = true; public void reload(File file) @@ -63,117 +63,117 @@ public void reload(File file) save( file ); } - @Comment("Please don't use '\\n', use %nl%") + @Comment("请勿使用 '\\n' 来换行, 用 %nl% 替代") public static class MESSAGES { public String PREFIX = "&b&lBot&d&lFilter"; - public String CHECKING = "%prefix%&7>> &aPlease wait for verification to complete..."; - public String CHECKING_CAPTCHA = "%prefix%&7>> &aEnter the number from the image into the chat"; - public String CHECKING_CAPTCHA_WRONG = "%prefix%&7>> &cYou entered the captcha incorrectly, please try again. You have &a%s &c%s"; - public String SUCCESSFULLY = "%prefix%&7>> &aVerification passed"; - public String KICK_MANY_CHECKS = "%prefix%%nl%%nl%&cWe have detected suspicious activity from your ip address%nl%%nl%&6Please try again in 10 minutes"; - public String KICK_NOT_PLAYER = "%prefix%%nl%%nl%&cYou did not pass the verification, maybe you are a bot%nl%&7&oIf that is not so, please try again"; - public String KICK_COUNTRY = "%prefix%%nl%%nl%&cYour country is banned from the server"; - public String KICK_BIG_PING = "%prefix%%nl%%nl%&cYour ping is very high, most likely you are a bot"; + public String CHECKING = "%prefix%&7>> &a请等待验证完成..."; + public String CHECKING_CAPTCHA = "%prefix%&7>> &a请在聊天栏中输入图片中的数字"; + public String CHECKING_CAPTCHA_WRONG = "%prefix%&7>> &c您输入的验证码错误, 请重试. 你还可以尝试 &a%s &c%s"; + public String SUCCESSFULLY = "%prefix%&7>> &a验证成功!"; + public String KICK_MANY_CHECKS = "%prefix%%nl%%nl%&c我们检测到了来自于你的IP地址的可疑活动%nl%%nl%&6请在10分钟后重试"; + public String KICK_NOT_PLAYER = "%prefix%%nl%%nl%&c你没有通过验证, 你是个假人吗?%nl%&7&o如果不是, 请重试"; + public String KICK_COUNTRY = "%prefix%%nl%%nl%&c您所在的国家被禁止进入服务器"; + public String KICK_BIG_PING = "%prefix%%nl%%nl%&c您的延迟过高, 请更换一个更好的网络"; @Comment( { - "Title%nl%Subtitle", "You can leave blank to disable the title (ex: CHECKING_TITLE = \"\") ", - "Disabling titles may slightly improve performance" + "标题%nl%副标题", "您可以留空以禁用标题 (例如: CHECKING_TITLE = \"\") ", + "禁用标题可能会略微提高性能" }) - public String CHECKING_TITLE = "&r&lBot&b&lFilter%nl%&aChecking..."; - public String CHECKING_TITLE_SUS = "&rVerification passed%nl%&aHave a good game"; - public String CHECKING_TITLE_CAPTCHA = " %nl%&rEnter the captcha into the chat!"; + public String CHECKING_TITLE = "&r&lBot&b&lFilter%nl%&a检查中..."; + public String CHECKING_TITLE_SUS = "&r验证通过%nl%&a祝您游戏愉快"; + public String CHECKING_TITLE_CAPTCHA = " %nl%&r请在聊天栏中输入验证码!"; } - @Comment("Enable or disable GeoIp") + @Comment("启用或禁用 GeoIp 检查") public static class GEO_IP { @Comment( { - "When does the check works", - "0 - Always", - "1 - Only during bot attacks", - "2 - Disable" + "在什么时候启用该检查?", + "0 - 总是", + "1 - 只在被假人攻击时", + "2 - 禁用" }) public int MODE = 1; @Comment( { - "How exactly does GeoIp work", - "0 - White list(Only those countries that are on the list can join)", - "1 - Black list(Only countries that are not on the list can join)" + "GeoIp的工作模式", + "0 - 白名单模式(只有在ALLOWED_COUNTRIES列表中的国家才能进入)", + "1 - 黑名单模式(只有不在ALLOWED_COUNTRIES列表中的国家才能进入)" }) public int TYPE = 0; @Comment( { - "Where to download GEOIP from", - "Change the link if for some reason it doesn't download from this one", - "The file must end in .mmdb or be packed into .tar.gz" + "从哪里下载GeoIp数据库?", + "如果该链接因为某些原因无法下载, 请更改它", + "文件必须以 .mmdb 结尾或打包成 .tar.gz" }) public String NEW_GEOIP_DOWNLOAD_URL = "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country&license_key=%license_key%&suffix=tar.gz"; @Comment( { - "If the key stops working, you need to register at https://www.maxmind.com/", - "and generate a new key here https://www.maxmind.com/en/accounts/current/license-key" + "如果密钥失效, 你需要在 https://www.maxmind.com/ 注册一个账号", + "并在 https://www.maxmind.com/en/accounts/current/license-key 生成一个新的密钥" }) public String MAXMIND_LICENSE_KEY = "P5g0fVdAQIq8yQau"; - @Comment("Разрешённые странны") + @Comment("国家代码列表, 请参考 https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2") public List ALLOWED_COUNTRIES = Arrays.asList( "RU", "UA", "BY", "KZ", "EE", "MD", "KG", "AZ", "LT", "LV", "GE", "PL" ); } - @Comment("Enable or disable high ping check") + @Comment("启用或禁用高延迟检查") public static class PING_CHECK { @Comment( { - "When does the check works", - "0 - Always", - "1 - Only during bot attacks", - "2 - Disable" + "在什么时候启用该检查?", + "0 - 总是", + "1 - 只在被假人攻击时", + "2 - 禁用" }) public int MODE = 1; - @Comment("Maximum allowed ping") + @Comment("最大延迟") public int MAX_PING = 350; } - @Comment("Enable or disable Direct Connect check") + @Comment("启用或禁用直接连接检查") public static class SERVER_PING_CHECK { @Comment( { - "When the check works", - "0 - Always", - "1 - Only during bot attacks", - "2 - Disable", - "Disabled by default, because it is very unstable against strong attacks" + "在什么时候启用该检查?", + "0 - 总是", + "1 - 只在被假人攻击时", + "2 - 禁用", + "由于在面对强力攻击时不稳定, 此检查默认禁用" }) public int MODE = 2; - @Comment("When is it allowed to join the server after receiving server's motd") + @Comment("客户端接收到服务器MOTD后允许多少秒内进入服务器") public int CACHE_TIME = 12; public List KICK_MESSAGE = new ArrayList() { { add( "%nl%" ); add( "%nl%" ); - add( "&cYou've been kicked! Please don't use direct connection" ); + add( "&c你已被踢出! 请不要使用直接连接" ); add( "%nl%" ); add( "%nl%" ); - add( "&bTo join the server:" ); + add( "&b要进入服务器:" ); add( "%nl%" ); - add( "&71) &rAdd the server to the &lserver list." ); + add( "&71) &r将服务器添加到 &l服务器列表中." ); add( "%nl%" ); - add( "&lOur IP &8>> &b&lIP" ); + add( "&l我们的IP &8>> &b&lIP" ); add( "%nl%" ); add( "%nl%" ); - add( "&72) &rRefresh the server list. " ); + add( "&72) &r刷新服务器列表. " ); add( "%nl%" ); - add( "&oTo refresh it, click the &c&lRefresh&r button" ); + add( "&o要刷新服务器列表, 请点击 &c&l刷新&r 按钮" ); add( "%nl%" ); add( "%nl%" ); - add( "&73) &rWait &c1-3&r seconds and join the server!" ); + add( "&73) &r等待 &c1-3&r 秒后进入服务器!" ); } }; @@ -181,33 +181,33 @@ public static class SERVER_PING_CHECK @Comment( { - "Setting up exactly how the protection will work", - "0 - Only check with captcha", - "1 - Fall check + captcha", - "2 - Fall check, if it failed, then captcha" + "设置反假人保护的操作模式", + "0 - 验证码检查", + "1 - 重力检查 + 验证码检查", + "2 - 重力检查, 如果验证失败再进行验证码检查" }) public static class PROTECTION { - @Comment("Operation mode while there is no attack") + @Comment("无攻击时的操作模式") public int NORMAL = 2; - @Comment("Operation mode during the attack") + @Comment("被攻击时的操作模式") public int ON_ATTACK = 1; @Comment( { - "Enable constant checking of the players?", - "When enabling this feature, don't forget to set the protection-threshold value higher" + "是否总是检查玩家?", + "启用此功能时, 请不要忘记将 protection-threshold 的值设置得更高" }) public boolean ALWAYS_CHECK = false; @Comment( { - "Check players with ip 127.0.0.1?", "May be useful when using Geyser", - "0 - check", "1 - don't check", "2 - check every time" + "检查 ip 为 127.0.0.1 的玩家?", "使用 Geyser 时可能会有用", + "0 - 检查", "1 - 不检查", "2 - 总是检查" }) public int CHECK_LOCALHOST = 0; - @Comment("Disable check for Geyser-standalone clients? auth-type must be set to floodgate") + @Comment("禁用 Geyser-standalone 在无攻击时的检查? auth-type必须设置为 floodgate") public boolean SKIP_GEYSER = false; /* @Comment( @@ -222,33 +222,33 @@ public static class PROTECTION */ } - @Comment("Database configuration") + @Comment("数据库设置") public static class SQL { - @Comment("Database type. sqlite or mysql") + @Comment("数据库类型. sqlite或mysql") public String STORAGE_TYPE = "sqlite"; - @Comment("After how many days, remove players from the database who have passed the verification and never logged in again. 0 or less to disable it") + @Comment("从数据库内删除多少天内通过验证且没有再登录过的玩家. 将该值设置为0或更小的值以禁用该功能") public int PURGE_TIME = 14; - @Comment("Mysql configuration") + @Comment("MySQL配置") public String HOSTNAME = "127.0.0.1"; public int PORT = 3306; public String USER = "user"; public String PASSWORD = "password"; public String DATABASE = "database"; - @Comment("Interval in millieseconds. How often it will synchronize data bases if multibungee is used.") + @Comment("多久内同步一次数据库? 以毫秒为单位. 在使用多个BungeeCord时可能会有用") public int SYNC_INTERVAL = -1; } - @Comment("Virtual world settings") + @Comment("虚拟世界设置") public static class DIMENSIONS { @Comment( { - "Which world to use", - "0 - Standard world", - "1 - Nether", - "2 - End" + "使用哪个世界维度?", + "0 - 主世界", + "1 - 下界", + "2 - 末地" }) public int TYPE = 0; } diff --git a/proxy/src/main/java/ru/leymooo/botfilter/utils/FailedUtils.java b/proxy/src/main/java/ru/leymooo/botfilter/utils/FailedUtils.java index bfbdbdc161..737bc2af27 100644 --- a/proxy/src/main/java/ru/leymooo/botfilter/utils/FailedUtils.java +++ b/proxy/src/main/java/ru/leymooo/botfilter/utils/FailedUtils.java @@ -47,7 +47,7 @@ public void flushQueue() } } catch ( Exception e ) { - BungeeCord.getInstance().getLogger().log( Level.WARNING, "[BotFilter] Could not save failed ips to file", e ); + BungeeCord.getInstance().getLogger().log( Level.WARNING, "[BotFilter] 无法将未通过验证的ip保存到文件", e ); } } } diff --git a/proxy/src/main/java/ru/leymooo/botfilter/utils/FakeOnlineUtils.java b/proxy/src/main/java/ru/leymooo/botfilter/utils/FakeOnlineUtils.java index 9f174b9928..6674c6317f 100644 --- a/proxy/src/main/java/ru/leymooo/botfilter/utils/FakeOnlineUtils.java +++ b/proxy/src/main/java/ru/leymooo/botfilter/utils/FakeOnlineUtils.java @@ -28,7 +28,7 @@ public FakeOnlineUtils() multiple = Float.parseFloat( boost ); } catch ( NumberFormatException e ) { - BungeeCord.getInstance().getLogger().log( Level.WARNING, "[BotFilter] Can't enable fake online: {0}", e.getMessage() ); + BungeeCord.getInstance().getLogger().log( Level.WARNING, "[BotFilter] 无法启用虚拟玩家人数: {0}", e.getMessage() ); return; } enabled = true; diff --git a/proxy/src/main/java/ru/leymooo/botfilter/utils/GeoIp.java b/proxy/src/main/java/ru/leymooo/botfilter/utils/GeoIp.java index 1668343bc2..a74aa8264a 100644 --- a/proxy/src/main/java/ru/leymooo/botfilter/utils/GeoIp.java +++ b/proxy/src/main/java/ru/leymooo/botfilter/utils/GeoIp.java @@ -104,7 +104,7 @@ private void setupDataBase(boolean startup) reader = new DatabaseReader.Builder( file ).withCache( new CHMCache( 4096 * 4 ) ).build(); } catch ( IOException ex ) { - LOGGER.log( Level.WARNING, "[BotFilter] Cannot connect to GeoLite2 database. Redownloading...", ex ); + LOGGER.log( Level.WARNING, "[BotFilter] 无法连接到 GeoLite2 数据库. 正在重新下载...", ex ); file.delete(); setupDataBase( true ); } @@ -113,7 +113,7 @@ private void setupDataBase(boolean startup) private void downloadDataBase(final File out) { - LOGGER.log( Level.INFO, "[BotFilter] Downloading GeoLite2 database..." ); + LOGGER.log( Level.INFO, "[BotFilter] 正在下载 GeoLite2 数据库..." ); long start = System.currentTimeMillis(); try { @@ -141,7 +141,7 @@ private void downloadDataBase(final File out) } } else { - throw new IOException( "File type is not supported " ); + throw new IOException( "不支持的文件类型 " ); } } setupDataBase( true ); @@ -151,10 +151,10 @@ private void downloadDataBase(final File out) { setupDataBase( false ); } - LOGGER.log( Level.WARNING, "[BotFilter] Can't download GeoLite2 database", ex ); + LOGGER.log( Level.WARNING, "[BotFilter] 无法下载 GeoLite2 数据库", ex ); return; } - LOGGER.log( Level.INFO, "[BotFilter] GeoLite2 database loaded ({0}ms)", System.currentTimeMillis() - start ); + LOGGER.log( Level.INFO, "[BotFilter] 已加载 GeoLite2 数据库 ({0}ms)", System.currentTimeMillis() - start ); } private void saveToFile(InputStream stream, File out) throws IOException @@ -169,7 +169,7 @@ private void saveToFile(InputStream stream, File out) throws IOException { fis.close(); out.delete(); - LOGGER.log( Level.WARNING, "[BotFilter] Unable to download GeoLite2 database. Removing temp file..." ); + LOGGER.log( Level.WARNING, "[BotFilter] 无法下载 GeoLite2 数据库. 正在删除临时文件......" ); return; } fis.write( buffer, 0, count ); diff --git a/proxy/src/main/java/ru/leymooo/botfilter/utils/Sql.java b/proxy/src/main/java/ru/leymooo/botfilter/utils/Sql.java index 786bd5a737..da98ca1def 100644 --- a/proxy/src/main/java/ru/leymooo/botfilter/utils/Sql.java +++ b/proxy/src/main/java/ru/leymooo/botfilter/utils/Sql.java @@ -57,7 +57,7 @@ private void setupConnect() return; } this.connection = null; - logger.info( "[BotFilter] Connecting to the database..." ); + logger.info( "[BotFilter] 正在连接到数据库..." ); long start = System.currentTimeMillis(); if ( Settings.IMP.SQL.STORAGE_TYPE.equalsIgnoreCase( "mysql" ) ) { @@ -68,7 +68,7 @@ private void setupConnect() Class.forName( "org.sqlite.JDBC" ); connectToDatabase( "JDBC:sqlite:BotFilter/database.db", null, null ); } - logger.log( Level.INFO, "[BotFilter] Database connected ({0} ms)", System.currentTimeMillis() - start ); + logger.log( Level.INFO, "[BotFilter] 数据库已连接 ({0} ms)", System.currentTimeMillis() - start ); createTable(); alterLastJoinColumn(); clearOldUsers(); @@ -77,7 +77,7 @@ private void setupConnect() } catch ( SQLException | ClassNotFoundException e ) { executor.schedule( this::setupConnect, 5, TimeUnit.SECONDS ); - logger.log( Level.WARNING, "Can not connect to database or execute sql: ", e ); + logger.log( Level.WARNING, "无法连接数据库或执行sql: ", e ); if ( connection != null ) { Connection conn = connection; @@ -124,7 +124,7 @@ private void alterLastJoinColumn() } } catch ( Exception e ) { - logger.log( Level.WARNING, "[BotFilter] Error has occurred with adding a column to the table", e ); + logger.log( Level.WARNING, "[BotFilter] 向表中添加列时出错", e ); } } @@ -139,12 +139,12 @@ private void clearOldUsers() throws SQLException long until = calendar.getTimeInMillis(); int before = botFilter.getUsersCount(); botFilter.getUserCache().entrySet().removeIf( (entry) -> entry.getValue().getLastJoin() < until ); - logger.log( Level.INFO, "[BotFilter] Removed {0} accounts from memory", before - botFilter.getUsersCount() ); + logger.log( Level.INFO, "[BotFilter] 从内存中删除了 {0} 个玩家", before - botFilter.getUsersCount() ); if ( this.connection != null ) { try ( PreparedStatement statement = connection.prepareStatement( "DELETE FROM `Users` WHERE `LastJoin` < " + until + ";" ) ) { - logger.log( Level.INFO, "[BotFilter] Removed {0} accounts from the database", statement.executeUpdate() ); + logger.log( Level.INFO, "[BotFilter] 从数据库中删除了 {0} 个玩家", statement.executeUpdate() ); } } } @@ -186,11 +186,11 @@ private void syncUsers() botFilter.addUserToCache( botFilterUser ); i++; } - logger.log( Level.INFO, "[BotFilter] Synchronized ({0}) new checks", i ); + logger.log( Level.INFO, "[BotFilter] 已同步 ({0}) 个检查", i ); lastSync = curr; } catch ( Exception e ) { - logger.log( Level.WARNING, "[BotFilter] Check synchronization failed", e ); + logger.log( Level.WARNING, "[BotFilter] 检查同步失败", e ); setupConnect(); } } @@ -216,7 +216,7 @@ private void loadUsers() throws SQLException botFilter.addUserToCache( botFilterUser ); i++; } - logger.log( Level.INFO, "[BotFilter] Player whitelist loaded successfully ({0})", i ); + logger.log( Level.INFO, "[BotFilter] 玩家列表加载成功 ({0})", i ); } } @@ -270,7 +270,7 @@ public void saveUser(BotFilterUser botFilterUser) } } catch ( SQLException ex ) { - logger.log( Level.WARNING, "[BotFilter] Can't query the database", ex ); + logger.log( Level.WARNING, "[BotFilter] 无法查询数据库", ex ); logger.log( Level.WARNING, sql ); setupConnect(); } @@ -288,7 +288,7 @@ public void tryCleanUP() } catch ( SQLException ex ) { setupConnect(); - logger.log( Level.WARNING, "[BotFilter] Can't clear user list", ex ); + logger.log( Level.WARNING, "[BotFilter] 无法清理玩家列表", ex ); } }