mirror of
https://github.com/GravitLauncher/Launcher
synced 2025-07-07 08:19:45 +03:00
Compare commits
22 commits
e547288335
...
c3aca15738
Author | SHA1 | Date | |
---|---|---|---|
|
c3aca15738 | ||
|
911ca1e69f | ||
|
90f74aaf25 | ||
|
880957fa9b | ||
|
2fea94071b | ||
|
b41e8db336 | ||
|
76570ddbe5 | ||
|
3a160b8124 | ||
|
8fb1dc275c | ||
|
95aed151e7 | ||
|
6934c37a33 | ||
|
5155c470c6 | ||
|
533dcfce14 | ||
|
d2f83d81eb | ||
|
2379398c30 | ||
|
f53c48a5ae | ||
|
394b64e22d | ||
|
7c15742478 | ||
|
d65fffade9 | ||
|
bb6c95ca12 | ||
|
9027987b29 | ||
|
0e1691ee4c |
14 changed files with 135 additions and 63 deletions
1
.github/workflows/push.yml
vendored
1
.github/workflows/push.yml
vendored
|
@ -39,6 +39,7 @@ jobs:
|
||||||
cp LaunchServer.jar ../../../artifacts/LaunchServer.jar
|
cp LaunchServer.jar ../../../artifacts/LaunchServer.jar
|
||||||
cd ../../..
|
cd ../../..
|
||||||
cp ServerWrapper/build/libs/ServerWrapper.jar artifacts/ServerWrapper.jar
|
cp ServerWrapper/build/libs/ServerWrapper.jar artifacts/ServerWrapper.jar
|
||||||
|
cp ServerWrapper/build/libs/ServerWrapper-inline.jar artifacts/ServerWrapperInline.jar
|
||||||
cp LauncherAuthlib/build/libs/LauncherAuthlib.jar artifacts/LauncherAuthlib.jar || true
|
cp LauncherAuthlib/build/libs/LauncherAuthlib.jar artifacts/LauncherAuthlib.jar || true
|
||||||
cp modules/*_module/build/libs/*.jar artifacts/modules || true
|
cp modules/*_module/build/libs/*.jar artifacts/modules || true
|
||||||
cp modules/*_lmodule/build/libs/*.jar artifacts/modules || true
|
cp modules/*_lmodule/build/libs/*.jar artifacts/modules || true
|
||||||
|
|
|
@ -28,6 +28,7 @@ public class DebugMain {
|
||||||
public static String webSocketURL = System.getProperty("launcherdebug.websocket", "ws://localhost:9274/api");
|
public static String webSocketURL = System.getProperty("launcherdebug.websocket", "ws://localhost:9274/api");
|
||||||
public static String projectName = System.getProperty("launcherdebug.projectname", "Minecraft");
|
public static String projectName = System.getProperty("launcherdebug.projectname", "Minecraft");
|
||||||
public static String unlockSecret = System.getProperty("launcherdebug.unlocksecret", "");
|
public static String unlockSecret = System.getProperty("launcherdebug.unlocksecret", "");
|
||||||
|
public static boolean disableConsole = Boolean.getBoolean("launcherdebug.disableConsole");
|
||||||
public static boolean offlineMode = Boolean.getBoolean("launcherdebug.offlinemode");
|
public static boolean offlineMode = Boolean.getBoolean("launcherdebug.offlinemode");
|
||||||
public static boolean disableAutoRefresh = Boolean.getBoolean("launcherdebug.disableautorefresh");
|
public static boolean disableAutoRefresh = Boolean.getBoolean("launcherdebug.disableautorefresh");
|
||||||
public static String[] moduleClasses = System.getProperty("launcherdebug.modules", "").split(",");
|
public static String[] moduleClasses = System.getProperty("launcherdebug.modules", "").split(",");
|
||||||
|
@ -37,6 +38,14 @@ public class DebugMain {
|
||||||
public static void main(String[] args) throws Throwable {
|
public static void main(String[] args) throws Throwable {
|
||||||
LogHelper.printVersion("Launcher");
|
LogHelper.printVersion("Launcher");
|
||||||
LogHelper.printLicense("Launcher");
|
LogHelper.printLicense("Launcher");
|
||||||
|
initialize();
|
||||||
|
LogHelper.debug("Initialization LauncherEngine");
|
||||||
|
LauncherEngine instance = LauncherEngine.newInstance(false, ClientRuntimeProvider.class);
|
||||||
|
instance.start(args);
|
||||||
|
LauncherEngine.exitLauncher(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void initialize() throws Exception {
|
||||||
IS_DEBUG.set(true);
|
IS_DEBUG.set(true);
|
||||||
LogHelper.info("Launcher start in DEBUG mode (Only for developers)");
|
LogHelper.info("Launcher start in DEBUG mode (Only for developers)");
|
||||||
LogHelper.debug("Initialization LauncherConfig");
|
LogHelper.debug("Initialization LauncherConfig");
|
||||||
|
@ -56,7 +65,9 @@ public static void main(String[] args) throws Throwable {
|
||||||
}
|
}
|
||||||
LauncherEngine.modulesManager.initModules(null);
|
LauncherEngine.modulesManager.initModules(null);
|
||||||
LauncherEngine.initGson(LauncherEngine.modulesManager);
|
LauncherEngine.initGson(LauncherEngine.modulesManager);
|
||||||
|
if(!disableConsole) {
|
||||||
ConsoleManager.initConsole();
|
ConsoleManager.initConsole();
|
||||||
|
}
|
||||||
LauncherEngine.modulesManager.invokeEvent(new PreConfigPhase());
|
LauncherEngine.modulesManager.invokeEvent(new PreConfigPhase());
|
||||||
RequestService service;
|
RequestService service;
|
||||||
if (offlineMode) {
|
if (offlineMode) {
|
||||||
|
@ -72,10 +83,6 @@ public static void main(String[] args) throws Throwable {
|
||||||
if(!disableAutoRefresh) {
|
if(!disableAutoRefresh) {
|
||||||
Request.startAutoRefresh();
|
Request.startAutoRefresh();
|
||||||
}
|
}
|
||||||
LogHelper.debug("Initialization LauncherEngine");
|
|
||||||
LauncherEngine instance = LauncherEngine.newInstance(false, ClientRuntimeProvider.class);
|
|
||||||
instance.start(args);
|
|
||||||
LauncherEngine.exitLauncher(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
package pro.gravit.launcher.runtime.debug;
|
||||||
|
|
||||||
|
public class DebugMainInlineInitializer {
|
||||||
|
public static void run() throws Exception {
|
||||||
|
DebugMain.initialize();
|
||||||
|
}
|
||||||
|
}
|
|
@ -116,15 +116,6 @@ private static void realMain(String[] args) throws Throwable {
|
||||||
|
|
||||||
// Verify ClientLauncher sign and classpath
|
// Verify ClientLauncher sign and classpath
|
||||||
LogHelper.debug("Verifying ClientLauncher sign and classpath");
|
LogHelper.debug("Verifying ClientLauncher sign and classpath");
|
||||||
Set<Path> ignoredPath = new HashSet<>();
|
|
||||||
List<Path> classpath = resolveClassPath(ignoredPath, clientDir, params.actions, params.profile)
|
|
||||||
.collect(Collectors.toCollection(ArrayList::new));
|
|
||||||
if(LogHelper.isDevEnabled()) {
|
|
||||||
for(var e : classpath) {
|
|
||||||
LogHelper.dev("Classpath entry %s", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
List<URL> classpathURLs = classpath.stream().map(IOHelper::toURL).toList();
|
|
||||||
// Start client with WatchService monitoring
|
// Start client with WatchService monitoring
|
||||||
RequestService service;
|
RequestService service;
|
||||||
if (params.offlineMode) {
|
if (params.offlineMode) {
|
||||||
|
@ -158,6 +149,18 @@ private static void realMain(String[] args) throws Throwable {
|
||||||
System.load(Paths.get(params.nativesDir).resolve(ClientService.findLibrary(e)).toAbsolutePath().toString());
|
System.load(Paths.get(params.nativesDir).resolve(ClientService.findLibrary(e)).toAbsolutePath().toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Set<Path> ignoredPath = new HashSet<>();
|
||||||
|
if(options.moduleConf != null && options.moduleConf.modulePath != null) {
|
||||||
|
List<Path> resolvedModulePath = resolveClassPath(ignoredPath, clientDir, null, params.profile).toList();
|
||||||
|
}
|
||||||
|
List<Path> classpath = resolveClassPath(ignoredPath, clientDir, params.actions, params.profile)
|
||||||
|
.collect(Collectors.toCollection(ArrayList::new));
|
||||||
|
if(LogHelper.isDevEnabled()) {
|
||||||
|
for(var e : classpath) {
|
||||||
|
LogHelper.dev("Classpath entry %s", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
List<URL> classpathURLs = classpath.stream().map(IOHelper::toURL).toList();
|
||||||
if (classLoaderConfig == ClientProfile.ClassLoaderConfig.LAUNCHER || classLoaderConfig == ClientProfile.ClassLoaderConfig.MODULE) {
|
if (classLoaderConfig == ClientProfile.ClassLoaderConfig.LAUNCHER || classLoaderConfig == ClientProfile.ClassLoaderConfig.MODULE) {
|
||||||
if(JVMHelper.JVM_VERSION <= 11) {
|
if(JVMHelper.JVM_VERSION <= 11) {
|
||||||
launch = new LegacyLaunch();
|
launch = new LegacyLaunch();
|
||||||
|
@ -274,10 +277,12 @@ private static Stream<Path> resolveClassPathStream(Set<Path> ignorePaths, Path c
|
||||||
|
|
||||||
public static Stream<Path> resolveClassPath(Set<Path> ignorePaths, Path clientDir, Set<OptionalAction> actions, ClientProfile profile) throws IOException {
|
public static Stream<Path> resolveClassPath(Set<Path> ignorePaths, Path clientDir, Set<OptionalAction> actions, ClientProfile profile) throws IOException {
|
||||||
Stream<Path> result = resolveClassPathStream(ignorePaths, clientDir, profile.getClassPath());
|
Stream<Path> result = resolveClassPathStream(ignorePaths, clientDir, profile.getClassPath());
|
||||||
|
if(actions != null) {
|
||||||
for (OptionalAction a : actions) {
|
for (OptionalAction a : actions) {
|
||||||
if (a instanceof OptionalActionClassPath)
|
if (a instanceof OptionalActionClassPath)
|
||||||
result = Stream.concat(result, resolveClassPathStream(ignorePaths, clientDir, ((OptionalActionClassPath) a).args));
|
result = Stream.concat(result, resolveClassPathStream(ignorePaths, clientDir, ((OptionalActionClassPath) a).args));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ public final class Version implements Comparable<Version> {
|
||||||
|
|
||||||
public static final int MAJOR = 5;
|
public static final int MAJOR = 5;
|
||||||
public static final int MINOR = 6;
|
public static final int MINOR = 6;
|
||||||
public static final int PATCH = 11;
|
public static final int PATCH = 14;
|
||||||
public static final int BUILD = 1;
|
public static final int BUILD = 1;
|
||||||
public static final Version.Type RELEASE = Type.STABLE;
|
public static final Version.Type RELEASE = Type.STABLE;
|
||||||
public final int major;
|
public final int major;
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
# Modification of the launcher sashok724's v3 from Gravit [](https://travis-ci.com/GravitLauncher/Launcher)
|
# Modification of the launcher sashok724's v3 from Gravit
|
||||||
|
[](https://travis-ci.com/GravitLauncher/Launcher)
|
||||||
|
[](https://discord.gg/b9QG4ygY75)
|
||||||
|
|
||||||
* [Discord channel](https://discord.gg/b9QG4ygY75)
|
* [Discord channel](https://discord.gg/b9QG4ygY75)
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,21 @@ pack project(':LauncherAPI')
|
||||||
exclude 'module-info.class'
|
exclude 'module-info.class'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.register('inlinejar', Jar) {
|
||||||
|
dependsOn configurations.runtimeClasspath
|
||||||
|
from {
|
||||||
|
configurations.runtimeClasspath.filter {! (it.name =~ /gson.*\.jar/ || it.name =~ /error_prone_annotations.*\.jar/)}.collect { it.isDirectory() ? it : zipTree(it) }
|
||||||
|
}
|
||||||
|
from {
|
||||||
|
sourceSets.main.output
|
||||||
|
}
|
||||||
|
archiveClassifier.set('inline')
|
||||||
|
manifest.attributes("Main-Class": mainClassName,
|
||||||
|
"Automatic-Module-Name": "ServerWrapper"
|
||||||
|
)
|
||||||
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||||
|
}
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
serverwrapperapi(MavenPublication) {
|
serverwrapperapi(MavenPublication) {
|
||||||
|
@ -94,4 +109,4 @@ pack project(':LauncherAPI')
|
||||||
sign publishing.publications.serverwrapperapi
|
sign publishing.publications.serverwrapperapi
|
||||||
}
|
}
|
||||||
|
|
||||||
assemble.dependsOn tasks.shadowJar
|
assemble.dependsOn tasks.shadowJar, tasks.inlinejar
|
||||||
|
|
|
@ -25,15 +25,18 @@
|
||||||
import pro.gravit.utils.launch.*;
|
import pro.gravit.utils.launch.*;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
import java.lang.invoke.MethodHandle;
|
import java.lang.invoke.MethodHandle;
|
||||||
import java.lang.invoke.MethodHandles;
|
import java.lang.invoke.MethodHandles;
|
||||||
import java.lang.invoke.MethodType;
|
import java.lang.invoke.MethodType;
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
public class ServerWrapper extends JsonConfigurable<ServerWrapper.Config> {
|
public class ServerWrapper extends JsonConfigurable<ServerWrapper.Config> {
|
||||||
public static final Path configFile = Paths.get(System.getProperty("serverwrapper.configFile", "ServerWrapperConfig.json"));
|
public static final Path configFile = Paths.get(System.getProperty("serverwrapper.configFile", "ServerWrapperConfig.json"));
|
||||||
|
@ -100,31 +103,20 @@ public void getProfiles() throws Exception {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void run(String... args) throws Throwable {
|
|
||||||
|
public void initialize() throws Exception {
|
||||||
initGson();
|
initGson();
|
||||||
AuthRequest.registerProviders();
|
AuthRequest.registerProviders();
|
||||||
GetAvailabilityAuthRequest.registerProviders();
|
GetAvailabilityAuthRequest.registerProviders();
|
||||||
OptionalAction.registerProviders();
|
OptionalAction.registerProviders();
|
||||||
OptionalTrigger.registerProviders();
|
OptionalTrigger.registerProviders();
|
||||||
if (args.length > 0 && args[0].equalsIgnoreCase("setup") && !disableSetup) {
|
|
||||||
LogHelper.debug("Read ServerWrapperConfig.json");
|
LogHelper.debug("Read ServerWrapperConfig.json");
|
||||||
loadConfig();
|
loadConfig();
|
||||||
ServerWrapperSetup setup = new ServerWrapperSetup();
|
|
||||||
setup.run();
|
|
||||||
System.exit(0);
|
|
||||||
}
|
}
|
||||||
if (args.length > 1 && args[0].equalsIgnoreCase("installAuthlib") && !disableSetup) {
|
|
||||||
LogHelper.debug("Read ServerWrapperConfig.json");
|
public void connect() throws Exception {
|
||||||
loadConfig();
|
|
||||||
InstallAuthlib command = new InstallAuthlib();
|
|
||||||
command. run(args[1]);
|
|
||||||
System.exit(0);
|
|
||||||
}
|
|
||||||
LogHelper.debug("Read ServerWrapperConfig.json");
|
|
||||||
loadConfig();
|
|
||||||
config.applyEnv();
|
config.applyEnv();
|
||||||
updateLauncherConfig();
|
updateLauncherConfig();
|
||||||
Launcher.applyLauncherEnv(Objects.requireNonNullElse(config.env, LauncherConfig.LauncherEnvironment.STD));
|
|
||||||
StdWebSocketService service = StdWebSocketService.initWebSockets(config.address).get();
|
StdWebSocketService service = StdWebSocketService.initWebSockets(config.address).get();
|
||||||
service.reconnectCallback = () ->
|
service.reconnectCallback = () ->
|
||||||
{
|
{
|
||||||
|
@ -136,11 +128,6 @@ public void run(String... args) throws Throwable {
|
||||||
LogHelper.error(e);
|
LogHelper.error(e);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if(config.properties != null) {
|
|
||||||
for(Map.Entry<String, String> e : config.properties.entrySet()) {
|
|
||||||
System.setProperty(e.getKey(), e.getValue());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Request.setRequestService(service);
|
Request.setRequestService(service);
|
||||||
if (config.logFile != null) LogHelper.addOutput(IOHelper.newWriter(Paths.get(config.logFile), true));
|
if (config.logFile != null) LogHelper.addOutput(IOHelper.newWriter(Paths.get(config.logFile), true));
|
||||||
{
|
{
|
||||||
|
@ -153,6 +140,47 @@ public void run(String... args) throws Throwable {
|
||||||
if(config.encodedServerEcPublicKey != null) {
|
if(config.encodedServerEcPublicKey != null) {
|
||||||
KeyService.serverEcPublicKey = SecurityHelper.toPublicECDSAKey(config.encodedServerEcPublicKey);
|
KeyService.serverEcPublicKey = SecurityHelper.toPublicECDSAKey(config.encodedServerEcPublicKey);
|
||||||
}
|
}
|
||||||
|
ClientService.nativePath = config.nativesDir;
|
||||||
|
ConfigService.serverName = config.serverName;
|
||||||
|
if(config.configServiceSettings != null) {
|
||||||
|
config.configServiceSettings.apply();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void runCompatClasses() throws Throwable {
|
||||||
|
if(config.compatClasses != null) {
|
||||||
|
for (String e : config.compatClasses) {
|
||||||
|
Class<?> clazz = classLoaderControl == null ? Class.forName(e) : classLoaderControl.getClass(e);
|
||||||
|
MethodHandle runMethod = MethodHandles.lookup().findStatic(clazz, "run", MethodType.methodType(void.class, ClassLoaderControl.class));
|
||||||
|
runMethod.invoke(classLoaderControl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void run(String... args) throws Throwable {
|
||||||
|
initialize();
|
||||||
|
if (args.length > 0 && args[0].equalsIgnoreCase("setup") && !disableSetup) {
|
||||||
|
ServerWrapperSetup setup = new ServerWrapperSetup();
|
||||||
|
setup.run();
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
if (args.length > 1 && args[0].equalsIgnoreCase("installAuthlib") && !disableSetup) {
|
||||||
|
InstallAuthlib command = new InstallAuthlib();
|
||||||
|
command. run(args[1]);
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
connect();
|
||||||
|
if(config.properties != null) {
|
||||||
|
for(Map.Entry<String, String> e : config.properties.entrySet()) {
|
||||||
|
System.setProperty(e.getKey(), e.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(config.encodedServerRsaPublicKey != null) {
|
||||||
|
KeyService.serverRsaPublicKey = SecurityHelper.toPublicRSAKey(config.encodedServerRsaPublicKey);
|
||||||
|
}
|
||||||
|
if(config.encodedServerEcPublicKey != null) {
|
||||||
|
KeyService.serverEcPublicKey = SecurityHelper.toPublicECDSAKey(config.encodedServerEcPublicKey);
|
||||||
|
}
|
||||||
String classname = (config.mainclass == null || config.mainclass.isEmpty()) ? args[0] : config.mainclass;
|
String classname = (config.mainclass == null || config.mainclass.isEmpty()) ? args[0] : config.mainclass;
|
||||||
if (classname.isEmpty()) {
|
if (classname.isEmpty()) {
|
||||||
LogHelper.error("MainClass not found. Please set MainClass for ServerWrapper.json or first commandline argument");
|
LogHelper.error("MainClass not found. Please set MainClass for ServerWrapper.json or first commandline argument");
|
||||||
|
@ -182,8 +210,6 @@ public void run(String... args) throws Throwable {
|
||||||
System.arraycopy(args, 1, real_args, 0, args.length - 1);
|
System.arraycopy(args, 1, real_args, 0, args.length - 1);
|
||||||
} else real_args = args;
|
} else real_args = args;
|
||||||
Launch launch;
|
Launch launch;
|
||||||
ClientService.nativePath = config.nativesDir;
|
|
||||||
ConfigService.serverName = config.serverName;
|
|
||||||
if(config.loadNatives != null) {
|
if(config.loadNatives != null) {
|
||||||
for(String e : config.loadNatives) {
|
for(String e : config.loadNatives) {
|
||||||
System.load(Paths.get(config.nativesDir).resolve(ClientService.findLibrary(e)).toAbsolutePath().toString());
|
System.load(Paths.get(config.nativesDir).resolve(ClientService.findLibrary(e)).toAbsolutePath().toString());
|
||||||
|
@ -209,24 +235,27 @@ public void run(String... args) throws Throwable {
|
||||||
LaunchOptions options = new LaunchOptions();
|
LaunchOptions options = new LaunchOptions();
|
||||||
options.enableHacks = config.enableHacks;
|
options.enableHacks = config.enableHacks;
|
||||||
options.moduleConf = config.moduleConf;
|
options.moduleConf = config.moduleConf;
|
||||||
classLoaderControl = launch.init(config.classpath.stream().map(Paths::get).collect(Collectors.toCollection(ArrayList::new)), config.nativesDir, options);
|
classLoaderControl = launch.init(config.classpath.stream()
|
||||||
|
.map(Paths::get)
|
||||||
|
.flatMap(p -> {
|
||||||
|
if(!Files.isDirectory(p)) {
|
||||||
|
return Stream.of(p);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
return Files.walk(p).filter(e -> e.getFileName().toString().endsWith(".jar"));
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.collect(Collectors.toCollection(ArrayList::new)), config.nativesDir, options);
|
||||||
if(ServerAgent.isAgentStarted()) {
|
if(ServerAgent.isAgentStarted()) {
|
||||||
ClientService.instrumentation = ServerAgent.inst;
|
ClientService.instrumentation = ServerAgent.inst;
|
||||||
}
|
}
|
||||||
ClientService.classLoaderControl = classLoaderControl;
|
ClientService.classLoaderControl = classLoaderControl;
|
||||||
ClientService.baseURLs = classLoaderControl.getURLs();
|
ClientService.baseURLs = classLoaderControl.getURLs();
|
||||||
if(config.configServiceSettings != null) {
|
|
||||||
config.configServiceSettings.apply();
|
|
||||||
}
|
|
||||||
LogHelper.info("Start Minecraft Server");
|
LogHelper.info("Start Minecraft Server");
|
||||||
try {
|
try {
|
||||||
if(config.compatClasses != null) {
|
runCompatClasses();
|
||||||
for (String e : config.compatClasses) {
|
|
||||||
Class<?> clazz = classLoaderControl.getClass(e);
|
|
||||||
MethodHandle runMethod = MethodHandles.lookup().findStatic(clazz, "run", MethodType.methodType(void.class, ClassLoaderControl.class));
|
|
||||||
runMethod.invoke(classLoaderControl);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
LogHelper.debug("Invoke main method %s with %s", classname, launch.getClass().getName());
|
LogHelper.debug("Invoke main method %s with %s", classname, launch.getClass().getName());
|
||||||
launch.launch(config.mainclass, config.mainmodule, Arrays.asList(real_args));
|
launch.launch(config.mainclass, config.mainmodule, Arrays.asList(real_args));
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
package pro.gravit.launcher.server;
|
||||||
|
|
||||||
|
public class ServerWrapperInlineInitializer {
|
||||||
|
public static void run() throws Throwable {
|
||||||
|
ServerWrapper.wrapper = new ServerWrapper(ServerWrapper.Config.class, ServerWrapper.configFile);
|
||||||
|
ServerWrapper.wrapper.initialize();
|
||||||
|
ServerWrapper.wrapper.connect();
|
||||||
|
ServerWrapper.wrapper.runCompatClasses();
|
||||||
|
}
|
||||||
|
}
|
|
@ -5,7 +5,7 @@
|
||||||
id 'org.openjfx.javafxplugin' version '0.1.0' apply false
|
id 'org.openjfx.javafxplugin' version '0.1.0' apply false
|
||||||
}
|
}
|
||||||
group = 'pro.gravit.launcher'
|
group = 'pro.gravit.launcher'
|
||||||
version = '5.6.11'
|
version = '5.6.14'
|
||||||
|
|
||||||
apply from: 'props.gradle'
|
apply from: 'props.gradle'
|
||||||
|
|
||||||
|
@ -71,10 +71,6 @@
|
||||||
repositories {
|
repositories {
|
||||||
maven {
|
maven {
|
||||||
url = version.endsWith('SNAPSHOT') ? getProperty('mavenSnapshotRepository') : getProperty('mavenReleaseRepository')
|
url = version.endsWith('SNAPSHOT') ? getProperty('mavenSnapshotRepository') : getProperty('mavenReleaseRepository')
|
||||||
credentials {
|
|
||||||
username getProperty('mavenUsername')
|
|
||||||
password getProperty('mavenPassword')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -1,6 +1,6 @@
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|
2
gradlew
vendored
2
gradlew
vendored
|
@ -205,7 +205,7 @@ fi
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
# Collect all arguments for the java command:
|
# Collect all arguments for the java command:
|
||||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||||
# and any embedded shellness will be escaped.
|
# and any embedded shellness will be escaped.
|
||||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||||
# treated as '${Hostname}' itself on the command line.
|
# treated as '${Hostname}' itself on the command line.
|
||||||
|
|
2
modules
2
modules
|
@ -1 +1 @@
|
||||||
Subproject commit 03804a3a0e638f05c9ce65c01dbdb2f6c9ae630c
|
Subproject commit a2c3ccecadb7f864039b88e6269583c4b77fba13
|
Loading…
Reference in a new issue