diff --git a/l4d2web/services/rcon.py b/l4d2web/services/rcon.py index 49bb699..19bd2cf 100644 --- a/l4d2web/services/rcon.py +++ b/l4d2web/services/rcon.py @@ -32,7 +32,9 @@ SERVERDATA_EXECCOMMAND = 2 SERVERDATA_AUTH_RESPONSE = 2 SERVERDATA_RESPONSE_VALUE = 0 -# req_id values used by execute_command +# req_id values for execute_command's exec + marker packets. +# These are arbitrary positive ints chosen by the client; the values +# happen to be unrelated to the SERVERDATA_* packet-type constants. _EXEC_REQ_ID = 2 _MARKER_REQ_ID = 0xC0DE @@ -68,10 +70,13 @@ class StatusResponse: def _connect_and_auth( sock: socket.socket, host: str, port: int, password: str ) -> None: - """Open TCP connection and authenticate. Raises: + """Open TCP connection and authenticate. - * RconError – on connect failure or i/o error during handshake - * RconAuthError – when the server returns req_id == -1 (bad password) + Raises: + RconError – on connect failure + RconAuthError – when the server returns req_id == -1 (bad password) + OSError / socket.timeout – raw, from the post-connect send/recv; + callers wrap these into RconError. """ try: sock.connect((host, port))