Changelog

v3.1.3

This adds a few search keywords to help with package discoverability, bumps various development dependencies, and fixes some incorrect roles in this changelog.

v3.1.2

This fixes some embarassing bugs related to ArmaClient which I should have caught before v3.0.0 came out. These bugs are not known to affect the generic RCONClient class.

Fixed

  • AttributeError when attempting to access Ban.cache

    This bug was introduced in v3.0.0 and broke the Ban object’s .client property and .unban() method.

  • ArmaClient not assigning itself to ArmaCache.client

    This bug was introduced in v3.0.0 and broke the .admin_id and .players properties from being cached on login.

  • ArmaClient.ban(), Player.ban_guid(), and Player.ban_ip() not actually including the GUID/IP of the player to be banned

    This is a long-standing bug and has existed since v2.0.0. Usually this resulted in a “0.0.0.0” ban that was harmless, but otherwise did not have the intended effect of banning the player.

v3.1.1

Changed

  • Downgrade the following I/O logs to DEBUG level:

    • could not send command after <N> attempts

    • attempting to connect to server

    • attempting to reconnect to server

    • failed <N> login attempts

v3.1.0

Changed

  • Add expected messages to the ArmaClient parser:

    • Failed to receive from BE Master

    • Master query timed out, no response from BE Master

  • Directly log unexpected messages in ArmaClient as warnings, rather than raising ValueError exceptions to be logged by asyncio

v3.0.0

This is a large rewrite of the library to allow using BattlEye RCON by itself without Arma 3-specific features, and will break the majority of existing code for users. For the time being, this will be the only way to use berconpy with Arma Reforger. If you have any code using this library that you cannot migrate to the new version for, please pin your version to berconpy~=2.1. Sorry!

For contributors, nearly all abstract base classes have been removed, and the asynchronous implementation has been hoisted to the top-level package. Any alternative I/O implementations are now free to declare their own caching, events, and data models for bans/players.

No changes were made to the Sans-I/O protocol at berconpy.protocol, and its hoisted classes like berconpy.RCONClientProtocol are preserved.

Renamed

To improve backwards compatibility, aliases are defined for old names which will trigger a warning when used.

Removed

  • berconpy.asyncio package

  • berconpy.cache package and RCONClientCache

  • berconpy.RCONClient.cache parameter and attribute

  • berconpy.RCONClient abstract methods related to Arma, like fetch_players()

  • berconpy.EventDispatcher events related to Arma, like on_player_message

  • berconpy.ConnectorConfig.players_interval attribute, only defined for berconpy.ArmaConnectorConfig

Other Breaking Changes

  • Converted berconpy.RCONClient to a concrete class, with implementations extracted from AsyncRCONClient

  • Converted berconpy.EventDispatcher to a concrete class, with implementations extracted from AsyncEventDispatcher

  • Added berconpy.RCONClient.protocol parameter and attribute

  • berconpy.AsyncClientConnector no longer sends the players command for keep alives, and this behaviour is now reserved for the new berconpy.ArmaConnector class

  • berconpy.Ban and berconpy.Player now work only with Arma-specific classes and cannot be used with berconpy.RCONClient

  • Switched build backend from setuptools to uv-build

    This should not have any visible changes for end users, only contributors that want to work on the project. This also means the package will no longer use setuptools-scm for Git-based dynamic versioning.

  • Removed all dependency extras: docs, tests, types

    These extras provided dependencies that were only useful for development, such as docs generation and running tests. Now, attempting to install these extras (for example, pip install berconpy[docs]) may result in a warning or an error message depending on your package manager.

    For contributors, these dependencies were moved to Dependency Groups, and can be installed when working on the repository directly, for example, pip install . --group dev or uv sync --group dev.

Added

v2.1.4

Bug Fixes

  • Fix possible (but minor) memory leak when using AsyncRCONClient.wait_for() to wait on a non-predefined event

  • Fix potential InvalidStateError while sending a command if AsyncRCONClient disconnects before a response is received

  • Fix players potentially being fetched more than once during login if cache is already populated

  • Fix Config entry: server messages causing superfluous errors

v2.1.3

Bug Fixes

  • Remove unnecessary wheel build dependency

  • Add missing py.typed marker to comply with PEP 561 distribution of type information

Documentation

v2.1.1

Bug Fixes

  • Fix NonceCheck not raising ValueError when max_size exceeds 255

  • Ignore more known server messages in RCONClient

    • Ban check timed out, no response from BE Master

    • Disconnected from BE Master

    • Failed to resolve BE Master DNS name(s)

v2.1.0

New Features

  • Add type-safe decorators to EventDispatcher for existing events

    This serves as an alternative interface to the existing listen() and add_listener() methods for those that want stronger type safety in their code (avoiding string typos and validating listener signatures).

Bug Fixes

  • Hide stderr clutter from berconpy-keep-alive tasks failing to send commands

Documentation

v2.0.0

This is a major rewrite of the library to increase the flexibility and re-usability of components. Many new abstractions have been introduced between the protocol, I/O layers, and the client.

