LudoWire

@Serializable
sealed interface LudoWire

Messages for multi-phone Ludo. The host is the single source of truth: clients send Act intents, the host validates them with the same reducer the game uses and broadcasts the resulting State to everyone.

Inheritors

Types

Link copied to clipboard
@Serializable
@SerialName(value = "act")
data class Act(val action: LudoAction) : LudoWire
Link copied to clipboard
@Serializable
@SerialName(value = "bye")
data object Bye : LudoWire
Link copied to clipboard
@Serializable
@SerialName(value = "full")
data object Full : LudoWire
Link copied to clipboard
@Serializable
@SerialName(value = "join")
data class Join(val name: String, val alias: String, val color: Long, val version: Int = LUDO_PROTOCOL) : LudoWire
Link copied to clipboard
@Serializable
@SerialName(value = "lobby")
data class Lobby(val seats: List<LudoSeat>, val hostAlias: String) : LudoWire

Host → everyone: the seating plan before the game starts.

Link copied to clipboard
@Serializable
@SerialName(value = "state")
data class State(val state: LudoState) : LudoWire
Link copied to clipboard
@Serializable
@SerialName(value = "welcome")
data class Welcome(val device: Int) : LudoWire

Host → one client: your device number (1..3).