View Source Teiserver (Teiserver v0.0.4)

Teiserver is a middleware server library; designed for usage with games. It handles game-agnostic issues (chat, searching for games, match history) and allows you to implement the game-specific items you care about.

In a peer-to-peer setting each client will communicate to each other client as and when they need to. With a middleware server every client communicates via the middleware server and the server acts as a single source of truth.

graph TD;
  srv{{Middleware Server}};
  srv <--> User1;
  srv <--> User2;
  srv <--> User3;
  srv <--> User4;
  Host1 <--> srv;
  Host2 <--> srv;
  Bot1 <--> srv;
  Bot2 <--> srv;

To use Teiserver you write an endpoint which your game connects to over a network. The endpoint handles the messages from client apps and makes calls to Teiserver; acting as wrapper around the Teiserver API.

Main guides:

Contexts

These are the main modules you will be interacting with in Teiserver. They typically delegate all their functions to something more specific but the context module will be the preferred point of contact with the Teiserver library.

Teiserver has some other publicly accessible functions for those who want to write more advanced or complex functionality but in theory everything you need should be accessible from the relevant context.

Context overview

  • Accounts: Users
  • Communication: Chat
  • Community: Social interactions between players
  • Connections: User activity
  • Game: Game/playing functionality
  • Logging: Logging of events and numbers
  • Moderation: Handling disruptive users
  • Settings: Key-Value pairs for users and the system
  • Telemetry: Moment to moment events

Summary

Types

@type lobby_id() :: Teiserver.Game.Lobby.id()
@type match_id() :: Teiserver.Game.Match.id()
@type party_id() :: Ecto.UUID.t()
@type query_args() ::
  keyword(
    id: non_neg_integer() | nil,
    where: list(),
    preload: list(),
    order_by: list(),
    offset: non_neg_integer() | nil,
    limit: non_neg_integer() | nil
  )
@type queue_id() :: non_neg_integer()
@type seconds() :: integer()
@type team_number() :: non_neg_integer()
@type user_id() :: Teiserver.Account.User.id()

Functions

Link to this function

deterministic_uuid(base)

View Source
@spec deterministic_uuid(String.t()) :: String.t()
@spec uuid() :: String.t()