PacketSerializer

class PacketSerializer : JsonSerializer<AxochatPacket>

Packet Serializer

Allows serializing packets from class to json

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
inline fun <T : AxochatPacket> register(name: String)
Link copied to clipboard
fun registerPacket(packetName: String, packetClass: Class<out AxochatPacket>)

Register packet

Link copied to clipboard
open override fun serialize(src: AxochatPacket, typeOfSrc: Type, context: JsonSerializationContext): JsonElement

Gson invokes this call-back method during serialization when it encounters a field of the specified type.