Fixed Crash on lower end servers + Cleanup

This commit is contained in:
RePixelatedMC
2023-11-04 14:35:40 +01:00
parent 5feaa45edf
commit 522de89792
4 changed files with 3 additions and 14 deletions
@@ -61,13 +61,12 @@ public class ServerConfigurator {
long tt = f.getLong("settings.timeout-time"); long tt = f.getLong("settings.timeout-time");
if (tt < TimeUnit.MINUTES.toSeconds(5)) { if (tt < TimeUnit.MINUTES.toSeconds(5)) {
Iris.warn("Updating spigot.yml timeout-time: " + tt + " -> " + TimeUnit.MINUTES.toSeconds(5) + " (5 minutes)"); Iris.warn("Updating spigot.yml timeout-time: " + tt + " -> " + TimeUnit.MINUTES.toSeconds(20) + " (5 minutes)");
Iris.warn("You can disable this change (autoconfigureServer) in Iris settings, then change back the value."); Iris.warn("You can disable this change (autoconfigureServer) in Iris settings, then change back the value.");
f.set("settings.timeout-time", TimeUnit.MINUTES.toSeconds(5)); f.set("settings.timeout-time", TimeUnit.MINUTES.toSeconds(5));
f.save(spigotConfig); f.save(spigotConfig);
} }
} }
private static void increasePaperWatchdog() throws IOException, InvalidConfigurationException { private static void increasePaperWatchdog() throws IOException, InvalidConfigurationException {
File spigotConfig = new File("config/paper-global.yml"); File spigotConfig = new File("config/paper-global.yml");
FileConfiguration f = new YamlConfiguration(); FileConfiguration f = new YamlConfiguration();
@@ -75,7 +74,7 @@ public class ServerConfigurator {
long tt = f.getLong("watchdog.early-warning-delay"); long tt = f.getLong("watchdog.early-warning-delay");
if (tt < TimeUnit.MINUTES.toMillis(3)) { if (tt < TimeUnit.MINUTES.toMillis(3)) {
Iris.warn("Updating paper.yml watchdog early-warning-delay: " + tt + " -> " + TimeUnit.MINUTES.toMillis(3) + " (3 minutes)"); Iris.warn("Updating paper.yml watchdog early-warning-delay: " + tt + " -> " + TimeUnit.MINUTES.toMillis(15) + " (3 minutes)");
Iris.warn("You can disable this change (autoconfigureServer) in Iris settings, then change back the value."); Iris.warn("You can disable this change (autoconfigureServer) in Iris settings, then change back the value.");
f.set("watchdog.early-warning-delay", TimeUnit.MINUTES.toMillis(3)); f.set("watchdog.early-warning-delay", TimeUnit.MINUTES.toMillis(3));
f.save(spigotConfig); f.save(spigotConfig);
@@ -8,7 +8,6 @@ public class IrisSafeguard {
public static void IrisSafeguardSystem() { public static void IrisSafeguardSystem() {
Iris.info("Enabled Iris SafeGuard"); Iris.info("Enabled Iris SafeGuard");
ServerBootSFG.BootCheck(); ServerBootSFG.BootCheck();
PerformanceSFG.calculatePerformance();
} }
} }
@@ -1,5 +1,6 @@
package com.volmit.iris.engine.safeguard; package com.volmit.iris.engine.safeguard;
import com.volmit.iris.core.IrisSettings;
import oshi.SystemInfo; import oshi.SystemInfo;
import oshi.hardware.GlobalMemory; import oshi.hardware.GlobalMemory;
@@ -9,13 +10,6 @@ public class PerformanceSFG {
public static boolean lowPerformance = false; public static boolean lowPerformance = false;
public static void calculatePerformance(){ public static void calculatePerformance(){
if (getCPUModel().contains("Xeon")){
lowPerformance = true;
}
if (getProcessMemory() < 5999){
lowPerformance = true;
}
// Todo RePixelated: Finish this
} }
} }
@@ -37,15 +37,12 @@ public class ServerBootSFG {
for (Plugin plugin : plugins) { for (Plugin plugin : plugins) {
pluginName = plugin.getName(); pluginName = plugin.getName();
Boolean flag = incompatiblePlugins.get(pluginName); Boolean flag = incompatiblePlugins.get(pluginName);
Iris.info("T65: " + pluginName);
if (flag != null && !flag) { if (flag != null && !flag) {
count++; count++;
incompatiblePlugins.put(pluginName, true); incompatiblePlugins.put(pluginName, true);
} }
} }
Iris.info("TEST: " + incompatiblePlugins.get("Multiverse-Core"));
StringJoiner joiner = new StringJoiner(", "); StringJoiner joiner = new StringJoiner(", ");
for (Map.Entry<String, Boolean> entry : incompatiblePlugins.entrySet()) { for (Map.Entry<String, Boolean> entry : incompatiblePlugins.entrySet()) {
if (entry.getValue()) { if (entry.getValue()) {