SCRC v0.5.1 Scrc.Client View Source

Client implements boilerplate code for implementing an SCRC client. It forwards the domain specific calls to it’s driver.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor

Start a new client instance to the specified endpoint. Use provided driver process for controlling

Request a race restart from server

Send actor command to server

Send initialization (focus) data to server

Start the race

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function init(map) View Source
init(%{endpoint: Scrc.Server.endpoint(), driver: pid()}) :: map()

Start a new client instance to the specified endpoint. Use provided driver process for controlling.

Link to this function restart_race(client) View Source
restart_race(pid()) :: :ok

Request a race restart from server.

Link to this function send_actor_data(client, data) View Source
send_actor_data(pid(), Scrc.ActorData.t()) :: :ok

Send actor command to server.

Link to this function send_init_data(client, data) View Source
send_init_data(pid(), Scrc.InitData.t()) :: :ok

Send initialization (focus) data to server.

Link to this function start_link(args, opts \\ []) View Source
Link to this function start_race(client) View Source
start_race(pid()) :: :ok

Start the race

Send initial data to server and start to wait for data