diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/ControlEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/events/ControlEvent.java deleted file mode 100644 index 399dd4dc..00000000 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/ControlEvent.java +++ /dev/null @@ -1,19 +0,0 @@ -package pro.gravit.launcher.events; - -import java.util.UUID; - -//Набор стандартных событий -public class ControlEvent { - @SuppressWarnings("unused") - private static final UUID uuid = UUID.fromString("f1051a64-0cd0-4ed8-8430-d856a196e91f"); - - public enum ControlCommand { - STOP, START, PAUSE, CONTINUE, CRASH - } - - public ControlEvent(ControlCommand signal) { - this.signal = signal; - } - - public final ControlCommand signal; -} diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/NotificationEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/events/NotificationEvent.java index 528b7eb1..cdf124cb 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/NotificationEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/events/NotificationEvent.java @@ -1,9 +1,12 @@ package pro.gravit.launcher.events; +import pro.gravit.launcher.LauncherNetworkAPI; import pro.gravit.launcher.request.WebSocketEvent; public class NotificationEvent implements WebSocketEvent { + @LauncherNetworkAPI public final String head; + @LauncherNetworkAPI public final String message; public NotificationEvent(String head, String message) { diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/SignalEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/events/SignalEvent.java index eef9e7fd..c4ff91f6 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/SignalEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/events/SignalEvent.java @@ -1,13 +1,19 @@ package pro.gravit.launcher.events; import pro.gravit.launcher.LauncherNetworkAPI; +import pro.gravit.launcher.request.WebSocketEvent; //Используется, что бы послать короткое сообщение, которое вмещается в int -public class SignalEvent { +public class SignalEvent implements WebSocketEvent { @LauncherNetworkAPI public final int signal; public SignalEvent(int signal) { this.signal = signal; } + + @Override + public String getType() { + return "signal"; + } } diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/ClientWebSocketService.java b/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/ClientWebSocketService.java index 3b4afcbd..3ec44934 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/ClientWebSocketService.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/ClientWebSocketService.java @@ -5,6 +5,7 @@ import pro.gravit.launcher.Launcher; import pro.gravit.launcher.events.ExceptionEvent; import pro.gravit.launcher.events.NotificationEvent; +import pro.gravit.launcher.events.SignalEvent; import pro.gravit.launcher.events.request.*; import pro.gravit.launcher.hasher.HashedEntry; import pro.gravit.launcher.hasher.HashedEntryAdapter; @@ -109,6 +110,7 @@ public void registerResults() { results.register("register", RegisterRequestEvent.class); results.register("setpassword", SetPasswordRequestEvent.class); results.register("notification", NotificationEvent.class); + results.register("signal", SignalEvent.class); } public void registerHandler(EventHandler eventHandler) {