Skip to main content

Python RCON client for the Battlefield 2142 server

Project description

rconnet

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.11, it was not tested on other versions.

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

Install

pip install 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
  • 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.0.3.tar.gz (11.1 kB view hashes)

Uploaded Source

Built Distribution

rconnet-0.0.3-py3-none-any.whl (12.6 kB view hashes)

Uploaded Python 3

Supported by

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