Event Reference¶
All events dispatched by AsyncRCONClient are documented here.
To listen for one of the following events, use the add_listener()
method or the listen() decorator.
- on_raw_event(packet: ServerPacket)¶
Fired for every parsable packet received by the server.
- Parameters:
packet (ServerPacket) – The packet that was received. This will be one of the three subclasses of
ServerPacket.
- on_login()¶
Fired after a successful login to the server.
- on_command(response: str)¶
Fired after receiving any command response from the server. This should only be used for debugging purposes as the
send_command()method already returns the server’s response.- Parameters:
response (str) – The response received by the server.
- on_message(message: str)¶
Fired for messages sent by the server, e.g. player connections. More specific events such as
on_admin_login()are dispatched from this event.- Parameters:
response (str) – The message that was sent by the server.
- on_admin_login(admin_id: int, addr: str)¶
Fired when a RCON admin logs into the server. The first message received will be our client logging in.
Note
This event has no logout equivalent as the server does not send messages for admins logging out.
- on_player_connect(player: Player)¶
Fired when a player connects to a server.
Note
The player’s
guidwill most likely be an empty string since the server sends the GUID in a separate message briefly afterwards. To wait for the GUID to be provided, see theon_player_guid()event.- Parameters:
player (Player) – The player that connected to the server.
- on_player_guid(player: Player)¶
Fired when receiving the BattlEye GUID for a connecting player. The given player object will have the updated GUID.
- Parameters:
player (Player) – The player whose GUID was updated.
- on_player_verify_guid(player: Player)¶
Fired when the server has verified the BattlEye GUID for a connecting player.
- Parameters:
player (Player) – The player whose GUID was verified.
- on_player_disconnect(player: Player)¶
Fired when a player manually disconnects from the server.
The
playerslist will no longer contain the player provided here.This event does not fire when BattlEye kicks the player; for that, see the following event
on_player_kick().- Parameters:
player (Player) – The player that disconnected.
- on_player_kick(player: Player, reason: str)¶
Fired when BattlEye kicks a player either automatically (e.g.
"Client not responding") or by an admin (i.e."Admin Kick").The
playerslist will no longer contain the player provided here.
- on_admin_message(admin_id: int, channel: str, message: str)¶
Fired when an RCON admin sends a message.
If the
channelis"Global", theon_admin_announcement()event is dispatched alongside this event.If the
channelstarts with"To ", theon_admin_whisper()event is also dispatched.
- on_admin_announcement(admin_id: int, message: str)¶
Fired when an RCON admin sends a global message.
- on_admin_whisper(player: Player, admin_id: int, message: str)¶
Fired when an RCON admin sends a message to a specific player.
Note
This event may potentially not get dispatched if the player’s name could not be found in the client’s cache.