berconpy.ext.arma.AsyncArmaRCONClient

class berconpy.ext.arma.AsyncArmaRCONClient(protocol_cls=<class 'berconpy.protocol.RCONClientDatagramProtocol'>)

An AsyncRCONClient subclass that adds more methods for handling Arma RCON.

Methods

add_listener(event, func)

Adds a listener for a given event, e.g.

ban(addr[, duration, reason])

Bans a given player ID, GUID, or IP address (without port).

close()

Closes the connection.

connect(ip, port, password)

Returns an asynchronous context manager for logging into the given IP and port with password.

fetch_admins()

Requests a list of RCON admins connected to the server, ordered by admin ID and IP address with port.

fetch_bans()

Requests a list of bans on the server.

fetch_missions()

Requests a list of mission files on the server.

fetch_players()

Requests a list of players from the server.

get_player(player_id)

Gets a player from cache using their server-given ID.

is_connected()

Indicates if the client has a currently active connection with the server.

is_logged_in()

Indicates if the client is currently authenticated with the server.

is_running()

Indicates if the client is running.

kick(player_id[, reason])

Kicks a player with the given ID from the server with an optional reason.

listen([event])

A decorator shorthand to add a listener for a given event, e.g.

lock_server()

Locks the server and prevents new players from joining.

remove_listener(event, func)

Removes a listener from a given event, e.g.

restart_and_reassign()

Restarts the mission and reassigns player roles.

restart_mission()

Restarts the currently running mission.

restart_server()

Tells the server to restart.

select_mission(mission[, difficulty])

Selects a new mission for the server to load.

send(message)

Sends a message to all players in the server.

send_command(command)

Sends a command to the server and waits for a response.

shutdown_server()

Tells the server to shut down.

unban(ban_id)

Removes the ban with the given ID from the server.

unlock_server()

Unlocks the server and allows new players to join.

wait_for(event, *[, check, timeout])

Waits for a specific event to occur and returns the result.

whisper(player_id, message)

Sends a message to the player with the given ID.

Attributes

client_id

The RCON admin ID this client was given or None if the client has not logged in.

players

The list of players in the server.

async lock_server()

Locks the server and prevents new players from joining.

Return type:

str

async restart_and_reassign()

Restarts the mission and reassigns player roles.

Return type:

str

async restart_mission()

Restarts the currently running mission.

Return type:

str

async restart_server()

Tells the server to restart. :rtype: str

Note

The client does not automatically close after this command is sent. If you need to prevent the client from indefinitely attempting to reconnect, you should call the close() method.

async select_mission(mission, difficulty='')

Selects a new mission for the server to load.

Parameters:
  • mission (str) – The name of the mission to load without the file extension (e.g. "MP_Bootcamp_01.Altis").

  • difficulty (str) – The new difficulty to use on the server (e.g. Recruit, Regular, Veteran, Custom). If not provided, the current difficulty is reused.

Return type:

str

async shutdown_server()

Tells the server to shut down. :rtype: str

Note

The client does not automatically close after this command is sent. If you need to prevent the client from indefinitely attempting to reconnect, you should call the close() method.

async unlock_server()

Unlocks the server and allows new players to join.

Return type:

str