@Override public PlatformInformation getPlatformInformation() { return new PlatformInformation(PlatformType.NONE, ""); }
@NoBlocking private class Platform extends StandaloneBuycraftPlatform { Platform() {
public String platformName() { return name().toLowerCase(Locale.US); } }
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); } }
writer.println("Server version: " + platform.getPlatformInformation().getType() + " / " + platform.getPlatformInformation().getVersion()); writer.println("Server IP and port: " + ip + " / " + port); writer.println("Online mode: " + serverOnlineMode); writer.println("Platform: " + platform.getPlatformInformation().getType() + " / " + platform.getPlatformInformation().getVersion()); writer.println(); writer.println("Connected to Buycraft? " + (platform.getApiClient() != null));
@Override public PlatformInformation getPlatformInformation() { return new PlatformInformation(PlatformType.NUKKIT, plugin.getServer().getNukkitVersion()); }
@NoBlocking public class BungeeCordBuycraftPlatform implements IBuycraftPlatform { private final BuycraftPlugin plugin;
@Override public PlatformInformation getPlatformInformation() { return new PlatformInformation(PlatformType.BUKKIT, plugin.getServer().getVersion()); }
@Override public PlatformInformation getPlatformInformation() { return new PlatformInformation(PlatformType.BUNGEECORD, plugin.getProxy().getVersion()); }
@Override public PlatformInformation getPlatformInformation() { return new PlatformInformation(PlatformType.SPONGE, Sponge.getPlatform().getImplementation().getName() + " " + Sponge.getPlatform().getImplementation().getVersion().orElse("UNKNOWN")); }