Game-Specific Rules#

This provides a few classes for parsing some game-specific rules, in particular Arma 3 and its relatives like DayZ, which uses the A2S_RULES response to send a binarized list of game details, mods, and signatures.

Arma 3#

class little_a2s.Arma3Rules(*, version, overflow, dlc, difficulty, dlc_hashes, mods, signatures)#

Bases: object

A deserialized set of rules, mods, and signatures for Arma 3 and similar Real Virtuality games like DayZ.

Reference: https://community.bistudio.com/wiki/Arma_3:_ServerBrowserProtocol3

Parameters:
classmethod from_rules(rules)#

Parse this class from a rules mapping.

Raises:
Parameters:

rules (Mapping[bytes, bytes] | ClientEventRules)

Return type:

Self

difficulty: Arma3Difficulty#

The difficulty options defined by the server.

dlc: Arma3DLC#

A set of DLC flags indicated by the server.

Some bits may be set that aren’t part of this flag’s members, up to 0xFFFF.

dlc_hashes: list[int]#

A list of hashes for each DLC flag set, in order.

mods: list[Arma3Mod]#

A list of mods that are required by the server, including CDLC.

overflow: int#

General flags (overflow flags).

signatures: list[str]#

A list of key filenames loaded on the server, not including the .bikey suffix.

version: int#

The version of this protocol.

class little_a2s.Arma3DLC(*values)#

Bases: IntFlag

A set of DLC flags indicated by the server.

Some bits may be set that aren’t part of this flag’s members, up to 0xFFFF.

class little_a2s.Arma3Difficulty(*, difficulty, skill, advanced_flight_model, third_person_view, weapon_crosshair)#

Bases: object

Parameters:
  • difficulty (int)

  • skill (int)

  • advanced_flight_model (bool)

  • third_person_view (bool)

  • weapon_crosshair (bool)

classmethod from_int(n)#

Parse this class from a 16-bit unsigned integer.

Parameters:

n (int)

Return type:

Self

advanced_flight_model: bool#

Indicates if Advanced Flight Model is enabled.

difficulty: int#

The difficulty level, usually between 0-3.

skill: int#

The AI skill level, usually between 0-3.

third_person_view: bool#

Indicates if third-person view is enabled.

weapon_crosshair: bool#

Indicates if the weapon crosshair is enabled.

class little_a2s.Arma3Mod(*, hash, dlc, steam_id, name)#

Bases: object

A mod required by the server.

Parameters:
classmethod from_reader(reader)#

Parse this class from a reader.

Raises:
Parameters:

reader (Reader)

Return type:

Self

dlc: bool#

Indicates if this is a DLC mod.

hash: int#

The 32-bit hash of that mod.

name: str#

The name of the mod. Usually omitted for DLC.

steam_id: int#

The workshop ID of the mod, or app ID if it is DLC.