Update to sos!engine v1-alpha5
This commit is contained in:
parent
e12597e834
commit
7a5c719210
5 changed files with 31 additions and 15 deletions
|
@ -52,13 +52,14 @@ public final class EngineBootstrapper {
|
||||||
/**
|
/**
|
||||||
* Initializes the engine and environment.
|
* Initializes the engine and environment.
|
||||||
*
|
*
|
||||||
* @param disableMultithreading disables multithreading support (except for logging), if enabled
|
* @param disableMultithreading disables multithreading support (except for logging)
|
||||||
|
* @param disableClasspathScanning disables classpath scanning support
|
||||||
* @param shutdownHandler {@link ShutdownHandler} implementation, which should ideally shutdown the server
|
* @param shutdownHandler {@link ShutdownHandler} implementation, which should ideally shutdown the server
|
||||||
* @param loggingAdapter {@link LoggingAdapter} implementation, for printing log messages into the server console
|
* @param loggingAdapter {@link LoggingAdapter} implementation, for printing log messages into the server console
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
||||||
public static void initialize(boolean disableMultithreading, @NotNull ShutdownHandler shutdownHandler, @NotNull LoggingAdapter loggingAdapter) {
|
public static void initialize(boolean disableMultithreading, boolean disableClasspathScanning, @NotNull ShutdownHandler shutdownHandler, @NotNull LoggingAdapter loggingAdapter) {
|
||||||
overwriteSystemProperties(disableMultithreading); // Overwrites certain system properties to overwrite the engine configuration
|
overwriteSystemProperties(disableMultithreading, disableClasspathScanning); // Overwrites certain system properties to overwrite the engine configuration
|
||||||
Logger.setLoggingAdapter(loggingAdapter); // Install logging adapter
|
Logger.setLoggingAdapter(loggingAdapter); // Install logging adapter
|
||||||
new Engine(); // Initialize engine
|
new Engine(); // Initialize engine
|
||||||
configureEngineShutdown(shutdownHandler); // Configures how the engine shuts itself down
|
configureEngineShutdown(shutdownHandler); // Configures how the engine shuts itself down
|
||||||
|
@ -69,16 +70,18 @@ public final class EngineBootstrapper {
|
||||||
/**
|
/**
|
||||||
* Overwrites system properties to configure the engine.
|
* Overwrites system properties to configure the engine.
|
||||||
*
|
*
|
||||||
* @param disableMultithreading disables multithreading support if {@code true}
|
* @param disableMultithreading disables multithreading support (except for logging)
|
||||||
|
* @param disableClasspathScanning disables classpath scanning support
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
||||||
private static void overwriteSystemProperties(boolean disableMultithreading) {
|
private static void overwriteSystemProperties(boolean disableMultithreading, boolean disableClasspathScanning) {
|
||||||
System.getProperties().setProperty("sosengine.base.loggerTemplate", "[%log_level% %log_path%%log_metadata%] %log_message_prefix%%log_message%");
|
System.getProperties().setProperty("sosengine.base.loggerTemplate", "[%log_level% %log_path%%log_metadata%] %log_message_prefix%%log_message%");
|
||||||
System.getProperties().setProperty("sosengine.base.optimizeLogging", "true");
|
System.getProperties().setProperty("sosengine.base.optimizeLogging", "true");
|
||||||
System.getProperties().setProperty("sosengine.base.loggerImmediateShutdown", "false");
|
System.getProperties().setProperty("sosengine.base.loggerImmediateShutdown", "false");
|
||||||
System.getProperties().setProperty("sosengine.base.optimizeSubsystemInitialization", "false");
|
|
||||||
if (disableMultithreading)
|
if (disableMultithreading)
|
||||||
System.getProperties().setProperty("sosengine.base.optimizeEvents", "false");
|
System.getProperties().setProperty("sosengine.base.optimizeEvents", "false");
|
||||||
|
if (disableClasspathScanning)
|
||||||
|
System.getProperties().setProperty("sosengine.base.initialForceDisableClasspathScanning", "true");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -20,8 +20,10 @@
|
||||||
package de.staropensource.sosengine.minecraft.command;
|
package de.staropensource.sosengine.minecraft.command;
|
||||||
|
|
||||||
import de.staropensource.sosengine.base.EngineConfiguration;
|
import de.staropensource.sosengine.base.EngineConfiguration;
|
||||||
|
import de.staropensource.sosengine.base.utility.ListFormatter;
|
||||||
import de.staropensource.sosengine.base.utility.Miscellaneous;
|
import de.staropensource.sosengine.base.utility.Miscellaneous;
|
||||||
import de.staropensource.sosengine.base.utility.PlaceholderEngine;
|
import de.staropensource.sosengine.base.utility.PlaceholderEngine;
|
||||||
|
import de.staropensource.sosengine.base.utility.information.EngineInformation;
|
||||||
import de.staropensource.sosengine.base.utility.information.JvmInformation;
|
import de.staropensource.sosengine.base.utility.information.JvmInformation;
|
||||||
import de.staropensource.sosengine.minecraft.SubsystemInformation;
|
import de.staropensource.sosengine.minecraft.SubsystemInformation;
|
||||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||||
|
@ -70,11 +72,14 @@ public class Command {
|
||||||
case "debugEvents" -> String.valueOf(EngineConfiguration.getInstance().isDebugEvents());
|
case "debugEvents" -> String.valueOf(EngineConfiguration.getInstance().isDebugEvents());
|
||||||
case "debugShortcodeConverter" -> String.valueOf(EngineConfiguration.getInstance().isDebugShortcodeConverter());
|
case "debugShortcodeConverter" -> String.valueOf(EngineConfiguration.getInstance().isDebugShortcodeConverter());
|
||||||
|
|
||||||
|
case "initialPerformSubsystemInitialization" -> String.valueOf(EngineConfiguration.getInstance().isInitialPerformSubsystemInitialization());
|
||||||
|
case "initialForceDisableClasspathScanning" -> String.valueOf(EngineConfiguration.getInstance().isInitialForceDisableClasspathScanning());
|
||||||
|
case "initialIncludeSubsystemClasses" -> ListFormatter.formatSet(EngineConfiguration.getInstance().getInitialIncludeSubsystemClasses());
|
||||||
|
|
||||||
case "errorShortcodeConverter" -> String.valueOf(EngineConfiguration.getInstance().isErrorShortcodeConverter());
|
case "errorShortcodeConverter" -> String.valueOf(EngineConfiguration.getInstance().isErrorShortcodeConverter());
|
||||||
|
|
||||||
case "optimizeLogging" -> String.valueOf(EngineConfiguration.getInstance().isOptimizeLogging());
|
case "optimizeLogging" -> String.valueOf(EngineConfiguration.getInstance().isOptimizeLogging());
|
||||||
case "optimizeEvents" -> String.valueOf(EngineConfiguration.getInstance().isOptimizeEvents());
|
case "optimizeEvents" -> String.valueOf(EngineConfiguration.getInstance().isOptimizeEvents());
|
||||||
case "optimizeSubsystemInitialization" -> String.valueOf(EngineConfiguration.getInstance().isOptimizeSubsystemInitialization());
|
|
||||||
|
|
||||||
case "loggerLevel" -> "LogLevel." + EngineConfiguration.getInstance().getLoggerLevel().name();
|
case "loggerLevel" -> "LogLevel." + EngineConfiguration.getInstance().getLoggerLevel().name();
|
||||||
case "loggerTemplate" -> "\"" + EngineConfiguration.getInstance().getLoggerTemplate() + "\"";
|
case "loggerTemplate" -> "\"" + EngineConfiguration.getInstance().getLoggerTemplate() + "\"";
|
||||||
|
@ -107,11 +112,14 @@ public class Command {
|
||||||
case "debugEvents" -> System.getProperties().setProperty("sosengine.base.debugEvents", String.valueOf(newValue));
|
case "debugEvents" -> System.getProperties().setProperty("sosengine.base.debugEvents", String.valueOf(newValue));
|
||||||
case "debugShortcodeConverter" -> System.getProperties().setProperty("sosengine.base.debugShortcodeConverter", String.valueOf(newValue));
|
case "debugShortcodeConverter" -> System.getProperties().setProperty("sosengine.base.debugShortcodeConverter", String.valueOf(newValue));
|
||||||
|
|
||||||
|
case "initialPerformSubsystemInitialization" -> System.getProperties().setProperty("sosengine.base.initialPerformSubsystemInitialization", String.valueOf(newValue));
|
||||||
|
case "initialForceDisableClasspathScanning" -> System.getProperties().setProperty("sosengine.base.initialForceDisableClasspathScanning", String.valueOf(newValue));
|
||||||
|
case "initialIncludeSubsystemClasses" -> System.getProperties().setProperty("sosengine.base.initialIncludeSubsystemClasses", String.valueOf(newValue));
|
||||||
|
|
||||||
case "errorShortcodeConverter" -> System.getProperties().setProperty("sosengine.base.errorShortcodeConverter", String.valueOf(newValue));
|
case "errorShortcodeConverter" -> System.getProperties().setProperty("sosengine.base.errorShortcodeConverter", String.valueOf(newValue));
|
||||||
|
|
||||||
case "optimizeLogging" -> System.getProperties().setProperty("sosengine.base.optimizeLogging", String.valueOf(newValue));
|
case "optimizeLogging" -> System.getProperties().setProperty("sosengine.base.optimizeLogging", String.valueOf(newValue));
|
||||||
case "optimizeEvents" -> System.getProperties().setProperty("sosengine.base.optimizeEvents", String.valueOf(newValue));
|
case "optimizeEvents" -> System.getProperties().setProperty("sosengine.base.optimizeEvents", String.valueOf(newValue));
|
||||||
case "optimizeSubsystemInitialization" -> System.getProperties().setProperty("sosengine.base.optimizeSubsystemInitialization", String.valueOf(newValue));
|
|
||||||
|
|
||||||
case "loggerLevel" -> System.getProperties().setProperty("sosengine.base.loggerLevel", String.valueOf(newValue));
|
case "loggerLevel" -> System.getProperties().setProperty("sosengine.base.loggerLevel", String.valueOf(newValue));
|
||||||
case "loggerTemplate" -> System.getProperties().setProperty("sosengine.base.loggerTemplate", String.valueOf(newValue));
|
case "loggerTemplate" -> System.getProperties().setProperty("sosengine.base.loggerTemplate", String.valueOf(newValue));
|
||||||
|
@ -244,10 +252,10 @@ public class Command {
|
||||||
// Welcome
|
// Welcome
|
||||||
public static final String welcome =
|
public static final String welcome =
|
||||||
"<#d60532><bold>EngineMC " + SubsystemInformation.getVersioningString() + " <italic>(on PaperMC Bukkit)</italic>\n" +
|
"<#d60532><bold>EngineMC " + SubsystemInformation.getVersioningString() + " <italic>(on PaperMC Bukkit)</italic>\n" +
|
||||||
"""
|
"\n" +
|
||||||
<#d60532>This server is running <italic><click:open_url:https://git.staropensource.de/StarOpenSource/EngineMC>EngineMC</click></italic>, a port of the <italic><click:open_url:https://engine.staropensource.de>StarOpenSource Engine</click></italic> to Minecraft.
|
"<#d60532>This server is running <italic><click:open_url:https://git.staropensource.de/StarOpenSource/EngineMC>EngineMC</click></italic>, a port of the <italic><click:open_url:https://engine.staropensource.de>StarOpenSource Engine</click> " + EngineInformation.getVersioningString() + "</italic> to Minecraft.\n" +
|
||||||
|
"\n" +
|
||||||
<#d60532>For a list of all available commands, execute <italic>/enginemc help</italic>""";
|
"<#d60532>For a list of all available commands, execute <italic>/enginemc help</italic>";
|
||||||
|
|
||||||
// Help
|
// Help
|
||||||
public static final String help =
|
public static final String help =
|
||||||
|
|
|
@ -42,7 +42,7 @@ pluginRunTask=2.3.1
|
||||||
# Dependencies
|
# Dependencies
|
||||||
dependencyLombok=1.18.32
|
dependencyLombok=1.18.32
|
||||||
dependencyJetbrainsAnnotations=24.1.0
|
dependencyJetbrainsAnnotations=24.1.0
|
||||||
dependencyStarOpenSourceEngine=1-alpha4
|
dependencyStarOpenSourceEngine=1-alpha5
|
||||||
dependencyAdventure=4.17.0
|
dependencyAdventure=4.17.0
|
||||||
|
|
||||||
# etc
|
# etc
|
||||||
|
|
|
@ -102,6 +102,10 @@ runServer {
|
||||||
// Agree to EULA
|
// Agree to EULA
|
||||||
systemProperty("com.mojang.eula.agree", "true")
|
systemProperty("com.mojang.eula.agree", "true")
|
||||||
|
|
||||||
|
jvmArguments = [
|
||||||
|
'-Xlog:gc'
|
||||||
|
]
|
||||||
|
|
||||||
doFirst {
|
doFirst {
|
||||||
// Disable bStats
|
// Disable bStats
|
||||||
File config = new File(runDirectory.get().getAsFile().getPath() + "/plugins/bStats/config.yml")
|
File config = new File(runDirectory.get().getAsFile().getPath() + "/plugins/bStats/config.yml")
|
||||||
|
|
|
@ -85,6 +85,7 @@ public final class PlatformInitializer extends JavaPlugin {
|
||||||
@Override
|
@Override
|
||||||
public void onLoad() {
|
public void onLoad() {
|
||||||
EngineBootstrapper.initialize(
|
EngineBootstrapper.initialize(
|
||||||
|
true,
|
||||||
true,
|
true,
|
||||||
exitcode -> {
|
exitcode -> {
|
||||||
if (Bukkit.getWorlds().isEmpty()) {
|
if (Bukkit.getWorlds().isEmpty()) {
|
||||||
|
|
Loading…
Reference in a new issue