diff --git a/LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/ClientWebSocketService.java b/LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/ClientWebSocketService.java index 6c770a25..b343e34b 100644 --- a/LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/ClientWebSocketService.java +++ b/LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/ClientWebSocketService.java @@ -4,6 +4,7 @@ import com.google.gson.GsonBuilder; import ru.gravit.launcher.hasher.HashedEntry; import ru.gravit.launcher.hasher.HashedEntryAdapter; +import ru.gravit.launcher.request.ResultInterface; import java.io.IOException; import java.io.Reader; diff --git a/LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/JsonResultAdapter.java b/LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/JsonResultAdapter.java index babe8b78..1ddd605d 100644 --- a/LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/JsonResultAdapter.java +++ b/LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/JsonResultAdapter.java @@ -1,7 +1,7 @@ package ru.gravit.launcher.request.websockets; import com.google.gson.*; -import ru.gravit.launcher.request.update.LauncherRequest; +import ru.gravit.launcher.request.ResultInterface; import java.lang.reflect.Type; diff --git a/LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/WaitEventHandler.java b/LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/WaitEventHandler.java index 364e7299..4dd1fc61 100644 --- a/LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/WaitEventHandler.java +++ b/LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/WaitEventHandler.java @@ -1,5 +1,7 @@ package ru.gravit.launcher.request.websockets; +import ru.gravit.launcher.request.ResultInterface; + import java.util.HashSet; public class WaitEventHandler implements ClientWebSocketService.EventHandler { 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 4610afa6..c378c916 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 @@ -2,11 +2,12 @@ import ru.gravit.launcher.ClientPermissions; import ru.gravit.launcher.profiles.PlayerProfile; +import ru.gravit.launcher.request.ResultInterface; import ru.gravit.utils.event.EventInterface; import java.util.UUID; -public class AuthRequestEvent implements EventInterface { +public class AuthRequestEvent implements EventInterface, ResultInterface { private static final UUID uuid = UUID.fromString("77e1bfd7-adf9-4f5d-87d6-a7dd068deb74"); public AuthRequestEvent() { } @@ -20,4 +21,9 @@ public AuthRequestEvent() { public UUID getUUID() { return uuid; } + + @Override + public String getType() { + return "auth"; + } } 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 cf121936..f048fb56 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 @@ -1,11 +1,12 @@ package ru.gravit.launcher.events.request; import ru.gravit.launcher.profiles.PlayerProfile; +import ru.gravit.launcher.request.ResultInterface; import ru.gravit.utils.event.EventInterface; import java.util.UUID; -public class BatchProfileByUsernameRequestEvent implements EventInterface +public class BatchProfileByUsernameRequestEvent implements EventInterface, ResultInterface { private static final UUID uuid = UUID.fromString("c1d6729e-be2c-48cc-b5ae-af8c012232c3"); public String requesttype = "batchProfileByUsername"; @@ -15,4 +16,9 @@ public class BatchProfileByUsernameRequestEvent implements EventInterface public UUID getUUID() { return uuid; } + + @Override + public String getType() { + return "batchProfileByUsername"; + } } 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 3b2fbcb0..227bde2b 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 @@ -1,11 +1,12 @@ package ru.gravit.launcher.events.request; import ru.gravit.launcher.profiles.PlayerProfile; +import ru.gravit.launcher.request.ResultInterface; import ru.gravit.utils.event.EventInterface; import java.util.UUID; -public class CheckServerEvent implements EventInterface { +public class CheckServerEvent implements EventInterface, ResultInterface { private static final UUID _uuid = UUID.fromString("8801d07c-51ba-4059-b61d-fe1f1510b28a"); public String type = "success"; public String requesttype = "checkServer"; @@ -15,4 +16,9 @@ public class CheckServerEvent implements EventInterface { public UUID getUUID() { return _uuid; } + + @Override + public String getType() { + return "checkServe"; + } } diff --git a/libLauncher/src/main/java/ru/gravit/launcher/events/request/JoinServerRequestEvent.java b/libLauncher/src/main/java/ru/gravit/launcher/events/request/JoinServerRequestEvent.java index 674103ea..5bc25436 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/events/request/JoinServerRequestEvent.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/events/request/JoinServerRequestEvent.java @@ -1,13 +1,14 @@ package ru.gravit.launcher.events.request; +import ru.gravit.launcher.request.ResultInterface; import ru.gravit.utils.event.EventInterface; import java.util.UUID; -public class JoinServerRequestEvent implements EventInterface { +public class JoinServerRequestEvent implements EventInterface, ResultInterface { private static final UUID uuid = UUID.fromString("2a12e7b5-3f4a-4891-a2f9-ea141c8e1995"); public String type = "success"; - public String requesttype = "checkServer"; + public String requesttype = "joinServer"; public JoinServerRequestEvent(boolean allow) { this.allow = allow; @@ -18,4 +19,9 @@ public JoinServerRequestEvent(boolean allow) { public UUID getUUID() { return uuid; } + + @Override + public String getType() { + return "joinServer"; + } } diff --git a/libLauncher/src/main/java/ru/gravit/launcher/events/request/LauncherRequestEvent.java b/libLauncher/src/main/java/ru/gravit/launcher/events/request/LauncherRequestEvent.java index 52c69bf9..25660de4 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/events/request/LauncherRequestEvent.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/events/request/LauncherRequestEvent.java @@ -1,13 +1,14 @@ package ru.gravit.launcher.events.request; +import ru.gravit.launcher.request.ResultInterface; import ru.gravit.utils.event.EventInterface; import java.util.UUID; -public class LauncherRequestEvent implements EventInterface { +public class LauncherRequestEvent implements EventInterface, ResultInterface { private static final UUID uuid = UUID.fromString("d54cc12a-4f59-4f23-9b10-f527fdd2e38f"); public String type = "success"; - public String requesttype = "launcherUpdate"; + public String requesttype = "launcher"; public String url; public LauncherRequestEvent(boolean needUpdate, String url) { @@ -20,4 +21,9 @@ public LauncherRequestEvent(boolean needUpdate, String url) { public UUID getUUID() { return uuid; } + + @Override + public String getType() { + return "launcher"; + } } 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 c0cdd5dd..537b7e62 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 @@ -1,11 +1,12 @@ package ru.gravit.launcher.events.request; import ru.gravit.launcher.profiles.PlayerProfile; +import ru.gravit.launcher.request.ResultInterface; import ru.gravit.utils.event.EventInterface; import java.util.UUID; -public class ProfileByUUIDRequestEvent implements EventInterface +public class ProfileByUUIDRequestEvent implements EventInterface, ResultInterface { private static final UUID uuid = UUID.fromString("b9014cf3-4b95-4d38-8c5f-867f190a18a0"); String requesttype = "profileByUUID"; @@ -19,4 +20,9 @@ public ProfileByUUIDRequestEvent(PlayerProfile playerProfile) { public UUID getUUID() { return uuid; } + + @Override + public String getType() { + return "profileByUUID"; + } } 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 ff836a30..a62c2805 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 @@ -1,11 +1,12 @@ package ru.gravit.launcher.events.request; import ru.gravit.launcher.profiles.PlayerProfile; +import ru.gravit.launcher.request.ResultInterface; import ru.gravit.utils.event.EventInterface; import java.util.UUID; -public class ProfileByUsernameRequestEvent implements EventInterface +public class ProfileByUsernameRequestEvent implements EventInterface, ResultInterface { private static final UUID uuid = UUID.fromString("06204302-ff6b-4779-b97d-541e3bc39aa1"); String requesttype = "profileByUsername"; @@ -19,4 +20,9 @@ public ProfileByUsernameRequestEvent(PlayerProfile playerProfile) { public UUID getUUID() { return uuid; } + + @Override + public String getType() { + return "profileByUsername"; + } } 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 1ce300ae..8a53513c 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 @@ -1,12 +1,13 @@ package ru.gravit.launcher.events.request; import ru.gravit.launcher.profiles.ClientProfile; +import ru.gravit.launcher.request.ResultInterface; import ru.gravit.utils.event.EventInterface; import java.util.List; import java.util.UUID; -public class ProfilesRequestEvent implements EventInterface +public class ProfilesRequestEvent implements EventInterface, ResultInterface { private static final UUID uuid = UUID.fromString("2f26fbdf-598a-46dd-92fc-1699c0e173b1"); List profiles; @@ -15,10 +16,15 @@ public ProfilesRequestEvent(List profiles) { this.profiles = profiles; } - String requesttype = "profilesList"; + String requesttype = "profiles"; String error; @Override public UUID getUUID() { return uuid; } + + @Override + public String getType() { + return "profiles"; + } } diff --git a/libLauncher/src/main/java/ru/gravit/launcher/events/request/UpdateListRequestEvent.java b/libLauncher/src/main/java/ru/gravit/launcher/events/request/UpdateListRequestEvent.java index c3a1e761..abd8f254 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/events/request/UpdateListRequestEvent.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/events/request/UpdateListRequestEvent.java @@ -1,11 +1,12 @@ package ru.gravit.launcher.events.request; import ru.gravit.launcher.hasher.HashedDir; +import ru.gravit.launcher.request.ResultInterface; import ru.gravit.utils.event.EventInterface; import java.util.UUID; -public class UpdateListRequestEvent implements EventInterface { +public class UpdateListRequestEvent implements EventInterface, ResultInterface { private static final UUID uuid = UUID.fromString("5fa836ae-6b61-401c-96ac-d8396f07ec6b"); public final String type; public final String requesttype; @@ -20,4 +21,9 @@ public UpdateListRequestEvent(HashedDir dir) { public UUID getUUID() { return uuid; } + + @Override + public String getType() { + return "updateList"; + } } diff --git a/LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/ResultInterface.java b/libLauncher/src/main/java/ru/gravit/launcher/request/ResultInterface.java similarity index 56% rename from LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/ResultInterface.java rename to libLauncher/src/main/java/ru/gravit/launcher/request/ResultInterface.java index 57e7d2b5..814c26a6 100644 --- a/LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/ResultInterface.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/request/ResultInterface.java @@ -1,4 +1,4 @@ -package ru.gravit.launcher.request.websockets; +package ru.gravit.launcher.request; public interface ResultInterface { String getType();