2023-12-23 08:05:23 +03:00
|
|
|
package pro.gravit.launcher.start;
|
2018-09-17 10:07:32 +03:00
|
|
|
|
2023-12-23 13:58:09 +03:00
|
|
|
import pro.gravit.launcher.base.Launcher;
|
2023-12-23 08:05:23 +03:00
|
|
|
import pro.gravit.launcher.core.LauncherTrustManager;
|
2023-12-23 13:58:09 +03:00
|
|
|
import pro.gravit.launcher.base.modules.LauncherModule;
|
|
|
|
import pro.gravit.launcher.base.modules.impl.SimpleModuleManager;
|
2019-08-31 15:44:43 +03:00
|
|
|
|
2019-10-19 19:46:04 +03:00
|
|
|
import java.nio.file.Path;
|
2022-07-24 12:24:25 +03:00
|
|
|
import java.util.Collections;
|
|
|
|
import java.util.List;
|
2019-10-19 19:46:04 +03:00
|
|
|
|
2023-07-27 16:03:49 +03:00
|
|
|
public final class RuntimeModuleManager extends SimpleModuleManager {
|
|
|
|
public RuntimeModuleManager() {
|
2019-10-18 15:10:04 +03:00
|
|
|
super(null, null, Launcher.getConfig().trustManager);
|
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
|
|
|
}
|
|
|
|
|
2019-10-18 15:10:04 +03:00
|
|
|
@Override
|
|
|
|
public LauncherModule loadModule(LauncherModule module) {
|
|
|
|
return super.loadModule(module);
|
|
|
|
}
|
|
|
|
|
2022-07-24 12:24:25 +03:00
|
|
|
public List<LauncherModule> getModules() {
|
|
|
|
return Collections.unmodifiableList(modules);
|
|
|
|
}
|
|
|
|
|
2021-01-09 17:06:35 +03:00
|
|
|
@Override
|
2023-12-23 08:25:11 +03:00
|
|
|
public boolean verifyClassCheckResult(LauncherTrustManager.CheckClassResult result) {
|
2021-01-09 17:06:35 +03:00
|
|
|
return result.type == LauncherTrustManager.CheckClassResultType.SUCCESS;
|
|
|
|
}
|
|
|
|
|
2021-04-15 18:02:30 +03:00
|
|
|
public void callWrapper(ClientLauncherWrapper.ClientLauncherWrapperContext context) {
|
2019-10-19 19:46:04 +03:00
|
|
|
for (LauncherModule module : modules) {
|
|
|
|
if (module instanceof ClientWrapperModule) {
|
2021-04-15 18:02:30 +03:00
|
|
|
((ClientWrapperModule) module).wrapperPhase(context);
|
2019-09-17 23:25:59 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-09-17 10:07:32 +03:00
|
|
|
}
|