Breaking Changes

New Features

  • Add Sans-I/O client and server implementations of the RCON protocol:

  • Add Sans-I/O base classes, inherited by their original asyncio components:

  • Allow customization of the client cache by using a subclass of RCONClientCache

  • Allow customization of keep alive messages, reconnect parameters, and command handling for AsyncClientConnector using ConnectorConfig and AsyncCommander

  • Add send/receive support for UTF-8 encoding

    Despite the BattlEye RCON protocol specifying that payloads be encoded in ASCII, RCON servers are willing to send UTF-8 encoded text back. As such, this library will begin processing strings in UTF-8.

  • Improve validation of server responses to commands

    • Indexes must be within range

    • Indexes must not be repeated

    • Total must be consistent across associated packets

Bug Fixes

  • Fix Ban.index not actually being stored as an integer

Miscellaneous

  • Show full traceback for malformed data being received when using DEBUG logging level

  • Add this changelog to the documentation

v1.1.1

Bug Fixes

Miscellaneous

  • Rename the Getting Started page to Introduction

  • Add section about logging in the Introduction guide

  • Clean up table of contents

  • Fix docs/ Makefile building in the wrong directory

v1.1.0

Bug Fixes

  • Fix the user’s current task being cancelled when AsyncRCONClient.close() is called

Documentation

  • Add Getting Started guide

  • Add various clarifications and examples throughout the API reference

v1.0.0.post1

This version comes with a new online documentation providing an Event Reference and API reference for the various classes and methods in the library.

v1.0.0

This is the first release to be published on PyPI!

Breaking Changes

  • Cancel the current task when the connection stops

    This prevents the body of async with client.connect(): continuing to run, even if the client is no longer running.

  • Remove the name parameter from AsyncRCONClient

    This attribute is probably no longer necessary for logging purposes.

Bug Fixes

  • Fix AsyncRCONClient.wait_for() hanging when the predicate returns False

  • Fix potential InvalidStateError when a command times out and receives a response at the same time

  • Fix protocol not resetting its own state when an error occurs

  • Fix protocol silently failing due to an OSError (GH-2)

  • Fix BattlEye kicks for players without GUIDs not being parsed correctly

Miscellaneous

  • Tweak logging levels used during protocol’s lifetime

  • Wait for three seconds before applying exponential backoff during a connection (re)attempt

v0.2.1

New Features

  • Add facade methods to AsyncRCONClient:

    • is_running()

    • is_connected()

    • is_logged_in()

Miscellaneous

  • Minor docstring tweaks for AsyncRCONClient

v0.2.0

Breaking Changes

New Features

  • Use sequence number from server messages to avoid re-triggering on_message events in case of network instability

  • Add berconpy.ext namespace package for third-party extension support

  • Add berconpy.ext.arma extension containing an ArmaClient subclass with methods specific to the Arma game series

  • Add new events:

    • on_admin_login(admin_id, addr)

    • on_player_connect(player)

    • on_player_guid(player)

    • on_player_verify_guid(player)

    • on_player_disconnect(player_id, name)

    • on_player_kick(player, reason)

    • on_admin_message(admin_id, channel, message)

    • on_admin_announcement(admin_id, message)

    • on_admin_whisper(player, admin_id, message)

    • on_player_message(player, channel, message)

  • Add Player class and player cache to the client, accessed with the AsyncRCONClient.players property and the get_player() method

  • After successfully connecting once, AsyncRCONClient will indefinitely attempt to reconnect when the connection is lost

  • Exponential backoff to reduce excessive connection attempts

  • New exceptions have been added to replace ValueError and RuntimeError in various locations:

  • Add AsyncRCONClient.client_id property

  • Add new methods to AsyncRCONClient:

    • ban()

    • fetch_admins()

    • fetch_bans()

    • fetch_missions()

    • fetch_players()

    • kick()

    • send()

    • unban()

    • whisper()

  • Add a Ban dataclass which is returned by AsyncRCONClient.fetch_bans()

Bug Fixes

  • Fix RuntimeError when sending a command fails on the first attempt

  • Fix protocol hanging indefinitely when the server times out

  • Fix temporary listeners not being removed after they are invoked

  • Fix AttributeError when protocol closes before having connected

  • Fix potential asyncio.CancelledError when calling AsyncRCONClient.send_command()

  • Fix protocol parsing messages from addresses other than the connected server

  • Fix protocol not acknowledging messages when reconnecting

  • Fix on_command event potentially being called more than once for multiple responses to the same command

Miscellaneous

  • Add logging configuration to repl.py

  • Add repr to AsyncRCONClient

v0.1.0

New Features

  • Finish implementation for AsyncRCONClient.wait_for()

Bug Fixes

  • Fix AsyncRCONClient.send_command() returning bytes instead of str

Miscellaneous

v0.0.1

This is the first version of berconpy, providing the initial implementation for the AsyncRCONClient, Packet, and RCONClientDatagramProtocol classes.