mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +03:00
[FIX] Фикс инициализации Guard и ClassCastException
This commit is contained in:
parent
988d220f35
commit
49e26d0d29
2 changed files with 11 additions and 2 deletions
|
@ -113,13 +113,13 @@ public void start(String... args) throws Throwable {
|
|||
}
|
||||
};
|
||||
}
|
||||
LauncherGuardManager.initGuard(false);
|
||||
if(UpdateRequest.getController() == null) UpdateRequest.setController(new LauncherUpdateController());
|
||||
Objects.requireNonNull(args, "args");
|
||||
if (started.getAndSet(true))
|
||||
throw new IllegalStateException("Launcher has been already started");
|
||||
LauncherEngine.modulesManager.invokeEvent(new ClientEngineInitPhase(this));
|
||||
runtimeProvider.preLoad();
|
||||
LauncherGuardManager.initGuard(false);
|
||||
FunctionalBridge.getHWID = CommonHelper.newThread("GetHWID Thread", true, FunctionalBridge::getHWID);
|
||||
FunctionalBridge.getHWID.start();
|
||||
LogHelper.debug("Dir: %s", DirBridge.dir);
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
import javax.net.ssl.SSLException;
|
||||
|
||||
import pro.gravit.launcher.events.ExceptionEvent;
|
||||
import pro.gravit.launcher.events.request.ErrorRequestEvent;
|
||||
import pro.gravit.launcher.request.Request;
|
||||
import pro.gravit.launcher.request.RequestException;
|
||||
|
@ -67,6 +68,10 @@ public WebSocketEvent get() throws InterruptedException, ExecutionException {
|
|||
ErrorRequestEvent errorRequestEvent = (ErrorRequestEvent) event.result;
|
||||
throw new ExecutionException(new RequestException(errorRequestEvent.error));
|
||||
}
|
||||
if (event.result.getType().equals("exception")) {
|
||||
ExceptionEvent error = (ExceptionEvent) event.result;
|
||||
throw new ExecutionException(new RequestException(String.format("LaunchServer fatal error: %s: %s", error.clazz, error.message)));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -80,10 +85,14 @@ public WebSocketEvent get(long timeout, TimeUnit unit) throws InterruptedExcepti
|
|||
}
|
||||
WebSocketEvent result = event.result;
|
||||
waitEventHandler.requests.remove(event);
|
||||
if (event.result.getType().equals("error") || event.result.getType().equals("exception")) {
|
||||
if (event.result.getType().equals("error")) {
|
||||
ErrorRequestEvent errorRequestEvent = (ErrorRequestEvent) event.result;
|
||||
throw new ExecutionException(new RequestException(errorRequestEvent.error));
|
||||
}
|
||||
if (event.result.getType().equals("exception")) {
|
||||
ExceptionEvent error = (ExceptionEvent) event.result;
|
||||
throw new ExecutionException(new RequestException(String.format("LaunchServer fatal error: %s: %s", error.clazz, error.message)));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue