View Source Program structure

User to Teiserver

The expectation is your users will have an application running on their machine, this application will connect to your endpoint (websocket, grpc, plaintext etc). Your endpoint will be an Elixir application running Teiserver as a dependency and making the calls to it.

User application
Endpoint
Command handler
Teiserver library
Response handler

Endpoint information flow

The endpoints are can communicate with users however you want. In terms of Teiserver they are expected to make function calls to Teiserver context modules and receive information via return values and also process messages (typically via Pubsubs).

UserEndpointTeiserverUser eventServer eventMessage/CommandFunction callReturn valueMessage/CommandPubsub messageMessage/CommandUserEndpointTeiserver

Login through to playing a game

The expected flow of events for a user logging into your application and playing a game is expected to look something like this. Note depending on protocols and features you may end up with slightly different steps.

UserServerGameServer not needed nowServer becomes relevantLoginAccept loginOpen lobbyLoginAccept loginSend client infoRequest lobby listSend lobby listJoin lobbyUser joinedStart matchStart matchMatch eventsMatch eventsMatch eventsMatch eventsMatch endedUpdate client stateLeave lobbyUser leftUserServerGame