diff --git a/client/python/gamium/gamium/tcp_gamium_service.py b/client/python/gamium/gamium/tcp_gamium_service.py index 45f5e07..4693026 100644 --- a/client/python/gamium/gamium/tcp_gamium_service.py +++ b/client/python/gamium/gamium/tcp_gamium_service.py @@ -61,8 +61,8 @@ def connect(self, try_count: int = 30) -> HelloResultT: raise Exception(f"Failed to connect to {self._host}:{self._port}") def disconnect(self): - self._socket.close() self._is_connected = False + self._socket.close() def request(self, packet: PacketTypes[P, R], timeout_ms: int = 0) -> R: if 0 == timeout_ms: @@ -81,19 +81,22 @@ def request(self, packet: PacketTypes[P, R], timeout_ms: int = 0) -> R: self._socket.sendall(builder.Output()) except socket.error as e: self._logger.error(f"Failed to send request: {e}") + self.disconnect() raise e try: while True: data = self._socket.recv(1024) + if len(data) == 0: + self.disconnect() self._recv_queue.pushBuffer(data) if self._recv_queue.has(): break return self.pop_message(req) - except Exception as e: - self._logger.error(f"Failed to receive response: {e}") + except ConnectionResetError: self.disconnect() + except Exception as e: raise e return data diff --git a/client/python/gamium/pyproject.toml b/client/python/gamium/pyproject.toml index 00acf2b..cb9d487 100644 --- a/client/python/gamium/pyproject.toml +++ b/client/python/gamium/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "gamium" -version = "2.0.4" +version = "2.0.5" description = "" authors = ["dogu"] readme = "README.md" diff --git a/client/typescript/gamium/package.json b/client/typescript/gamium/package.json index 6e445ae..7d9153f 100644 --- a/client/typescript/gamium/package.json +++ b/client/typescript/gamium/package.json @@ -1,6 +1,6 @@ { "name": "gamium", - "version": "2.0.4", + "version": "2.0.5", "description": "Gamium is an SDK that allows you to automate gameplay", "license": "MIT", "author": "dogu", diff --git a/engine/unity/package.json b/engine/unity/package.json index 5c50b14..8508005 100644 --- a/engine/unity/package.json +++ b/engine/unity/package.json @@ -1,6 +1,6 @@ { "name": "com.dogu.gamium.engine.unity", - "version": "2.0.3", + "version": "2.0.5", "description": "gamium unity server package", "license": "MIT", "author": "gamium",