Class FlickProtocol
java.lang.Object
net.flick.serverapi.protocol.FlickProtocol
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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordParsed and validatedhello.static final recordmods: nonce (nullable), ids, denied flag. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final intstatic final intMax payload in both directions (vanilla limit for serverbound custom payloads).static final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]encode(com.google.gson.JsonObject o) static com.google.gson.JsonObjectstatic com.google.gson.JsonObjectmodsRequest(String nonce) static com.google.gson.JsonObjectmodules(Collection<String> disabled, String reason) Full set of modules forced off (replaces the previous set on the client).static com.google.gson.JsonObjectstatic com.google.gson.JsonObjectnotify(String title, String body, NotificationKind kind, long durationMs) static com.google.gson.JsonObjectparse(byte[] data) Parses a payload into a JSON object with a stringt; null if malformed or too large.static FlickProtocol.ClientHelloparseHello(com.google.gson.JsonObject o) Validates a client hello; null when it is not a Flick hello we can talk to.static FlickProtocol.ModsReplyparseMods(com.google.gson.JsonObject o) parseState(com.google.gson.JsonObject o) Module ids from astatemessage.static com.google.gson.JsonObjectreset()static com.google.gson.JsonObjectstatic com.google.gson.JsonObjectrpcReset()static Stringtype(com.google.gson.JsonObject o) static com.google.gson.JsonObjectstatic com.google.gson.JsonObjectstatic com.google.gson.JsonObjectwaypointRemove(String id)
-
Field Details
-
CHANNEL
- See Also:
-
PROTOCOL
public static final int PROTOCOL- See Also:
-
MAX_BYTES
public static final int MAX_BYTESMax payload in both directions (vanilla limit for serverbound custom payloads).- See Also:
-
MAX_WAYPOINTS
public static final int MAX_WAYPOINTS- See Also:
-
MAX_DISABLED
public static final int MAX_DISABLED- See Also:
-
MAX_TITLE
public static final int MAX_TITLE- See Also:
-
MAX_BODY
public static final int MAX_BODY- See Also:
-
MAX_RPC
public static final int MAX_RPC- See Also:
-
MAX_REASON
public static final int MAX_REASON- See Also:
-
MAX_SERVER_NAME
public static final int MAX_SERVER_NAME- See Also:
-
-
Method Details
-
parse
public static com.google.gson.JsonObject parse(byte[] data) Parses a payload into a JSON object with a stringt; null if malformed or too large. -
type
-
parseHello
Validates a client hello; null when it is not a Flick hello we can talk to. -
parseState
-
parseMods
-
helloAck
-
waypointAdd
-
waypointRemove
-
waypointClear
public static com.google.gson.JsonObject waypointClear() -
modules
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
-
rpcReset
public static com.google.gson.JsonObject rpcReset() -
modsRequest
-
reset
public static com.google.gson.JsonObject reset() -
encode
public static byte[] encode(com.google.gson.JsonObject o)
-