LudoLink

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).

Constructors

Link copied to clipboard
constructor(context: Context)

Properties

Link copied to clipboard
val inbox: SharedFlow<Pair<Int, LudoWire>>
Link copied to clipboard
val status: StateFlow<LudoLinkStatus>
Link copied to clipboard
val tables: StateFlow<List<LudoTable>>

Functions

Link copied to clipboard
Link copied to clipboard
fun close()
Link copied to clipboard
fun discover()
Link copied to clipboard
fun host(alias: String, myName: String, maxGuests: Int)
Link copied to clipboard
fun join(address: String, port: Int, alias: String, hello: LudoWire.Join)
Link copied to clipboard
fun sendTo(device: Int, m: LudoWire)
Link copied to clipboard

Host: stop advertising once the game starts (seats are fixed).

Link copied to clipboard