View Source Teiserver.Game.Match (Teiserver v0.0.4)

Match

The persisted storage of a game, for a guide on the lifecycle of a match please see the Match lifecycle guide.

Attributes

  • :name - The name of the lobby at the time the match started
  • :tags - The lobby tags at the time of the match starting
  • :public? - The public flag at time of the match starting
  • :rated? - The rated flag at time of the match starting, updated to false if the match is later decided to be unrated
  • :game_name - The game_name at time of the match starting, in most cases I expect game name to always be the same but this is in place to allow for multiple games to be run from a single server
  • :game_version - The game_version at time of the match starting
  • :winning_team - The ID of the winning team, set to nil in a draw
  • :team_count - The number of teams in the game
  • :team_size - The size of the largest team
  • :processed? - A flag showing if the match has had post-match processing
  • :game_type - A string indicating the type of game
  • :lobby_opened_at - The datetime the lobby was opened at or when the previous match completed
  • :match_started_at - The datetime the lobby swapped to being in progress, not the actual start time of the game itself
  • :match_ended_at - The datetime the match ended and the players were returned to the lobby, not the actual end time of the game itself
  • :ended_normally? - True if the match was ended in a normal manner, false if ended in an abnormal manner (e.g. crashed)
  • :match_duration_seconds - The duration of the game in seconds as indicated by the game host
  • :host - The user account hosting the lobby

Summary

Functions

Builds a changeset based on the struct and params.

Types

@type id() :: Ecto.UUID.t()
@type t() :: %Teiserver.Game.Match{
  __meta__: term(),
  ended_normally?: boolean(),
  game_name: String.t(),
  game_version: String.t(),
  host: Teiserver.Account.User.t(),
  host_id: Teiserver.user_id(),
  id: id(),
  inserted_at: term(),
  lobby_opened_at: DateTime.t(),
  match_duration_seconds: non_neg_integer(),
  match_ended_at: DateTime.t(),
  match_settings: term(),
  match_started_at: DateTime.t(),
  members: list(),
  name: String.t(),
  processed?: boolean(),
  public?: boolean(),
  rated?: boolean(),
  tags: [String.t()],
  team_count: non_neg_integer(),
  team_size: non_neg_integer(),
  type: Teiserver.Game.MatchType.t(),
  type_id: Teiserver.Game.MatchType.id(),
  updated_at: term(),
  winning_team: non_neg_integer()
}

Functions

Link to this function

changeset(struct, attrs \\ %{})

View Source
@spec changeset(map(), map()) :: Ecto.Changeset.t()

Builds a changeset based on the struct and params.