@Override public void run() { try { AnalyticsSend.postServerInformation(httpClient, serverKey, platform, false); } catch (IOException e) { getLogger().warning("Can't send analytics", e); } } }, 0, 20 * 60 * 60 * 24);
public static void postServerInformation(OkHttpClient client, String serverKey, IBuycraftPlatform platform, boolean onlineMode) throws IOException { Map<String, Object> serverData = new LinkedHashMap<>(); Map<String, Object> pluginData = new LinkedHashMap<>(); // Server data serverData.put("platform", platform.getPlatformInformation().getType().platformName()); serverData.put("platform_version", platform.getPlatformInformation().getVersion()); serverData.put("online_mode", onlineMode); // Plugin data pluginData.put("version", platform.getPluginVersion()); // Combine and send to Buycraft Map<String, Object> keenData = new LinkedHashMap<>(); keenData.put("server", serverData); keenData.put("plugin", pluginData); AnalyticsSend.sendAnalytics(client, serverKey, keenData); } }
@Override public void run() { String fullPlatformVersion = getServer().getVersion(); int start = fullPlatformVersion.indexOf("(MC:"); String pv = fullPlatformVersion.substring(start + 5, fullPlatformVersion.length() - 1); try { AnalyticsSend.postServerInformation(httpClient, serverKey, platform, getServer().getOnlineMode()); } catch (IOException e) { getLogger().log(Level.WARNING, "Can't send analytics", e); } } }, 0, 20 * TimeUnit.DAYS.toSeconds(1));
@Override public void run() { try { AnalyticsSend.postServerInformation(httpClient, serverKey, platform, getProxy().getConfig().isOnlineMode()); } catch (IOException e) { getLogger().log(Level.WARNING, "Can't send analytics", e); } } }, 0, 1, TimeUnit.DAYS);
.execute(() -> { try { AnalyticsSend.postServerInformation(httpClient, configuration.getServerKey(), platform, Sponge.getServer().getOnlineMode()); } catch (IOException e) {