Package-level declarations

LAN multiplayer: the line-delimited JSON protocol, NSD discovery, TCP sessions, aliases, session codes and QR join links.

Types

Link copied to clipboard
object Aliases

Friendly random names for LAN sessions, so players never see raw addresses.

Link copied to clipboard
object JoinLink

What a host's QR code carries: its session code and alias, never a raw address.

Link copied to clipboard
data class LanHost(val key: String, val alias: String, val hostName: String, address: String, port: Int)

A discovered session. address is kept internal — the UI only shows alias and hostName.

Link copied to clipboard
@Serializable
sealed interface LanMessage

Messages exchanged between two devices, one JSON object per line.

Link copied to clipboard
class LanSession(context: Context)

One peer-to-peer connection over the local network. The host opens a TCP server socket and advertises it with NSD (mDNS); the joiner discovers it (or types the IP) and connects. No data leaves the LAN and there is no server.

Link copied to clipboard
sealed interface LanStatus
Link copied to clipboard
object LudoCodec
Link copied to clipboard
data class LudoGuest(val device: Int, val name: String, val alias: String, val color: Long)

Everything a joining phone learns from the host.

Link copied to clipboard
class LudoLink(context: Context)

Network link for Ludo: host mode accepts up to three phones; guest mode connects to one host. Incoming messages arrive on inbox tagged with the sending device (0 = host).

Link copied to clipboard
sealed interface LudoLinkStatus
Link copied to clipboard
data class LudoTable(val key: String, val alias: String, val hostName: String, address: String, port: Int)

A discovered Ludo table.

Link copied to clipboard
@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.

Link copied to clipboard
object Protocol
Link copied to clipboard

Encodes an IPv4 address and port into a short, shareable code (Crockford base32, e.g. "K7Q2M-9XZ4P") for joining by hand when discovery is blocked — without showing the address.

Properties

Link copied to clipboard
const val LUDO_PROTOCOL: Int = 1
Link copied to clipboard
Link copied to clipboard
const val PROTOCOL_VERSION: Int = 1
Link copied to clipboard
const val SERVICE_TYPE: String