[FEATURE] ClientLaunchPhase event

This commit is contained in:
Gravit 2019-09-20 03:55:34 +07:00
parent f61cf67606
commit 8f42175ad4
No known key found for this signature in database
GPG key ID: 061981E1E85D3216
3 changed files with 14 additions and 6 deletions

View file

@ -39,12 +39,6 @@ public class User {
public String serverID;
private String password_salt;
public long permissions;
//TODO: заменить EAGER на LASY и придумать способ сохранить сессию
// [ERROR] org.hibernate.LazyInitializationException:
// failed to lazily initialize a collection of role: pro.gravit.launchserver.dao.User.hwids, could not initialize proxy - no Session
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@JoinColumn(name = "user_id")
public Collection<UserHWID> hwids;
public void setPassword(String password)
{
password_salt = SecurityHelper.randomStringAESKey();

View file

@ -34,6 +34,7 @@
import pro.gravit.launcher.LauncherEngine;
import pro.gravit.launcher.api.AuthService;
import pro.gravit.launcher.api.ClientService;
import pro.gravit.launcher.client.events.ClientLaunchPhase;
import pro.gravit.launcher.client.events.ClientLauncherInitPhase;
import pro.gravit.launcher.guard.LauncherGuardManager;
import pro.gravit.launcher.gui.JSRuntimeProvider;
@ -543,6 +544,7 @@ public static void main(String... args) throws Throwable {
CommonHelper.newThread("Client Directory Watcher", true, clientWatcher).start();
verifyHDir(params.assetDir, assetHDir, assetMatcher, digest);
verifyHDir(params.clientDir, clientHDir, clientMatcher, digest);
LauncherEngine.modulesManager.invokeEvent(new ClientLaunchPhase(params));
launch(profile, params);
}
}

View file

@ -0,0 +1,12 @@
package pro.gravit.launcher.client.events;
import pro.gravit.launcher.client.ClientLauncher;
import pro.gravit.launcher.modules.LauncherModule;
public class ClientLaunchPhase extends LauncherModule.Event {
public final ClientLauncher.Params params;
public ClientLaunchPhase(ClientLauncher.Params params) {
this.params = params;
}
}