Skip to content
This repository was archived by the owner on Jul 27, 2025. It is now read-only.

Commit 2649b53

Browse files
authored
Merge pull request #26 from fossum/feature/add-enforce-labels-flag
Add source run flag to check response ID
2 parents cc40e9c + c384311 commit 2649b53

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

rcon/source/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ def login(self, passwd: str, *, encoding: str = "utf-8") -> bool:
6464

6565
return True
6666

67-
def run(self, command: str, *args: str, encoding: str = "utf-8") -> str:
67+
def run(self, command: str, *args: str, encoding: str = "utf-8", enforce_id: bool = True) -> str:
6868
"""Run a command."""
6969
request = Packet.make_command(command, *args, encoding=encoding)
7070
response = self.communicate(request)
7171

72-
if response.id != request.id:
73-
raise SessionTimeout()
72+
if enforce_id and response.id != request.id:
73+
raise SessionTimeout("packet ID mismatch")
7474

7575
return response.payload.decode(encoding)

0 commit comments

Comments
 (0)