View Source A2S (Elixir_A2S v0.1.0)

A library for communicating with game servers running Valve's A2S server query protocol.

Link to this section Summary

Functions

Parses a challenge response payload. Some game servers don't implement the challenge flow and will immediately respond with the requested data. In that case :immediate will be returned with the data.

Link to this section Functions

Link to this function

info_challenge_request()

View Source
@spec info_challenge_request() :: binary()
@spec info_request(binary()) :: binary()
@spec parse_challenge(binary()) ::
  {:challenge, binary()}
  | {:immediate,
     {:info, A2S.Info.t()}
     | {:players, A2S.Players.t()}
     | {:rules, A2S.Rules.t()}}
  | {:multipart, {A2S.MultiPacketHeader.t(), binary()}}
  | {:error, :compression_not_supported}

Parses a challenge response payload. Some game servers don't implement the challenge flow and will immediately respond with the requested data. In that case :immediate will be returned with the data.

If the server returns data immediately, and that data is multipart, :multipart will be returned.

Link to this function

parse_multipacket_response(packets)

View Source
@spec parse_multipacket_response([{A2S.MultiPacketHeader.t(), binary()}]) ::
  {:info, A2S.Info.t()}
  | {:players, A2S.Player.t()}
  | {:rules, A2S.Rules.t()}
  | {:error, any()}
@spec parse_response(binary()) ::
  {:info, A2S.Info.t()}
  | {:players, A2S.Player.t()}
  | {:rules, A2S.Rules.t()}
  | {:multipart, {A2S.MultiPacketHeader.t(), binary()}}
  | {:error, :compression_not_supported}
Link to this function

player_challenge_request()

View Source
@spec player_challenge_request() :: binary()
Link to this function

player_request(challenge)

View Source
@spec player_request(binary()) :: binary()
Link to this function

rules_challenge_request()

View Source
@spec rules_challenge_request() :: binary()
Link to this function

rules_request(challenge)

View Source
@spec rules_request(binary()) :: binary()
Link to this function

sign_challenge(atom, challenge)

View Source