Class WebSocketService

java.lang.Object
pro.gravit.launchserver.socket.WebSocketService

public class WebSocketService extends Object
  • Field Details

    • providers

      public static final pro.gravit.utils.ProviderMap<WebSocketServerResponse> providers
    • channels

      public final io.netty.channel.group.ChannelGroup channels
    • hook

      public final pro.gravit.utils.BiHookSet<WebSocketService.WebSocketRequestContext,io.netty.channel.ChannelHandlerContext> hook
    • shortRequestLatency

      public final AtomicLong shortRequestLatency
    • shortRequestCounter

      public final AtomicLong shortRequestCounter
    • middleRequestLatency

      public final AtomicLong middleRequestLatency
    • middleRequestCounter

      public final AtomicLong middleRequestCounter
    • longRequestLatency

      public final AtomicLong longRequestLatency
    • longRequestCounter

      public final AtomicLong longRequestCounter
    • lastRequestTime

      public final AtomicLong lastRequestTime
  • Constructor Details

    • WebSocketService

      public WebSocketService(io.netty.channel.group.ChannelGroup channels, LaunchServer server)
  • Method Details

    • registerResponses

      public static void registerResponses()
    • forEachActiveChannels

      public void forEachActiveChannels(BiConsumer<io.netty.channel.Channel,WebSocketFrameHandler> callback)
    • process

      public void process(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.websocketx.TextWebSocketFrame frame, Client client, String ip)
    • addRequestTimeToStats

      public void addRequestTimeToStats(long nanos)
    • registerClient

      public void registerClient(io.netty.channel.Channel channel)
    • sendObject

      public void sendObject(io.netty.channel.ChannelHandlerContext ctx, Object obj)
    • sendObject

      public void sendObject(io.netty.channel.ChannelHandlerContext ctx, Object obj, Type type)
    • sendObject

      public void sendObject(io.netty.channel.Channel channel, Object obj)
    • sendObject

      public void sendObject(io.netty.channel.Channel channel, Object obj, Type type)
    • sendObjectAll

      public void sendObjectAll(Object obj)
    • sendObjectAll

      public void sendObjectAll(Object obj, Type type)
    • sendObjectToUUID

      public void sendObjectToUUID(UUID userUuid, Object obj, Type type)
    • getChannelFromConnectUUID

      public io.netty.channel.Channel getChannelFromConnectUUID(UUID connectUuid)
    • kickByUserUUID

      public boolean kickByUserUUID(UUID userUuid, boolean isClose)
    • kickByConnectUUID

      public boolean kickByConnectUUID(UUID connectUuid, boolean isClose)
    • kickByIP

      public boolean kickByIP(String ip, boolean isClose)
    • sendObjectAndClose

      public void sendObjectAndClose(io.netty.channel.ChannelHandlerContext ctx, Object obj)
    • sendObjectAndClose

      public void sendObjectAndClose(io.netty.channel.ChannelHandlerContext ctx, Object obj, Type type)
    • sendEvent

      public void sendEvent(WebSocketService.EventResult obj)