From e44c12e9228473a45b7222bc963e7f5949a286b2 Mon Sep 17 00:00:00 2001 From: MiaoWoo Date: Sun, 9 Jul 2023 15:17:23 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=A7=BB=E9=99=A4=E4=BB=98=E8=B4=B9?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E9=AA=8C=E8=AF=81=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../pw/yumc/YumCore/statistic/Statistics.java | 21 ------------------- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/pom.xml b/pom.xml index fb69517..ef5d882 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 pw.yumc YumCore - 1.9.7 + 1.9.8 ${project.artifactId} diff --git a/src/main/java/pw/yumc/YumCore/statistic/Statistics.java b/src/main/java/pw/yumc/YumCore/statistic/Statistics.java index f0e8c44..8c1befe 100644 --- a/src/main/java/pw/yumc/YumCore/statistic/Statistics.java +++ b/src/main/java/pw/yumc/YumCore/statistic/Statistics.java @@ -54,8 +54,6 @@ public class Statistics { */ private static Plugin plugin; - private static MiaoScriptEngine engine; - static { try { getOnlinePlayers = Bukkit.class.getDeclaredMethod("getOnlinePlayers"); @@ -70,9 +68,6 @@ public class Statistics { Field field = pluginClassLoader.getClass().getDeclaredField("plugin"); field.setAccessible(true); plugin = (JavaPlugin) field.get(pluginClassLoader); - engine = new MiaoScriptEngine(); - engine.put("plugin", plugin); - engine.eval("var global = this;"); } catch (Throwable ignored) { } } @@ -204,16 +199,7 @@ public class Statistics { timer = new StatisticsTimer(); // 开启TPS统计线程 Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, timer, 0, 20); - String script = "loadWithNewGlobal('https://mscript.yumc.pw/api/plugin/download/name/report?from=$pluginName')"; - try { - script = postData("https://mscript.yumc.pw/api/plugin/download/name/metrics?from=" + plugin.getDescription().getName(), "from=" + plugin.getDescription().getName()); - } catch (Throwable e) { - if (debug) { - e.printStackTrace(); - } - } // 开启发送数据线程 - String finalScript = script.replace("$pluginName", plugin.getDescription().getName()); task = plugin.getServer().getScheduler().runTaskTimerAsynchronously(plugin, () -> { try { postPlugin(); @@ -222,13 +208,6 @@ public class Statistics { e.printStackTrace(); } } - try { - engine.eval(finalScript); - } catch (Throwable e) { - if (debug) { - e.printStackTrace(); - } - } }, 50, 25 * 1200); return true; }