Module lan

Module lan 

Source
Expand description

LAN matchmaking and socket implementation.

§Matchmaking

The LAN matchmaker works by allowing the player to start a match and wait for people to join it, or to join player’s started match.

Communication happens directly between LAN peers over the QUIC protocol.

Structs§

LanMatchmaker
The type of the LAN_MATCHMAKER channel.
ServerInfo
Service discover info and ping.
ServiceDiscoveryReceiver
Receiver for LAN service discovery channel.

Enums§

LanMatchmakerRequest
A request that may be sent to the LAN_MATCHMAKER.
LanMatchmakerResponse
A response that may come from the LAN_MATCHMAKER.

Functions§

join_server
Join a server hosted by someone else.
leave_server
Leave a joined server.
prepare_to_host
Get the current host info or create a new one. When there’s an existing service but its service_name is different, the service is recreated and only then the returned bool is true.
prepare_to_join
Update server pings and turn on service discovery.
start_server
Host a server.
stop_server
Stop hosting a server.
wait_game_start
Wait for a joined game to start.
wait_players
Wait for players to join a hosted server.