From 746fdc36e414bffd545130306540884edd201b3a Mon Sep 17 00:00:00 2001 From: Gravit Date: Sun, 10 Feb 2019 15:38:48 +0700 Subject: [PATCH] =?UTF-8?q?[FIX]=20=D0=A3=D0=BD=D0=B8=D1=84=D0=B8=D0=BA?= =?UTF-8?q?=D0=B0=D1=86=D0=B8=D1=8F=20Results?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Launcher/runtime/dialog/dialog.js | 2 +- .../authlib/yggdrasil/CompatBridge.java | 10 ++++----- .../authlib/yggdrasil/LegacyBridge.java | 2 +- .../YggdrasilGameProfileRepository.java | 2 +- .../YggdrasilMinecraftSessionService.java | 6 ++--- .../launcher/request/auth/AuthRequest.java | 22 ++++--------------- .../request/auth/CheckServerRequest.java | 7 +++--- .../request/auth/JoinServerRequest.java | 7 +++--- .../request/update/ProfilesRequest.java | 16 ++++---------- .../uuid/BatchProfileByUsernameRequest.java | 7 +++--- .../request/uuid/ProfileByUUIDRequest.java | 7 +++--- .../uuid/ProfileByUsernameRequest.java | 7 +++--- .../gravit/launcher/server/ServerWrapper.java | 3 ++- .../events/request/AuthRequestEvent.java | 6 +++++ .../BatchProfileByUsernameRequestEvent.java | 8 +++++++ .../events/request/CheckServerEvent.java | 8 +++++++ .../request/ProfileByUUIDRequestEvent.java | 8 +++++-- .../ProfileByUsernameRequestEvent.java | 4 ++-- .../events/request/ProfilesRequestEvent.java | 5 ++++- 19 files changed, 75 insertions(+), 62 deletions(-) diff --git a/Launcher/runtime/dialog/dialog.js b/Launcher/runtime/dialog/dialog.js index b193e69f..3007dea9 100644 --- a/Launcher/runtime/dialog/dialog.js +++ b/Launcher/runtime/dialog/dialog.js @@ -215,7 +215,7 @@ function doAuth(login, rsaPassword) { overlay.show(processing.overlay, function (event) { FunctionalBridge.getHWID.join(); makeAuthRequest(login, rsaPassword, function (result) { - loginData = { pp: result.pp , accessToken: result.accessToken, permissions: result.permissions}; + loginData = { pp: result.playerProfile , accessToken: result.accessToken, permissions: result.permissions}; overlay.hide(0, function () { setCurrentScene(menuScene); diff --git a/LauncherAPI/src/main/java/com/mojang/authlib/yggdrasil/CompatBridge.java b/LauncherAPI/src/main/java/com/mojang/authlib/yggdrasil/CompatBridge.java index b722c10b..8daeda25 100644 --- a/LauncherAPI/src/main/java/com/mojang/authlib/yggdrasil/CompatBridge.java +++ b/LauncherAPI/src/main/java/com/mojang/authlib/yggdrasil/CompatBridge.java @@ -19,26 +19,26 @@ public final class CompatBridge { public static CompatProfile checkServer(String username, String serverID) throws Exception { LogHelper.debug("CompatBridge.checkServer, Username: '%s', Server ID: %s", username, serverID); - return CompatProfile.fromPlayerProfile(new CheckServerRequest(username, serverID).request()); + return CompatProfile.fromPlayerProfile(new CheckServerRequest(username, serverID).request().playerProfile); } public static boolean joinServer(String username, String accessToken, String serverID) throws Exception { // Join server LogHelper.debug("LegacyBridge.joinServer, Username: '%s', Access token: %s, Server ID: %s", username, accessToken, serverID); - return new JoinServerRequest(username, accessToken, serverID).request(); + return new JoinServerRequest(username, accessToken, serverID).request().allow; } public static CompatProfile profileByUsername(String username) throws Exception { - return CompatProfile.fromPlayerProfile(new ProfileByUsernameRequest(username).request()); + return CompatProfile.fromPlayerProfile(new ProfileByUsernameRequest(username).request().playerProfile); } public static CompatProfile profileByUUID(UUID uuid) throws Exception { - return CompatProfile.fromPlayerProfile(new ProfileByUUIDRequest(uuid).request()); + return CompatProfile.fromPlayerProfile(new ProfileByUUIDRequest(uuid).request().playerProfile); } public static CompatProfile[] profilesByUsername(String... usernames) throws Exception { - PlayerProfile[] profiles = new BatchProfileByUsernameRequest(usernames).request(); + PlayerProfile[] profiles = new BatchProfileByUsernameRequest(usernames).request().playerProfiles; // Convert profiles CompatProfile[] resultProfiles = new CompatProfile[profiles.length]; diff --git a/LauncherAPI/src/main/java/com/mojang/authlib/yggdrasil/LegacyBridge.java b/LauncherAPI/src/main/java/com/mojang/authlib/yggdrasil/LegacyBridge.java index 378145e6..aa79f146 100644 --- a/LauncherAPI/src/main/java/com/mojang/authlib/yggdrasil/LegacyBridge.java +++ b/LauncherAPI/src/main/java/com/mojang/authlib/yggdrasil/LegacyBridge.java @@ -32,7 +32,7 @@ public static String joinServer(String username, String accessToken, String serv // Join server LogHelper.debug("LegacyBridge.joinServer, Username: '%s', Access token: %s, Server ID: %s", username, accessToken, serverID); try { - return new JoinServerRequest(username, accessToken, serverID).request() ? "OK" : "Bad Login (Clientside)"; + return new JoinServerRequest(username, accessToken, serverID).request().allow ? "OK" : "Bad Login (Clientside)"; } catch (Exception e) { return e.toString(); } diff --git a/LauncherAPI/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java b/LauncherAPI/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java index d869426e..37f330e3 100644 --- a/LauncherAPI/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java +++ b/LauncherAPI/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java @@ -43,7 +43,7 @@ public void findProfilesByNames(String[] usernames, Agent agent, ProfileLookupCa // Batch Username-To-UUID request PlayerProfile[] sliceProfiles; try { - sliceProfiles = new BatchProfileByUsernameRequest(sliceUsernames).request(); + sliceProfiles = new BatchProfileByUsernameRequest(sliceUsernames).request().playerProfiles; } catch (Exception e) { for (String username : sliceUsernames) { LogHelper.debug("Couldn't find profile '%s': %s", username, e); diff --git a/LauncherAPI/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilMinecraftSessionService.java b/LauncherAPI/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilMinecraftSessionService.java index 3328195f..a13032ce 100644 --- a/LauncherAPI/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilMinecraftSessionService.java +++ b/LauncherAPI/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilMinecraftSessionService.java @@ -98,7 +98,7 @@ public GameProfile fillProfileProperties(GameProfile profile, boolean requireSec // Make profile request PlayerProfile pp; try { - pp = new ProfileByUUIDRequest(uuid).request(); + pp = new ProfileByUUIDRequest(uuid).request().playerProfile; } catch (Exception e) { LogHelper.debug("Couldn't fetch profile properties for '%s': %s", profile, e); return profile; @@ -155,7 +155,7 @@ public GameProfile hasJoinedServer(GameProfile profile, String serverID) throws // Make checkServer request PlayerProfile pp; try { - pp = new CheckServerRequest(username, serverID).request(); + pp = new CheckServerRequest(username, serverID).request().playerProfile; } catch (Exception e) { LogHelper.error(e); throw new AuthenticationUnavailableException(e); @@ -184,7 +184,7 @@ public void joinServer(GameProfile profile, String accessToken, String serverID) // Make joinServer request boolean success; try { - success = new JoinServerRequest(username, accessToken, serverID).request(); + success = new JoinServerRequest(username, accessToken, serverID).request().allow; } catch (Exception e) { throw new AuthenticationUnavailableException(e); } diff --git a/LauncherAPI/src/main/java/ru/gravit/launcher/request/auth/AuthRequest.java b/LauncherAPI/src/main/java/ru/gravit/launcher/request/auth/AuthRequest.java index 22929b0f..6050385a 100644 --- a/LauncherAPI/src/main/java/ru/gravit/launcher/request/auth/AuthRequest.java +++ b/LauncherAPI/src/main/java/ru/gravit/launcher/request/auth/AuthRequest.java @@ -1,10 +1,10 @@ package ru.gravit.launcher.request.auth; import ru.gravit.launcher.*; +import ru.gravit.launcher.events.request.AuthRequestEvent; import ru.gravit.launcher.profiles.PlayerProfile; import ru.gravit.launcher.request.Request; import ru.gravit.launcher.request.RequestType; -import ru.gravit.launcher.request.auth.AuthRequest.Result; import ru.gravit.launcher.serialize.HInput; import ru.gravit.launcher.serialize.HOutput; import ru.gravit.launcher.serialize.SerializeLimits; @@ -13,21 +13,7 @@ import java.io.IOException; -public final class AuthRequest extends Request { - public static final class Result { - @LauncherAPI - public final PlayerProfile pp; - @LauncherAPI - public final String accessToken; - @LauncherAPI - public final ClientPermissions permissions; - - private Result(PlayerProfile pp, String accessToken, ClientPermissions permissions) { - this.pp = pp; - this.accessToken = accessToken; - this.permissions = permissions; - } - } +public final class AuthRequest extends Request { private final String login; @@ -102,7 +88,7 @@ public String getType() { } }*/ @Override - protected Result requestDo(HInput input, HOutput output) throws IOException { + protected AuthRequestEvent requestDo(HInput input, HOutput output) throws IOException { /*try { LegacyRequestBridge.sendRequest(new EchoRequest("Hello World!")); } catch (InterruptedException e) { @@ -126,6 +112,6 @@ protected Result requestDo(HInput input, HOutput output) throws IOException { PlayerProfile pp = new PlayerProfile(input); String accessToken = input.readASCII(-SecurityHelper.TOKEN_STRING_LENGTH); ClientPermissions permissions = new ClientPermissions(input); - return new Result(pp, accessToken, permissions); + return new AuthRequestEvent(pp, accessToken, permissions); } } diff --git a/LauncherAPI/src/main/java/ru/gravit/launcher/request/auth/CheckServerRequest.java b/LauncherAPI/src/main/java/ru/gravit/launcher/request/auth/CheckServerRequest.java index fff01495..80b214ba 100644 --- a/LauncherAPI/src/main/java/ru/gravit/launcher/request/auth/CheckServerRequest.java +++ b/LauncherAPI/src/main/java/ru/gravit/launcher/request/auth/CheckServerRequest.java @@ -3,6 +3,7 @@ import ru.gravit.launcher.Launcher; import ru.gravit.launcher.LauncherAPI; import ru.gravit.launcher.LauncherConfig; +import ru.gravit.launcher.events.request.CheckServerEvent; import ru.gravit.launcher.profiles.PlayerProfile; import ru.gravit.launcher.request.Request; import ru.gravit.launcher.request.RequestType; @@ -14,7 +15,7 @@ import java.io.IOException; -public final class CheckServerRequest extends Request { +public final class CheckServerRequest extends Request { private final String username; private final String serverID; @@ -36,7 +37,7 @@ public Integer getType() { } @Override - protected PlayerProfile requestDo(HInput input, HOutput output) throws IOException { + protected CheckServerEvent requestDo(HInput input, HOutput output) throws IOException { output.writeString(username, SerializeLimits.MAX_LOGIN); output.writeASCII(serverID, SerializeLimits.MAX_SERVERID); // 1 char for minus sign if (Launcher.profile == null) { @@ -48,6 +49,6 @@ protected PlayerProfile requestDo(HInput input, HOutput output) throws IOExcepti // Read response readError(input); - return input.readBoolean() ? new PlayerProfile(input) : null; + return input.readBoolean() ? new CheckServerEvent(new PlayerProfile(input)) : null; } } diff --git a/LauncherAPI/src/main/java/ru/gravit/launcher/request/auth/JoinServerRequest.java b/LauncherAPI/src/main/java/ru/gravit/launcher/request/auth/JoinServerRequest.java index 264d9819..8ff35b46 100644 --- a/LauncherAPI/src/main/java/ru/gravit/launcher/request/auth/JoinServerRequest.java +++ b/LauncherAPI/src/main/java/ru/gravit/launcher/request/auth/JoinServerRequest.java @@ -2,6 +2,7 @@ import ru.gravit.launcher.LauncherAPI; import ru.gravit.launcher.LauncherConfig; +import ru.gravit.launcher.events.request.JoinServerRequestEvent; import ru.gravit.launcher.request.Request; import ru.gravit.launcher.request.RequestType; import ru.gravit.launcher.serialize.HInput; @@ -12,7 +13,7 @@ import java.io.IOException; -public final class JoinServerRequest extends Request { +public final class JoinServerRequest extends Request { // Instance private final String username; @@ -38,7 +39,7 @@ public Integer getType() { } @Override - protected Boolean requestDo(HInput input, HOutput output) throws IOException { + protected JoinServerRequestEvent requestDo(HInput input, HOutput output) throws IOException { output.writeString(username, SerializeLimits.MAX_LOGIN); output.writeASCII(accessToken, -SecurityHelper.TOKEN_STRING_LENGTH); output.writeASCII(serverID, SerializeLimits.MAX_SERVERID); // 1 char for minus sign @@ -46,7 +47,7 @@ protected Boolean requestDo(HInput input, HOutput output) throws IOException { // Read response readError(input); - return input.readBoolean(); + return new JoinServerRequestEvent(input.readBoolean()); } } diff --git a/LauncherAPI/src/main/java/ru/gravit/launcher/request/update/ProfilesRequest.java b/LauncherAPI/src/main/java/ru/gravit/launcher/request/update/ProfilesRequest.java index 9c0d079d..3c8a3104 100644 --- a/LauncherAPI/src/main/java/ru/gravit/launcher/request/update/ProfilesRequest.java +++ b/LauncherAPI/src/main/java/ru/gravit/launcher/request/update/ProfilesRequest.java @@ -3,6 +3,7 @@ import ru.gravit.launcher.Launcher; import ru.gravit.launcher.LauncherAPI; import ru.gravit.launcher.LauncherConfig; +import ru.gravit.launcher.events.request.ProfilesRequestEvent; import ru.gravit.launcher.profiles.ClientProfile; import ru.gravit.launcher.request.Request; import ru.gravit.launcher.request.RequestType; @@ -13,16 +14,7 @@ import java.util.Collections; import java.util.List; -public final class ProfilesRequest extends Request { - - public static final class Result { - @LauncherAPI - public final List profiles; - - private Result(List profiles) { - this.profiles = Collections.unmodifiableList(profiles); - } - } +public final class ProfilesRequest extends Request { @LauncherAPI public ProfilesRequest() { @@ -40,7 +32,7 @@ public Integer getType() { } @Override - protected Result requestDo(HInput input, HOutput output) throws Exception { + protected ProfilesRequestEvent requestDo(HInput input, HOutput output) throws Exception { output.writeBoolean(true); output.flush(); readError(input); @@ -52,6 +44,6 @@ protected Result requestDo(HInput input, HOutput output) throws Exception { profiles.add(Launcher.gson.fromJson(prof, ClientProfile.class)); } // Return request result - return new Result(profiles); + return new ProfilesRequestEvent(profiles); } } diff --git a/LauncherAPI/src/main/java/ru/gravit/launcher/request/uuid/BatchProfileByUsernameRequest.java b/LauncherAPI/src/main/java/ru/gravit/launcher/request/uuid/BatchProfileByUsernameRequest.java index 282489b9..f7a43a61 100644 --- a/LauncherAPI/src/main/java/ru/gravit/launcher/request/uuid/BatchProfileByUsernameRequest.java +++ b/LauncherAPI/src/main/java/ru/gravit/launcher/request/uuid/BatchProfileByUsernameRequest.java @@ -2,6 +2,7 @@ import ru.gravit.launcher.LauncherAPI; import ru.gravit.launcher.LauncherConfig; +import ru.gravit.launcher.events.request.BatchProfileByUsernameRequestEvent; import ru.gravit.launcher.profiles.PlayerProfile; import ru.gravit.launcher.request.Request; import ru.gravit.launcher.request.RequestType; @@ -13,7 +14,7 @@ import java.io.IOException; -public final class BatchProfileByUsernameRequest extends Request { +public final class BatchProfileByUsernameRequest extends Request { private final String[] usernames; @LauncherAPI @@ -36,7 +37,7 @@ public Integer getType() { } @Override - protected PlayerProfile[] requestDo(HInput input, HOutput output) throws IOException { + protected BatchProfileByUsernameRequestEvent requestDo(HInput input, HOutput output) throws IOException { output.writeLength(usernames.length, SerializeLimits.MAX_BATCH_SIZE); for (String username : usernames) { output.writeString(username, SerializeLimits.MAX_LOGIN); @@ -50,6 +51,6 @@ protected PlayerProfile[] requestDo(HInput input, HOutput output) throws IOExcep profiles[i] = input.readBoolean() ? new PlayerProfile(input) : null; // Return result - return profiles; + return new BatchProfileByUsernameRequestEvent(profiles); } } diff --git a/LauncherAPI/src/main/java/ru/gravit/launcher/request/uuid/ProfileByUUIDRequest.java b/LauncherAPI/src/main/java/ru/gravit/launcher/request/uuid/ProfileByUUIDRequest.java index 2199890f..f9f8cf69 100644 --- a/LauncherAPI/src/main/java/ru/gravit/launcher/request/uuid/ProfileByUUIDRequest.java +++ b/LauncherAPI/src/main/java/ru/gravit/launcher/request/uuid/ProfileByUUIDRequest.java @@ -3,6 +3,7 @@ import ru.gravit.launcher.Launcher; import ru.gravit.launcher.LauncherAPI; import ru.gravit.launcher.LauncherConfig; +import ru.gravit.launcher.events.request.ProfileByUUIDRequestEvent; import ru.gravit.launcher.profiles.PlayerProfile; import ru.gravit.launcher.request.Request; import ru.gravit.launcher.request.RequestType; @@ -14,7 +15,7 @@ import java.util.Objects; import java.util.UUID; -public final class ProfileByUUIDRequest extends Request { +public final class ProfileByUUIDRequest extends Request { private final UUID uuid; @LauncherAPI @@ -34,12 +35,12 @@ public Integer getType() { } @Override - protected PlayerProfile requestDo(HInput input, HOutput output) throws IOException { + protected ProfileByUUIDRequestEvent requestDo(HInput input, HOutput output) throws IOException { output.writeUUID(uuid); output.writeString(Launcher.profile.getTitle(), SerializeLimits.MAX_CLIENT); output.flush(); // Return profile - return input.readBoolean() ? new PlayerProfile(input) : null; + return input.readBoolean() ? new ProfileByUUIDRequestEvent(new PlayerProfile(input)) : null; } } diff --git a/LauncherAPI/src/main/java/ru/gravit/launcher/request/uuid/ProfileByUsernameRequest.java b/LauncherAPI/src/main/java/ru/gravit/launcher/request/uuid/ProfileByUsernameRequest.java index 2136ef19..1630deb9 100644 --- a/LauncherAPI/src/main/java/ru/gravit/launcher/request/uuid/ProfileByUsernameRequest.java +++ b/LauncherAPI/src/main/java/ru/gravit/launcher/request/uuid/ProfileByUsernameRequest.java @@ -3,6 +3,7 @@ import ru.gravit.launcher.Launcher; import ru.gravit.launcher.LauncherAPI; import ru.gravit.launcher.LauncherConfig; +import ru.gravit.launcher.events.request.ProfileByUsernameRequestEvent; import ru.gravit.launcher.profiles.PlayerProfile; import ru.gravit.launcher.request.Request; import ru.gravit.launcher.request.RequestType; @@ -13,7 +14,7 @@ import java.io.IOException; -public final class ProfileByUsernameRequest extends Request { +public final class ProfileByUsernameRequest extends Request { private final String username; @LauncherAPI @@ -33,11 +34,11 @@ public Integer getType() { } @Override - protected PlayerProfile requestDo(HInput input, HOutput output) throws IOException { + protected ProfileByUsernameRequestEvent requestDo(HInput input, HOutput output) throws IOException { output.writeString(username, SerializeLimits.MAX_LOGIN); output.writeString(Launcher.profile.getTitle(), SerializeLimits.MAX_CLIENT); output.flush(); // Return profile - return input.readBoolean() ? new PlayerProfile(input) : null; + return input.readBoolean() ? new ProfileByUsernameRequestEvent(new PlayerProfile(input)) : null; } } diff --git a/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerWrapper.java b/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerWrapper.java index 8d8f25e4..74bf4a53 100644 --- a/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerWrapper.java +++ b/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerWrapper.java @@ -5,6 +5,7 @@ import ru.gravit.launcher.ClientPermissions; import ru.gravit.launcher.Launcher; import ru.gravit.launcher.LauncherConfig; +import ru.gravit.launcher.events.request.ProfilesRequestEvent; import ru.gravit.launcher.profiles.ClientProfile; import ru.gravit.launcher.request.auth.AuthServerRequest; import ru.gravit.launcher.request.update.ProfilesRequest; @@ -43,7 +44,7 @@ public static boolean auth(ServerWrapper wrapper) { try { LauncherConfig cfg = Launcher.getConfig(); ServerWrapper.permissions = new AuthServerRequest(cfg, config.login, SecurityHelper.newRSAEncryptCipher(cfg.publicKey).doFinal(IOHelper.encode(config.password)), 0, config.title).request(); - ProfilesRequest.Result result = new ProfilesRequest(cfg).request(); + ProfilesRequestEvent result = new ProfilesRequest(cfg).request(); for (ClientProfile p : result.profiles) { LogHelper.debug("Get profile: %s", p.getTitle()); if (p.getTitle().equals(config.title)) { diff --git a/libLauncher/src/main/java/ru/gravit/launcher/events/request/AuthRequestEvent.java b/libLauncher/src/main/java/ru/gravit/launcher/events/request/AuthRequestEvent.java index c378c916..c8c05a2e 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/events/request/AuthRequestEvent.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/events/request/AuthRequestEvent.java @@ -17,6 +17,12 @@ public AuthRequestEvent() { public PlayerProfile playerProfile; public String accessToken; + public AuthRequestEvent(PlayerProfile pp, String accessToken, ClientPermissions permissions) { + this.playerProfile = pp; + this.accessToken = accessToken; + this.permissions = permissions; + } + @Override public UUID getUUID() { return uuid; diff --git a/libLauncher/src/main/java/ru/gravit/launcher/events/request/BatchProfileByUsernameRequestEvent.java b/libLauncher/src/main/java/ru/gravit/launcher/events/request/BatchProfileByUsernameRequestEvent.java index 18806ac1..0b105b20 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/events/request/BatchProfileByUsernameRequestEvent.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/events/request/BatchProfileByUsernameRequestEvent.java @@ -11,6 +11,14 @@ public class BatchProfileByUsernameRequestEvent implements EventInterface, Resul private static final UUID uuid = UUID.fromString("c1d6729e-be2c-48cc-b5ae-af8c012232c3"); public String error; public PlayerProfile[] playerProfiles; + + public BatchProfileByUsernameRequestEvent(PlayerProfile[] profiles) { + this.playerProfiles = profiles; + } + + public BatchProfileByUsernameRequestEvent() { + } + @Override public UUID getUUID() { return uuid; diff --git a/libLauncher/src/main/java/ru/gravit/launcher/events/request/CheckServerEvent.java b/libLauncher/src/main/java/ru/gravit/launcher/events/request/CheckServerEvent.java index 497a9893..e35b2467 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/events/request/CheckServerEvent.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/events/request/CheckServerEvent.java @@ -11,6 +11,14 @@ public class CheckServerEvent implements EventInterface, ResultInterface { public String type = "success"; public UUID uuid; public PlayerProfile playerProfile; + + public CheckServerEvent(PlayerProfile playerProfile) { + this.playerProfile = playerProfile; + } + + public CheckServerEvent() { + } + @Override public UUID getUUID() { return _uuid; diff --git a/libLauncher/src/main/java/ru/gravit/launcher/events/request/ProfileByUUIDRequestEvent.java b/libLauncher/src/main/java/ru/gravit/launcher/events/request/ProfileByUUIDRequestEvent.java index 27c73810..b726696f 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/events/request/ProfileByUUIDRequestEvent.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/events/request/ProfileByUUIDRequestEvent.java @@ -9,12 +9,16 @@ public class ProfileByUUIDRequestEvent implements EventInterface, ResultInterface { private static final UUID uuid = UUID.fromString("b9014cf3-4b95-4d38-8c5f-867f190a18a0"); - String error; - PlayerProfile playerProfile; + public String error; + public PlayerProfile playerProfile; public ProfileByUUIDRequestEvent(PlayerProfile playerProfile) { this.playerProfile = playerProfile; } + + public ProfileByUUIDRequestEvent() { + } + @Override public UUID getUUID() { return uuid; diff --git a/libLauncher/src/main/java/ru/gravit/launcher/events/request/ProfileByUsernameRequestEvent.java b/libLauncher/src/main/java/ru/gravit/launcher/events/request/ProfileByUsernameRequestEvent.java index b85829f1..a3906825 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/events/request/ProfileByUsernameRequestEvent.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/events/request/ProfileByUsernameRequestEvent.java @@ -9,8 +9,8 @@ public class ProfileByUsernameRequestEvent implements EventInterface, ResultInterface { private static final UUID uuid = UUID.fromString("06204302-ff6b-4779-b97d-541e3bc39aa1"); - String error; - PlayerProfile playerProfile; + public String error; + public PlayerProfile playerProfile; public ProfileByUsernameRequestEvent(PlayerProfile playerProfile) { this.playerProfile = playerProfile; diff --git a/libLauncher/src/main/java/ru/gravit/launcher/events/request/ProfilesRequestEvent.java b/libLauncher/src/main/java/ru/gravit/launcher/events/request/ProfilesRequestEvent.java index 3b788f17..21936936 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/events/request/ProfilesRequestEvent.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/events/request/ProfilesRequestEvent.java @@ -10,12 +10,15 @@ public class ProfilesRequestEvent implements EventInterface, ResultInterface { private static final UUID uuid = UUID.fromString("2f26fbdf-598a-46dd-92fc-1699c0e173b1"); - List profiles; + public List profiles; public ProfilesRequestEvent(List profiles) { this.profiles = profiles; } + public ProfilesRequestEvent() { + } + String error; @Override public UUID getUUID() {