Game-Specific Rules#
Added in version 0.3.0.
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:
objectA 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
Added in version 0.3.0.
Changed in version 0.7.1: Fixed handling DayZ payloads with
from_rules().If the rules mapping version is 2, the difficulty will always be set to
Arma3Difficulty.from_int(0).- Parameters:
- classmethod from_rules(rules)#
Parse this class from a rules mapping.
- Raises:
EOFError – Not enough bytes could be read.
ValueError – The data is malformed.
- 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.
- class little_a2s.Arma3DLC(*values)#
Bases:
IntFlagA 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.
Added in version 0.3.0.
- class little_a2s.Arma3Difficulty(*, difficulty, skill, advanced_flight_model, third_person_view, weapon_crosshair)#
Bases:
objectThe difficulty options defined by the server.
Added in version 0.3.0.
- Parameters:
- class little_a2s.Arma3Mod(*, hash, dlc, steam_id, name)#
Bases:
objectA mod required by the server.
Added in version 0.3.0.
- classmethod from_reader(reader)#
Parse this class from a reader.
- Raises:
EOFError – Not enough bytes could be read.
ValueError – The data is malformed.
- Parameters:
reader (
Reader)- Return type:
Self