ProtocolVersion

LunaticChat protocol version definition

Manages version of communication protocol between Paper and Velocity.

Version Bump Rules

PATCH (e.g., 1.0.0 -> 1.0.1):

  • Add optional fields with default values to existing message types.

  • Add new sub-channels that peers can safely ignore.

  • No deployment coordination required.

MINOR (e.g., 1.0.x -> 1.1.0):

  • Add required fields to existing messages.

  • Add sub-channels whose absence degrades functionality.

  • Deployment order: update Velocity first, then Paper servers.

  • Set MIN_SUPPORTED_MINOR to control the deprecation window.

MAJOR (e.g., 1.x.x -> 2.0.0):

  • Remove or rename existing sub-channels or fields.

  • Change wire format or encoding.

  • Requires simultaneous deployment of all components.

Adding a New Message Type (sub-channel)

  1. Add the data class to PluginMessage.

  2. Add a sub-channel constant to PluginMessageCodec.SubChannel.

  3. Add encode/decode branches in PluginMessageCodec.

  4. Add a backward compatibility snapshot to ProtocolBackwardCompatibilityTest.

  5. Bump PATCH if the new sub-channel is optional, MINOR if it is required.

Properties

Link copied to clipboard
const val MAJOR: Int = 1
Link copied to clipboard
const val MIN_SUPPORTED_MINOR: Int = 0

Minimum MINOR version this build can interoperate with (same MAJOR).

Link copied to clipboard
const val MINOR: Int = 0
Link copied to clipboard
const val PATCH: Int = 0
Link copied to clipboard

Functions

Link copied to clipboard
fun isCompatible(version: String): Boolean

Checks compatibility from version string

fun isCompatible(major: Int, minor: Int): Boolean

Checks if specified protocol version is compatible