McQueryEx v0.3.0 McQueryEx View Source

McQueryEx provides an interface for using Minecrafts server query.

Link to this section Summary

Types

t()

The McQueryEx struct, returned from new/0 and new/1

Functions

Pulls the basic stats from the MC server.

Pulls the full stats from the MC server.

Create a McQueryEx struct, with the default options.

Create a McQueryEx struct, with the specified options.

Link to this section Types

Link to this type

t()

View Source
t() :: %McQueryEx{
  host: tuple(),
  port: integer(),
  session_id: integer(),
  socket: nil | port(),
  timeout: integer()
}

The McQueryEx struct, returned from new/0 and new/1

Link to this section Functions

Link to this function

get_basic_stat(q)

View Source
get_basic_stat(t()) :: McQueryEx.BasicStat.t()

Pulls the basic stats from the MC server.

Returns McQueryEx.BasicStat.t()

Examples

iex> query = McQueryEx.new(host: {192, 168, 0, 150}, port: 25565)
iex> basic_stats = McQueryEx.get_basic_stat(query)
%McQueryEx.BasicStat{}
Link to this function

get_full_stat(q)

View Source
get_full_stat(t()) :: McQueryEx.FullStat.t()

Pulls the full stats from the MC server.

Returns McQueryEx.FullStat.t()

Examples

iex> query = McQueryEx.new(host: {192, 168, 0, 150}, port: 25565)
iex> full_stats = McQueryEx.get_full_stat(query)
%McQueryEx.FullStat{}
Link to this function

new()

View Source
new() :: {:ok, t()} | {:error, String.t()}

Create a McQueryEx struct, with the default options.

Returns McQueryEx.t()

Examples

iex> query = McQueryEx.new()
%McQueryEx{}
Link to this function

new(opts)

View Source
new(host: tuple(), port: integer(), session_id: integer(), timeout: integer()) ::
  {:ok, t()} | {:error, String.t()}

Create a McQueryEx struct, with the specified options.

Returns McQueryEx.t()

Examples

iex> query = McQueryEx.new(host: {192, 168, 0, 150}, timeout: 100)
%McQueryEx{}