From c38431171a502370ccf8c447c7ecbfe807384d71 Mon Sep 17 00:00:00 2001
From: Eric Fossum <fossum.eric@gmail.com>
Date: Tue, 30 Jan 2024 08:29:26 -0800
Subject: [PATCH] Add source run flag to check response ID.

---
 rcon/source/client.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/rcon/source/client.py b/rcon/source/client.py
index 5a06086..0edc0fc 100644
--- a/rcon/source/client.py
+++ b/rcon/source/client.py
@@ -64,12 +64,12 @@ class Client(BaseClient, socket_type=SOCK_STREAM):
 
         return True
 
-    def run(self, command: str, *args: str, encoding: str = "utf-8") -> str:
+    def run(self, command: str, *args: str, encoding: str = "utf-8", enforce_id: bool = True) -> str:
         """Run a command."""
         request = Packet.make_command(command, *args, encoding=encoding)
         response = self.communicate(request)
 
-        if response.id != request.id:
-            raise SessionTimeout()
+        if enforce_id and response.id != request.id:
+            raise SessionTimeout("packet ID mismatch")
 
         return response.payload.decode(encoding)