mirror of
https://github.com/DiscordSRV/Ascension.git
synced 2024-12-26 17:18:29 +01:00
Add platform version information to debug reports
This commit is contained in:
parent
cdabd156ca
commit
611f8bba36
@ -25,6 +25,7 @@ import com.discordsrv.common.core.logging.backend.impl.JavaLoggerImpl;
|
||||
import dev.vankka.dependencydownload.classpath.ClasspathAppender;
|
||||
import dev.vankka.dependencydownload.jarinjar.classloader.JarInJarClassLoader;
|
||||
import dev.vankka.mcdependencydownload.bukkit.bootstrap.BukkitBootstrap;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -125,6 +126,12 @@ public class DiscordSRVBukkitBootstrap extends BukkitBootstrap implements IBoots
|
||||
return getPlugin().getDataFolder().toPath();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String platformVersion() {
|
||||
Server server = getPlugin().getServer();
|
||||
return server.getName() + " version " + server.getVersion() + " (implementation version " + server.getBukkitVersion() + ")";
|
||||
}
|
||||
|
||||
public List<Runnable> mainThreadTasksForDisable() {
|
||||
return mainThreadTasksForDisable;
|
||||
}
|
||||
|
@ -25,6 +25,7 @@ import com.discordsrv.common.core.logging.backend.impl.JavaLoggerImpl;
|
||||
import dev.vankka.dependencydownload.classpath.ClasspathAppender;
|
||||
import dev.vankka.dependencydownload.jarinjar.classloader.JarInJarClassLoader;
|
||||
import dev.vankka.mcdependencydownload.bungee.bootstrap.BungeeBootstrap;
|
||||
import net.md_5.bungee.api.ProxyServer;
|
||||
import net.md_5.bungee.api.plugin.Plugin;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -82,4 +83,10 @@ public class DiscordSRVBungeeBootstrap extends BungeeBootstrap implements IBoots
|
||||
public Path dataDirectory() {
|
||||
return getPlugin().getDataFolder().toPath();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String platformVersion() {
|
||||
ProxyServer proxyServer = getPlugin().getProxy();
|
||||
return proxyServer.getName() + " version " + proxyServer.getVersion();
|
||||
}
|
||||
}
|
||||
|
@ -33,5 +33,6 @@ public interface IBootstrap {
|
||||
ClassLoader classLoader();
|
||||
LifecycleManager lifecycleManager();
|
||||
Path dataDirectory();
|
||||
String platformVersion();
|
||||
|
||||
}
|
||||
|
@ -148,6 +148,7 @@ public class DebugReport {
|
||||
private DebugFile environment() {
|
||||
Map<String, Object> values = new LinkedHashMap<>();
|
||||
values.put("discordSRV", discordSRV.getClass().getName());
|
||||
values.put("platformVersion", discordSRV.bootstrap().platformVersion());
|
||||
values.put("version", discordSRV.versionInfo().version());
|
||||
values.put("gitRevision", discordSRV.versionInfo().gitRevision());
|
||||
values.put("gitBranch", discordSRV.versionInfo().gitBranch());
|
||||
|
@ -100,6 +100,11 @@ public class MockDiscordSRV extends AbstractDiscordSRV<IBootstrap, MainConfig, C
|
||||
public Path dataDirectory() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String platformVersion() {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
load();
|
||||
versionInfo = new VersionInfo("JUnit", "JUnit", "JUnit", "JUnit");
|
||||
|
@ -32,6 +32,7 @@ import com.velocitypowered.api.plugin.Plugin;
|
||||
import com.velocitypowered.api.plugin.PluginContainer;
|
||||
import com.velocitypowered.api.plugin.annotation.DataDirectory;
|
||||
import com.velocitypowered.api.proxy.ProxyServer;
|
||||
import com.velocitypowered.api.util.ProxyVersion;
|
||||
import dev.vankka.dependencydownload.classpath.ClasspathAppender;
|
||||
import dev.vankka.mcdependencydownload.velocity.classpath.VelocityClasspathAppender;
|
||||
|
||||
@ -111,6 +112,12 @@ public class DiscordSRVVelocityBootstrap implements IBootstrap {
|
||||
return dataDirectory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String platformVersion() {
|
||||
ProxyVersion version = proxyServer.getVersion();
|
||||
return version.getName() + " (from " + version.getVendor() + ") version " + version.getVersion();
|
||||
}
|
||||
|
||||
public ProxyServer proxyServer() {
|
||||
return proxyServer;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user