Skip to content

thegamecracks/berconpy

Repository files navigation

berconpy

PyPI Docs

An asynchronous Python wrapper over the BattlEye RCON protocol.

Features

  • Easy to use event-based interface
  • Automatic network loss recovery
  • Included extension for Arma 3 commands and events

Basic Usage

import asyncio
import berconpy

client = berconpy.RCONClient()

IP = "XXX.XXX.XXX.XXX"
PORT = 9999
PASSWORD = "ASCII_PASSWORD"

@client.dispatch.on_login
async def on_login():
    print("We have logged in!")

async def main():
    async with client.connect(IP, PORT, PASSWORD):
        players = await client.send_command("players")
        print(players)

asyncio.run(main())

See the documentation for more details.

Migrating to v3

v3.0.0 is a major rewrite of this library to isolate generic BattlEye RCON functionality from Arma 3 / DayZ-specific features. For users that need to work with other games like Arma Reforger, you must use v3.

For v2 users that cannot migrate, ensure that your requirements are pinned to berconpy~=2.1 to prevent accidentally upgrading to v3. v2 documentation is still available for the time being.

Installation

(Python 3.10 or higher is required)

This package can be installed from PyPI using the following command:

# Linux/macOS
python3 -m pip install berconpy

# Windows
py -m pip install berconpy

If you want to install the development version instead, and you have git installed:

pip install git+https://github.com/thegamecracks/berconpy

Related resources

License

This project uses the MIT License.