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.
Locks the server and prevents new players from joining.
remove_listener(event, func)Removes a listener from a given event, e.g.
Restarts the mission and reassigns player roles.
Restarts the currently running mission.
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.
Tells the server to shut down.
unban(ban_id)Removes the ban with the given ID from the 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_idThe RCON admin ID this client was given or None if the client has not logged in.
playersThe list of players in the server.
- async restart_server()¶
Tells the server to restart. :rtype:
strNote
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.