Package-level declarations

Types

Link copied to clipboard
sealed interface AxochatPacket
Link copied to clipboard
data class AxoUser(val name: String, val uuid: UUID) : Record

A axochat user

Link copied to clipboard
data class C2SBanUserPacket(val user: String) : AxochatPacket.C2S

A client can send this packet to ban other users from using this chat.

Link copied to clipboard
data class C2SLoginJWTPacket(val token: String, val allowMessages: Boolean) : AxochatPacket.C2S

To log in using a json web token, the client has to send a LoginJWT packet. it will send Success if the login was successful.

Link copied to clipboard
data class C2SLoginMojangPacket(val name: String, val uuid: UUID, val allowMessages: Boolean) : AxochatPacket.C2S

After the client received a MojangInfo packet and authenticating itself with mojang, it has to send a LoginMojang packet to the server. After the server receives a LoginMojang packet, it will send Success if the login was successful.

Link copied to clipboard
data class C2SMessagePacket(val content: String) : AxochatPacket.C2S

The content of this packet will be sent to every client as Message if it fits the validation scheme.

Link copied to clipboard
data class C2SPrivateMessagePacket(val receiver: String, val content: String) : AxochatPacket.C2S

The content of this packet will be sent to the specified client as PrivateMessage if it fits the validation scheme.

Link copied to clipboard

To log in using LoginJWT, a client needs to own a json web token. This token can be retrieved by sending RequestJWT as an already authenticated client to the server. The server will send a NewJWT packet to the client.

Link copied to clipboard

To log in via mojang, the client has to send a RequestMojangInfo packet. The server will then send a MojangInfo to the client. This packet does not have a body.

Link copied to clipboard

A client can send this packet to unban other users.

Link copied to clipboard
class PacketDeserializer : JsonDeserializer<AxochatPacket>

Packet Deserializer

Link copied to clipboard
class PacketSerializer : JsonSerializer<AxochatPacket>

Packet Serializer

Link copied to clipboard
data class S2CErrorPacket(val message: String) : AxochatPacket.S2C

This packet may be sent at any time, but is usually a response to a failed action of the client.

Link copied to clipboard
data class S2CMessagePacket(val id: String, val user: AxoUser, val content: String) : AxochatPacket.S2C

This packet will be sent to every authenticated client if another client successfully sent a message to the server.

Link copied to clipboard
data class S2CMojangInfoPacket(val sessionHash: String) : AxochatPacket.S2C

After the client sent the server a RequestMojangInfo packet, the server will provide the client with a session_hash. A session hash is synonymous with a server id in the context of authentication with Mojang. The client has to send a LoginMojang packet to the server after authenticating itself with Mojang.

Link copied to clipboard
data class S2CNewJWTPacket(val token: String) : AxochatPacket.S2C

After the client sent the server a RequestJWT packet, the server will provide the client with json web token. This token can be used in the LoginJWT packet.

Link copied to clipboard
data class S2CPrivateMessagePacket(val id: String, val user: AxoUser, val content: String) : AxochatPacket.S2C

This packet will be sent to an authenticated client with allow_messages turned on, if another client successfully sent a private message to the server with the id.

Link copied to clipboard
data class S2CSuccessPacket(val reason: String) : AxochatPacket.S2C

This packet is sent after either LoginMojang, LoginJWT, BanUser or UnbanUser were processed successfully.