Skip to main content

Client implementation of Minecrafts RCON protocol using asyncio

Project description

asyncrcon

asyncrcon is a client side implementation of the Minecraft RCON protocol using asyncio sockets for non-blocing socket handling.

Links

Usage Example

For more examples, see here. Here, we are opening a RCON connection to add a given user to the servers whitelist. Then, we close the connection.

from asyncrcon import AsyncRCON, AuthenticationException

async def add_to_whitelist(user: str):
    rcon = AsyncRCON('loclahost:25575', 'secretRCONPassword')
    try:
        await rcon.open_connection()
    except AuthenticationException:
        print('Login failed: Unauthorized.')
        return
        
    res = await rcon.command('whitelist add {}'.format(user))
    print(res)
    
    rcon.close()

© 2020 Ringo Hoffmann (zekro Development)
Covered by the Apache Licence 2.0.

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

asyncrcon-1.0.1.tar.gz (4.7 kB view hashes)

Uploaded Source

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