An async rcon client for video games.
Project description
gamercon-async
gamercon-async
is an asynchronous Python client designed for games like Minecraft, Ark and Path of Titans.
Features
- List the key features of your package.
- Explain what makes your package stand out.
Installation
Install gamercon-async
using pip:
pip install gamercon-async
Requirements
- Python 3.10+
- asyncio
Usage
Quick example on how to use source games.
import asyncio
from gamercon_async import GameRCON
async def main():
client = GameRCON('host', 'port', 'password')
async with client as pot_client:
response = await pot_client.send('your_command')
print(response)
asyncio.run(main())
Replace host
, port
, and password
with your actual credentials and 'your_command' with the command you want to send.
Example with The Isle: Evrima
import asyncio
from gamercon_async import EvrimaRCON
async def main():
rcon = EvrimaRCON('host', port, 'password')
await rcon.connect()
save_response = await rcon.send_command(bytes('\x02', 'utf-8') + bytes('\x50', 'utf-8') + bytes('\x00', 'utf-8'))
print(f"Save Server Response: {save_response}")
announcement = "Hello, world!"
announce_response = await rcon.send_command(bytes('\x02', 'utf-8') + bytes('\x10', 'utf-8') + announcement.encode() + bytes('\x00', 'utf-8'))
print(f"Announcement Response: {announce_response}")
asyncio.run(main())
Special Thanks
- Barneygale: Made the original MCRcon which inspired me to release a new protocol.
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
gamercon-async-1.0.4.tar.gz
(3.7 kB
view hashes)
Built Distribution
Close
Hashes for gamercon_async-1.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca1ab1e2553fc073d20fc09c322bbf1a6a95a72e78eb9b8693fd611275867e5e |
|
MD5 | f96ce4e13890aa7b9bb86d0922929e0e |
|
BLAKE2b-256 | 3b0a7e9ab37f882231e17e451e57f507f1120b8f7e4652448695d5723c153bf8 |