Class FlickProtocol

java.lang.Object
net.flick.serverapi.protocol.FlickProtocol

public final class FlickProtocol extends Object
Wire format of the flick:api plugin channel (spec: docs/SERVER_API.md). Each plugin message is one UTF-8 JSON object with a type field "t"; no length prefix.
  • Field Details

  • Method Details

    • parse

      public static com.google.gson.JsonObject parse(byte[] data)
      Parses a payload into a JSON object with a string t; null if malformed or too large.
    • type

      public static String type(com.google.gson.JsonObject o)
    • parseHello

      public static FlickProtocol.ClientHello parseHello(com.google.gson.JsonObject o)
      Validates a client hello; null when it is not a Flick hello we can talk to.
    • parseState

      public static Set<String> parseState(com.google.gson.JsonObject o)
      Module ids from a state message.
    • parseMods

      public static FlickProtocol.ModsReply parseMods(com.google.gson.JsonObject o)
    • helloAck

      public static com.google.gson.JsonObject helloAck(String serverName)
    • waypointAdd

      public static com.google.gson.JsonObject waypointAdd(FlickWaypoint w)
    • waypointRemove

      public static com.google.gson.JsonObject waypointRemove(String id)
    • waypointClear

      public static com.google.gson.JsonObject waypointClear()
    • modules

      public static com.google.gson.JsonObject modules(Collection<String> disabled, String reason)
      Full set of modules forced off (replaces the previous set on the client).
    • modulesReset

      public static com.google.gson.JsonObject modulesReset()
    • notify

      public static com.google.gson.JsonObject notify(String title, String body, NotificationKind kind, long durationMs)
    • rpc

      public static com.google.gson.JsonObject rpc(String details, String state)
    • rpcReset

      public static com.google.gson.JsonObject rpcReset()
    • modsRequest

      public static com.google.gson.JsonObject modsRequest(String nonce)
    • reset

      public static com.google.gson.JsonObject reset()
    • encode

      public static byte[] encode(com.google.gson.JsonObject o)