1
0
forked from xjboss/KCauldronX
This commit is contained in:
聪聪 2017-08-03 09:38:27 +08:00
commit 75ee4d8b54
3 changed files with 15 additions and 13 deletions

View File

@ -1,8 +1,9 @@
**[加入KCauldronX交流群!](https://jq.qq.com/?_wv=1027&k=4BEK1SI)** **[加入KCauldronX交流群!](https://jq.qq.com/?_wv=1027&k=4BEK1SI)**
# KCauldronX # KCauldronX
### KCauldronX - continuation of KCauldron minecraft server ### KCauldronX - continuation of KCauldron minecraft server
![Donate][donate_img] [![Download KCauldronX][download_img]][download_url] [![Build Status][build_status]](https://ci.xjboss.net/job/KCauldronX/) [![Download KCauldronX][download_img]][download_url] [![bStats][bStats]][bStats_link] [![yumc Stats][yumc_Stats]][yumc_Stats_link]
![donate][donate_img] 1PFBV7gFBEqG1hcYhR9CvrvQhENczsRgHg
## Building KCauldronX ## Building KCauldronX
* Ensure you are using Java JDK 8u101 or higher. * Ensure you are using Java JDK 8u101 or higher.
* Checkout project * Checkout project
@ -38,6 +39,11 @@ If you're once checkout source - you not need to do it again
* Make sure that similar issue not exists already * Make sure that similar issue not exists already
* Please fill [issue form](https://git.xjboss.net/KC-RELOADED/KCauldronX/issues/new) else * Please fill [issue form](https://git.xjboss.net/KC-RELOADED/KCauldronX/issues/new) else
[donate_img]: https://prok.pw/donate.png [donate_img]: https://git.xjboss.net/static/donate-Bitcoin.svg
[download_url]: https://ci.xjboss.net/job/KCauldronX/ [download_url]: https://pan.baidu.com/s/1i4DHUHR#list/path=/KCauldronX/%23lastSuccessfulBuild
[download_img]: https://prok.pw/download.png [download_img]: https://git.xjboss.net/static/download-latest.svg
[build_status]: https://ci.xjboss.net/job/KCauldronX/badge/icon
[bStats]: https://git.xjboss.net/static/bStats-KCX.svg
[bStats_link]: https://bstats.org/plugin/bukkit/KCauldronX
[yumc_Stats]: https://git.xjboss.net/static/yumc-KCX.svg
[yumc_Stats_link]: http://www.yumc.pw/Home/Statistics/Plugin.html?name=KCauldronX

View File

@ -226,6 +226,7 @@ public class BMetrics {
private void submitData() { private void submitData() {
final JSONObject data = getServerData(); final JSONObject data = getServerData();
JSONArray pluginData = new JSONArray(); JSONArray pluginData = new JSONArray();
pluginData.add(getPluginData());
data.put("plugins", pluginData); data.put("plugins", pluginData);
// Create a new thread for the connection to the bStats server // Create a new thread for the connection to the bStats server
new Thread(new Runnable() { new Thread(new Runnable() {

View File

@ -14,10 +14,7 @@ import java.net.URL;
import java.net.URLConnection; import java.net.URLConnection;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.util.HashMap; import java.util.*;
import java.util.LinkedList;
import java.util.Map;
import java.util.UUID;
import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.eventhandler.EventPriority; import cpw.mods.fml.common.eventhandler.EventPriority;
@ -77,7 +74,7 @@ public class YUMCStatistics {
/** /**
* 线程任务 * 线程任务
*/ */
private volatile Thread task = null; private volatile TimerTask task = null;
/** /**
* 插件使用数据统计 * 插件使用数据统计
@ -192,10 +189,8 @@ public class YUMCStatistics {
if (task != null) { if (task != null) {
return true; return true;
} }
// 开启TPS统计线程
//MinecraftForge.EVENT_BUS.register(timer);
// 开启发送数据线程 // 开启发送数据线程
task = new Thread(new Runnable() { task=(new TimerTask() {
@Override @Override
public void run() { public void run() {
try { try {
@ -207,7 +202,7 @@ public class YUMCStatistics {
} }
} }
}); });
task.start(); new Timer().scheduleAtFixedRate(task,1000*60*5,1000*60*30);
return true; return true;
} }
/** /**