2019-06-02 05:03:08 +03:00
|
|
|
package pro.gravit.launcher.client;
|
2018-09-17 10:07:32 +03:00
|
|
|
|
2019-10-18 15:10:04 +03:00
|
|
|
import pro.gravit.launcher.Launcher;
|
2020-04-05 10:27:04 +03:00
|
|
|
import pro.gravit.launcher.LauncherTrustManager;
|
2019-08-31 15:44:43 +03:00
|
|
|
import pro.gravit.launcher.modules.LauncherModule;
|
|
|
|
import pro.gravit.launcher.modules.impl.SimpleModuleManager;
|
|
|
|
|
2019-10-19 19:46:04 +03:00
|
|
|
import java.nio.file.Path;
|
|
|
|
import java.util.Collection;
|
|
|
|
|
2018-09-17 13:14:59 +03:00
|
|
|
public class ClientModuleManager extends SimpleModuleManager {
|
2019-08-26 14:22:24 +03:00
|
|
|
public ClientModuleManager() {
|
2019-10-18 15:10:04 +03:00
|
|
|
super(null, null, Launcher.getConfig().trustManager);
|
|
|
|
checkMode = LauncherTrustManager.CheckMode.EXCEPTION_IN_NOT_SIGNED;
|
2019-08-26 14:22:24 +03:00
|
|
|
}
|
2019-08-21 14:38:54 +03:00
|
|
|
|
2019-08-26 14:22:24 +03:00
|
|
|
@Override
|
2019-10-19 19:43:25 +03:00
|
|
|
public void autoload() {
|
2019-08-26 14:22:24 +03:00
|
|
|
throw new UnsupportedOperationException();
|
2018-09-17 10:07:32 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2019-10-19 19:43:25 +03:00
|
|
|
public void autoload(Path dir) {
|
2019-08-26 14:22:24 +03:00
|
|
|
throw new UnsupportedOperationException();
|
2018-09-17 10:07:32 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2019-10-19 19:43:25 +03:00
|
|
|
public LauncherModule loadModule(Path file) {
|
2019-08-26 14:22:24 +03:00
|
|
|
throw new UnsupportedOperationException();
|
2018-09-17 10:07:32 +03:00
|
|
|
}
|
2019-10-18 15:10:04 +03:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public LauncherModule loadModule(LauncherModule module) {
|
|
|
|
checkModuleClass(module.getClass(), LauncherTrustManager.CheckMode.EXCEPTION_IN_NOT_SIGNED);
|
|
|
|
return super.loadModule(module);
|
|
|
|
}
|
|
|
|
|
2019-10-19 19:46:04 +03:00
|
|
|
public void callWrapper(ProcessBuilder processBuilder, Collection<String> jvmArgs) {
|
|
|
|
for (LauncherModule module : modules) {
|
|
|
|
if (module instanceof ClientWrapperModule) {
|
2019-09-17 23:25:59 +03:00
|
|
|
((ClientWrapperModule) module).wrapperPhase(processBuilder, jvmArgs);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-09-17 10:07:32 +03:00
|
|
|
}
|