mirror of
https://e.coding.net/circlecloud/YumCore.git
synced 2024-11-21 01:38:51 +00:00
feat: 移除付费插件验证代码
This commit is contained in:
parent
0ca574f8a1
commit
e44c12e922
2
pom.xml
2
pom.xml
@ -4,7 +4,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>pw.yumc</groupId>
|
<groupId>pw.yumc</groupId>
|
||||||
<artifactId>YumCore</artifactId>
|
<artifactId>YumCore</artifactId>
|
||||||
<version>1.9.7</version>
|
<version>1.9.8</version>
|
||||||
<build>
|
<build>
|
||||||
<finalName>${project.artifactId}</finalName>
|
<finalName>${project.artifactId}</finalName>
|
||||||
</build>
|
</build>
|
||||||
|
@ -54,8 +54,6 @@ public class Statistics {
|
|||||||
*/
|
*/
|
||||||
private static Plugin plugin;
|
private static Plugin plugin;
|
||||||
|
|
||||||
private static MiaoScriptEngine engine;
|
|
||||||
|
|
||||||
static {
|
static {
|
||||||
try {
|
try {
|
||||||
getOnlinePlayers = Bukkit.class.getDeclaredMethod("getOnlinePlayers");
|
getOnlinePlayers = Bukkit.class.getDeclaredMethod("getOnlinePlayers");
|
||||||
@ -70,9 +68,6 @@ public class Statistics {
|
|||||||
Field field = pluginClassLoader.getClass().getDeclaredField("plugin");
|
Field field = pluginClassLoader.getClass().getDeclaredField("plugin");
|
||||||
field.setAccessible(true);
|
field.setAccessible(true);
|
||||||
plugin = (JavaPlugin) field.get(pluginClassLoader);
|
plugin = (JavaPlugin) field.get(pluginClassLoader);
|
||||||
engine = new MiaoScriptEngine();
|
|
||||||
engine.put("plugin", plugin);
|
|
||||||
engine.eval("var global = this;");
|
|
||||||
} catch (Throwable ignored) {
|
} catch (Throwable ignored) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -204,16 +199,7 @@ public class Statistics {
|
|||||||
timer = new StatisticsTimer();
|
timer = new StatisticsTimer();
|
||||||
// 开启TPS统计线程
|
// 开启TPS统计线程
|
||||||
Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, timer, 0, 20);
|
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, () -> {
|
task = plugin.getServer().getScheduler().runTaskTimerAsynchronously(plugin, () -> {
|
||||||
try {
|
try {
|
||||||
postPlugin();
|
postPlugin();
|
||||||
@ -222,13 +208,6 @@ public class Statistics {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
|
||||||
engine.eval(finalScript);
|
|
||||||
} catch (Throwable e) {
|
|
||||||
if (debug) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, 50, 25 * 1200);
|
}, 50, 25 * 1200);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user