Skip to main content

Python RCON client for the Battlefield 2142 server

Project description

rconnet


:b: There is an implementation of this module for C# in the form of a DLL library https://github.com/VordyV/rconnet.dotnet


What is this?

The project is a module for python, and the task of the module is to create a connection to the RCON Battlefield 2142, Battlefield 2 server. Simply put, it is an RCON client.

Main idea of the project was to implement something similar to ORM, as for databases.

It was developed on version python 3.12, it was not tested on other versions.

You can learn more about the module and its API in Wiki

Install

pip install rconnet
poetry add rconnet

pypi.org/project/rconnet/

Features

  • Separate methods for server management
  • Maplist manager
  • Settings manager
  • Ban manager
  • Player manager
  • Managers allow you to "objects" manage

Specifications

  • Adminscript - default support
  • Modmanager - in the process of implementing the support
  • Battlefield 2142 support (It has not been tested in Battlefield 2, but it can work)

You can do anything with this module, for example, a web banlist, a GUI program, a bot for Discord or telegram. That was the goal, to use a ready-made solution for different purposes.

Examples

  1. Simple output of the server name
from rconnet.rconbf2142 import Default

with Default("127.0.0.1", "super123") as rcon:
    name = rcon.settings.server_name()
    print(name)
    # Battlefield 2142
  1. View the maplist and install the next map
from rconnet.rconbf2142 import Default

with Default("127.0.0.1", "super123") as rcon:
    maplist = rcon.maplist.list
    print(maplist)
    # {0: Map(name=minsk, gpm=gpm_cq, size=32), 1: Map(name=fall_of_berlin, gpm=gpm_cq, size=32), 2: Map(name=suez_canal, gpm=gpm_ti, size=48)}
    maplist.get(1).set_next()
    rcon.run_next_level()
  1. Adding a ban to the list
from rconnet.rconbf2142 import Default

with Default("127.0.0.1", "super123") as rcon:
    rcon.banmanager.add_ban("172.123.54.6")
    banlist = rcon.banmanager.list
    print(banlist)
    # [Ban(address=172.123.54.6, period=Perm)]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rconnet-0.2.0.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rconnet-0.2.0-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file rconnet-0.2.0.tar.gz.

File metadata

  • Download URL: rconnet-0.2.0.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.10.11 Windows/10

File hashes

Hashes for rconnet-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f77c01c5bfde23f0858ad813024c424f09a2d0aafbcac5458fcd660f296ad3ca
MD5 70fc5a8209c776b2661c40fdf85487b3
BLAKE2b-256 7746b64aadea536e39bbcdafb3afa413907c2f5036366e565dd2c3b55cb955bd

See more details on using hashes here.

File details

Details for the file rconnet-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: rconnet-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.10.11 Windows/10

File hashes

Hashes for rconnet-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8abd12438d8e50df7fc70328a9da7fc6cd1e71280793de68f79bd087e173f43a
MD5 98e578989c3bed9936600f823a4dea7c
BLAKE2b-256 f0a6d42d5782bbf57f385d871ce825fce087854949136efb51ba2ca919b0772e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page