berconpy.ArmaCache¶
- class berconpy.ArmaCache¶
Bases:
objectA basic cache implementation for
ArmaClient.When a
clientis set, this will add anon_loginlistener which queries theadmin_idand fetches the current player list to quickly update itself.Methods
add_connected_player(payload)Adds a player to the cache after having connected.
add_missing_player(payload)Adds a player that was missing from the cache.
get_player(player_id)Looks up a player from cache using their server-given ID.
on_login()remove_player(player_id)Invalidates a player in the cache.
set_player_guid(payload)Sets the GUID of a cached player.
update_players(response)Updates the cache by parsing a response to the "players" command.
verify_player_guid(payload)Verifies the GUID of a cached player.
Attributes
The RCON admin ID this client was given or None if the client has not logged in.
The client this cache is assigned to.
A list of players in the server.
- add_connected_player(payload)¶
Adds a player to the cache after having connected.
- Return type:
- Returns:
The player that was created.
- add_missing_player(payload)¶
Adds a player that was missing from the cache.
- Return type:
- Returns:
The player that was created.
- get_player(player_id)¶
Looks up a player from cache using their server-given ID.
- remove_player(player_id)¶
Invalidates a player in the cache.
- set_player_guid(payload)¶
Sets the GUID of a cached player.
- update_players(response)¶
Updates the cache by parsing a response to the “players” command.
- Return type:
- verify_player_guid(payload)¶
Verifies the GUID of a cached player.
- property admin_id: int | None¶
The RCON admin ID this client was given or None if the client has not logged in.
- property client: ArmaClient | None¶
The client this cache is assigned to.