Skip to content

An asynchronous interface for the Source RCON Protocol.

License

Notifications You must be signed in to change notification settings

skmendez/aiorcon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aiorcon

An asynchronous interface for the Source RCON Protocol.

Installation

The easiest way is to install via pip:

pip install aiorcon

Usage Example

Using aiorcon is pretty simple. First you have to create a RCON Object with the create method. The RCON Object itself is now callable with the command you want to send. After awaiting the call you get the output of the command.

import aiorcon
import asyncio

async def main(loop):

    # initialize the RCON connection with ip, port, password and the event loop.
    rcon = await aiorcon.RCON.create("192.168.2.137", 27015, "rconpassword", loop)

    # send a command
    stats = await(rcon("stats"))
    print(stats)

    # close the connection in the end
    rcon.close()

loop = asyncio.get_event_loop()
loop.run_until_complete(main(loop))

About

An asynchronous interface for the Source RCON Protocol.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages