From 773981c32fbee59039cde27e5ce269e112944020 Mon Sep 17 00:00:00 2001 From: Gravit Date: Sat, 30 Nov 2019 03:47:40 +0700 Subject: [PATCH] =?UTF-8?q?[FIX]=20=D0=92=D0=BE=D0=B7=D0=BC=D0=BE=D0=B6?= =?UTF-8?q?=D0=BD=D0=BE=D1=81=D1=82=D1=8C=20=D0=BE=D1=82=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=BA=D0=B8=20=D1=81=D0=BE=D0=BE=D0=B1=D1=89=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B9=20=D0=BF=D0=BE=20Channel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pro/gravit/launchserver/socket/WebSocketService.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/WebSocketService.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/WebSocketService.java index 42f820b2..e717dcb0 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/WebSocketService.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/WebSocketService.java @@ -133,6 +133,14 @@ public void sendObject(ChannelHandlerContext ctx, Object obj, Type type) { ctx.writeAndFlush(new TextWebSocketFrame(gson.toJson(obj, type)), ctx.voidPromise()); } + public void sendObject(Channel channel, Object obj) { + channel.writeAndFlush(new TextWebSocketFrame(gson.toJson(obj, WebSocketEvent.class)), channel.voidPromise()); + } + + public void sendObject(Channel channel, Object obj, Type type) { + channel.writeAndFlush(new TextWebSocketFrame(gson.toJson(obj, type)), channel.voidPromise()); + } + public void sendObjectAll(Object obj) { for (Channel ch : channels) { ch.writeAndFlush(new TextWebSocketFrame(gson.toJson(obj, WebSocketEvent.class)), ch.voidPromise());