Compare commits

...

6 commits

Author SHA1 Message Date
Gravita
51411c5838
[ANY] Update modules 2024-07-05 14:55:21 +07:00
Gravita
3b22b76278
[FIX] Cleanroom install 2024-07-05 14:55:10 +07:00
Gravita
ef9cbfe0da
[ANY] Update modules 2024-07-05 14:38:57 +07:00
Gravita
353b663e12
[FEATURE] Support command execute by args 2024-07-05 14:38:45 +07:00
Gravita
78be606029
[FIX] FabricLoader main class 2024-07-05 14:27:45 +07:00
Gravita
584acdb8c3
[ANY] Update dependencies 2024-07-05 14:15:22 +07:00
7 changed files with 28 additions and 21 deletions

View file

@ -61,7 +61,6 @@
dependsOn jar dependsOn jar
archiveClassifier.set('clean') archiveClassifier.set('clean')
manifest.attributes("Main-Class": mainClassName, manifest.attributes("Main-Class": mainClassName,
"Premain-Class": mainAgentName,
"Automatic-Module-Name": "launchserver" "Automatic-Module-Name": "launchserver"
) )
from sourceSets.main.output from sourceSets.main.output
@ -71,7 +70,6 @@
dependencies { dependencies {
pack project(':LauncherAPI') pack project(':LauncherAPI')
bundle group: 'me.tongfei', name: 'progressbar', version: '0.10.1' bundle group: 'me.tongfei', name: 'progressbar', version: '0.10.1'
bundle group: 'com.github.Marcono1234', name: 'gson-record-type-adapter-factory', version: 'v0.3.0'
bundle group: 'org.fusesource.jansi', name: 'jansi', version: rootProject['verJansi'] bundle group: 'org.fusesource.jansi', name: 'jansi', version: rootProject['verJansi']
bundle group: 'org.jline', name: 'jline', version: rootProject['verJline'] bundle group: 'org.jline', name: 'jline', version: rootProject['verJline']
bundle group: 'org.jline', name: 'jline-reader', version: rootProject['verJline'] bundle group: 'org.jline', name: 'jline-reader', version: rootProject['verJline']
@ -96,17 +94,12 @@ pack project(':LauncherAPI')
annotationProcessor(group: 'org.apache.logging.log4j', name: 'log4j-core', version: rootProject['verLog4j']) annotationProcessor(group: 'org.apache.logging.log4j', name: 'log4j-core', version: rootProject['verLog4j'])
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter', version: rootProject['verJunit'] testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter', version: rootProject['verJunit']
hikari 'io.micrometer:micrometer-core:1.8.4' hikari 'io.micrometer:micrometer-core:1.13.1'
hikari('com.zaxxer:HikariCP:5.0.1') { hikari('com.zaxxer:HikariCP:5.1.0') {
exclude group: 'javassist' exclude group: 'javassist'
exclude group: 'io.micrometer' exclude group: 'io.micrometer'
exclude group: 'org.slf4j' exclude group: 'org.slf4j'
} }
compileOnlyA group: 'com.google.guava', name: 'guava', version: rootProject['verGuavaC']
// Do not update (laggy deps).
compileOnlyA 'log4j:log4j:1.2.17'
compileOnlyA 'org.apache.logging.log4j:log4j-core:2.14.1'
} }
tasks.register('hikari', Copy) { tasks.register('hikari', Copy) {

View file

@ -34,6 +34,7 @@
import java.nio.file.Path; import java.nio.file.Path;
import java.security.Security; import java.security.Security;
import java.security.cert.CertificateException; import java.security.cert.CertificateException;
import java.util.ArrayList;
import java.util.List; import java.util.List;
public class LaunchServerStarter { public class LaunchServerStarter {
@ -135,7 +136,24 @@ public static void main(String[] args) throws Exception {
.setLaunchServerConfigManager(launchServerConfigManager) .setLaunchServerConfigManager(launchServerConfigManager)
.setCertificateManager(certificateManager) .setCertificateManager(certificateManager)
.build(); .build();
if (!prepareMode) { List<String> allArgs = List.of(args);
boolean isPrepareMode = prepareMode || allArgs.contains("--prepare");
boolean isRunCommand = false;
String runCommand = null;
for(var e : allArgs) {
if(e.equals("--run")) {
isRunCommand = true;
continue;
}
if(isRunCommand) {
runCommand = e;
isRunCommand = false;
}
}
if(runCommand != null) {
localCommandHandler.eval(runCommand, false);
}
if (!isPrepareMode) {
server.run(); server.run();
} else { } else {
server.close(); server.close();

View file

@ -196,6 +196,9 @@ public static String getMainClassByVersion(ClientProfile.Version version, MakePr
if(version.compareTo(ClientProfileVersions.MINECRAFT_1_7_10) == 0) { if(version.compareTo(ClientProfileVersions.MINECRAFT_1_7_10) == 0) {
return "com.gtnewhorizons.retrofuturabootstrap.Main"; return "com.gtnewhorizons.retrofuturabootstrap.Main";
} }
if(version.compareTo(ClientProfileVersions.MINECRAFT_1_12_2) == 0) {
return "top.outlands.foundation.boot.Foundation"; // Cleanroom
}
if (findOption(options, MakeProfileOptionLaunchWrapper.class).isPresent()) { if (findOption(options, MakeProfileOptionLaunchWrapper.class).isPresent()) {
return "net.minecraft.launchwrapper.Launch"; return "net.minecraft.launchwrapper.Launch";
} }
@ -203,7 +206,7 @@ public static String getMainClassByVersion(ClientProfile.Version version, MakePr
return "cpw.mods.modlauncher.Launcher"; return "cpw.mods.modlauncher.Launcher";
} }
if (findOption(options, MakeProfileOptionFabric.class).isPresent()) { if (findOption(options, MakeProfileOptionFabric.class).isPresent()) {
return "net.fabricmc.loader.launch.knot.KnotClient"; return "net.fabricmc.loader.impl.launch.knot.KnotClient";
} }
if(findOption(options, MakeProfilesOptionsQuilt.class).isPresent()) { if(findOption(options, MakeProfilesOptionsQuilt.class).isPresent()) {
return "org.quiltmc.loader.impl.launch.knot.KnotClient"; return "org.quiltmc.loader.impl.launch.knot.KnotClient";

View file

@ -1,7 +1,6 @@
package pro.gravit.launchserver.manangers; package pro.gravit.launchserver.manangers;
import com.google.gson.GsonBuilder; import com.google.gson.GsonBuilder;
import marcono1234.gson.recordadapter.RecordTypeAdapterFactory;
import pro.gravit.launcher.base.events.request.GetAvailabilityAuthRequestEvent; import pro.gravit.launcher.base.events.request.GetAvailabilityAuthRequestEvent;
import pro.gravit.launcher.core.managers.GsonManager; import pro.gravit.launcher.core.managers.GsonManager;
import pro.gravit.launcher.base.modules.events.PreGsonPhase; import pro.gravit.launcher.base.modules.events.PreGsonPhase;
@ -34,9 +33,6 @@ public LaunchServerGsonManager(LaunchServerModulesManager modulesManager) {
@Override @Override
public void registerAdapters(GsonBuilder builder) { public void registerAdapters(GsonBuilder builder) {
super.registerAdapters(builder); super.registerAdapters(builder);
builder.registerTypeAdapterFactory(RecordTypeAdapterFactory.builder()
.allowMissingComponentValues()
.create());
builder.registerTypeAdapter(ClientProfile.Version.class, new ClientProfile.Version.GsonSerializer()); builder.registerTypeAdapter(ClientProfile.Version.class, new ClientProfile.Version.GsonSerializer());
builder.registerTypeAdapter(TextureProvider.class, new UniversalJsonAdapter<>(TextureProvider.providers)); builder.registerTypeAdapter(TextureProvider.class, new UniversalJsonAdapter<>(TextureProvider.providers));
builder.registerTypeAdapter(AuthCoreProvider.class, new UniversalJsonAdapter<>(AuthCoreProvider.providers)); builder.registerTypeAdapter(AuthCoreProvider.class, new UniversalJsonAdapter<>(AuthCoreProvider.providers));

View file

@ -6,7 +6,6 @@
compileOnly group: 'org.jline', name: 'jline', version: rootProject['verJline'] compileOnly group: 'org.jline', name: 'jline', version: rootProject['verJline']
compileOnly group: 'org.jline', name: 'jline-reader', version: rootProject['verJline'] compileOnly group: 'org.jline', name: 'jline-reader', version: rootProject['verJline']
compileOnly group: 'org.jline', name: 'jline-terminal', version: rootProject['verJline'] compileOnly group: 'org.jline', name: 'jline-terminal', version: rootProject['verJline']
compileOnly group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: rootProject['verBcprov']
compileOnly group: 'org.slf4j', name: 'slf4j-api', version: rootProject['verSlf4j'] compileOnly group: 'org.slf4j', name: 'slf4j-api', version: rootProject['verSlf4j']
api group: 'com.google.code.gson', name: 'gson', version: rootProject['verGson'] api group: 'com.google.code.gson', name: 'gson', version: rootProject['verGson']
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter', version: rootProject['verJunit'] testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter', version: rootProject['verJunit']

@ -1 +1 @@
Subproject commit a52b9cc8552445167b95e8933f4289bbaa70677d Subproject commit cd2e4cbcec932601e4f6814b92da5ee9edf9f8dc

View file

@ -1,18 +1,16 @@
project.ext { project.ext {
verAsm = '9.7' verAsm = '9.7'
verNetty = '4.1.110.Final' verNetty = '4.1.111.Final'
verOshiCore = '6.6.1' verOshiCore = '6.6.1'
verJunit = '5.10.2' verJunit = '5.10.2'
verGuavaC = '30.1.1-jre'
verJansi = '2.4.1' verJansi = '2.4.1'
verJline = '3.26.1' verJline = '3.26.1'
verJwt = '0.12.5' verJwt = '0.12.5'
verBcprov = '1.70'
verGson = '2.11.0' verGson = '2.11.0'
verBcpkix = '1.78.1' verBcpkix = '1.78.1'
verSlf4j = '2.0.13' verSlf4j = '2.0.13'
verLog4j = '2.23.1' verLog4j = '2.23.1'
verMySQLConn = '8.4.0' verMySQLConn = '9.0.0'
verMariaDBConn = '3.4.0' verMariaDBConn = '3.4.0'
verPostgreSQLConn = '42.7.3' verPostgreSQLConn = '42.7.3'
verH2Conn = '2.2.224' verH2Conn = '2.2.224'