From a2af3f8f7e3693f3e445d2998938bf448d47c35f Mon Sep 17 00:00:00 2001 From: MD <1917406+md678685@users.noreply.github.com> Date: Tue, 23 Jun 2020 12:02:43 +0100 Subject: Include platform info in sampler and heap summary data (#58) --- .../spark/bungeecord/BungeeCordPlatformInfo.java | 46 ++++++++++++++++++++++ .../spark/bungeecord/BungeeCordSparkPlugin.java | 6 +++ 2 files changed, 52 insertions(+) create mode 100644 spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/BungeeCordPlatformInfo.java (limited to 'spark-bungeecord/src') diff --git a/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/BungeeCordPlatformInfo.java b/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/BungeeCordPlatformInfo.java new file mode 100644 index 0000000..91a64c4 --- /dev/null +++ b/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/BungeeCordPlatformInfo.java @@ -0,0 +1,46 @@ +/* + * This file is part of spark. + * + * Copyright (c) lucko (Luck) + * Copyright (c) contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package me.lucko.spark.bungeecord; + +import me.lucko.spark.common.PlatformInfo; +import net.md_5.bungee.api.ProxyServer; + +public class BungeeCordPlatformInfo implements PlatformInfo { + @Override + public Type getType() { + return Type.PROXY; + } + + @Override + public String getName() { + return "BungeeCord"; + } + + @Override + public String getVersion() { + return ProxyServer.getInstance().getVersion(); + } + + @Override + public String getMinecraftVersion() { + return null; + } +} diff --git a/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/BungeeCordSparkPlugin.java b/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/BungeeCordSparkPlugin.java index 0fc85b7..ca02c14 100644 --- a/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/BungeeCordSparkPlugin.java +++ b/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/BungeeCordSparkPlugin.java @@ -22,6 +22,7 @@ package me.lucko.spark.bungeecord; import me.lucko.spark.common.SparkPlatform; import me.lucko.spark.common.SparkPlugin; +import me.lucko.spark.common.PlatformInfo; import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.plugin.Command; import net.md_5.bungee.api.plugin.Plugin; @@ -74,6 +75,11 @@ public class BungeeCordSparkPlugin extends Plugin implements SparkPlugin { getProxy().getScheduler().runAsync(BungeeCordSparkPlugin.this, task); } + @Override + public PlatformInfo getPlatformInfo() { + return new BungeeCordPlatformInfo(); + } + private static final class SparkCommand extends Command implements TabExecutor { private final BungeeCordSparkPlugin plugin; -- cgit