rcon.battleye package¶
Submodules¶
rcon.battleye.client module¶
BattlEye RCon client.
- class rcon.battleye.client.Client(*args, max_length: int = 4096, message_handler: ~typing.Callable[[~rcon.battleye.proto.ServerMessage], None] = <function log_message>, **kwargs)¶
Bases:
BaseClient
BattlEye RCon client.
- communicate(request: LoginRequest | CommandRequest | ServerMessageAck) LoginResponse | CommandResponse | ServerMessage | str ¶
Send a request and receive a response.
- handle_server_message(message: ServerMessage) None ¶
Handle the respective server message.
- login(passwd: str) bool ¶
Log-in the user.
- receive() LoginResponse | CommandResponse | ServerMessage ¶
Receive a packet.
- run(command: str, *args: str) str ¶
Execute a command and return the text message.
rcon.battleye.proto module¶
Low-level protocol stuff.
- class rcon.battleye.proto.CommandRequest(seq: int, command: str)¶
Bases:
NamedTuple
Command packet.
- command: str¶
Alias for field number 1
- classmethod from_command(command: str, *args: str) CommandRequest ¶
Create a command packet from the command and arguments.
- classmethod from_string(command: str) CommandRequest ¶
Create a command packet from the given string.
- property payload: bytes¶
Return the payload.
- seq: int¶
Alias for field number 0
- class rcon.battleye.proto.CommandResponse(header: Header, seq: int, payload: bytes)¶
Bases:
NamedTuple
A command response.
- classmethod from_bytes(header: Header, payload: bytes) CommandResponse ¶
Create a command response from the given bytes.
- property message: str¶
Return the text message.
- payload: bytes¶
Alias for field number 2
- seq: int¶
Alias for field number 1
- class rcon.battleye.proto.Header(crc32: int, type: int)¶
Bases:
NamedTuple
Packet header.
- crc32: int¶
Alias for field number 0
- type: int¶
Alias for field number 1
- class rcon.battleye.proto.LoginRequest¶
Bases:
str
Login request packet.
- property payload: bytes¶
Return the payload.
- class rcon.battleye.proto.LoginResponse(header: Header, success: bool)¶
Bases:
NamedTuple
A login response.
- classmethod from_bytes(header: Header, payload: bytes) LoginResponse ¶
Create a login response from the given bytes.
- success: bool¶
Alias for field number 1
- class rcon.battleye.proto.ServerMessage(header: Header, seq: int, payload: bytes)¶
Bases:
NamedTuple
A message from the server.
- classmethod from_bytes(header: Header, payload: bytes) ServerMessage ¶
Create a server message from the given bytes.
- property message: str¶
Return the text message.
- payload: bytes¶
Alias for field number 2
- seq: int¶
Alias for field number 1
Module contents¶
BattlEye RCON implementation.
- class rcon.battleye.Client(*args, max_length: int = 4096, message_handler: ~typing.Callable[[~rcon.battleye.proto.ServerMessage], None] = <function log_message>, **kwargs)¶
Bases:
BaseClient
BattlEye RCon client.
- communicate(request: LoginRequest | CommandRequest | ServerMessageAck) LoginResponse | CommandResponse | ServerMessage | str ¶
Send a request and receive a response.
- handle_server_message(message: ServerMessage) None ¶
Handle the respective server message.
- login(passwd: str) bool ¶
Log-in the user.
- receive() LoginResponse | CommandResponse | ServerMessage ¶
Receive a packet.
- run(command: str, *args: str) str ¶
Execute a command and return the text message.
- class rcon.battleye.ServerMessage(header: Header, seq: int, payload: bytes)¶
Bases:
NamedTuple
A message from the server.
- classmethod from_bytes(header: Header, payload: bytes) ServerMessage ¶
Create a server message from the given bytes.
- property message: str¶
Return the text message.
- payload: bytes¶
Alias for field number 2
- seq: int¶
Alias for field number 1