network global
An experience made of more than one server: asks for instances of its members and is told about them. A failed call answers nil and a reason. Calls yield, but for status. Without a network every answer is no.
Functions 8
network.start(options: {member: string, label: string, slots: number, data: any}) → (NetworkStarted?, string?)Starts an instance of member. Answers at once; it is online later.
network.find(options: {label: string, players: number?, party: (Player | string)?, start: {member: string, slots: number, data: any}?}) → (NetworkStarted?, string?)The instance to send players players to (1 unless set), or nil when none has room. With start, one is started when none has room.
network.list(label: string?) → ({NetworkInstance}, string?)The network's instances, or only those with label.
network.stop(id: string) → (boolean, string?)Stops an instance of this network.
network.info() → ({network: string, id: string?, member: string?, label: string?, slots: number?, data: any}?, string?)This server's network, by name, and the instance this pack runs on: id and the fields after it are nil on a server that is not one.
network.status(options: {open: number, status: string?, meta: any})Says where this instance is. At most one a second is sent: the first at once, then the last of those that came after.
network.on_instance(handler: (instance: NetworkInstance) -> ()) → ConnectionCalled when an instance starts or changes.
network.on_gone(handler: (id: string) -> ()) → ConnectionCalled with the id of an instance that is gone.