1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-11 20:58:19 +08:00

Fix: Prevent MaaTouch stream from being deleted

This commit is contained in:
LmeSzinc
2023-05-23 00:09:25 +08:00
parent 3987b903bf
commit 250145fd7f

View File

@@ -89,6 +89,7 @@ class MaaTouch(Connection):
max_x: int
max_y: int
_maatouch_stream = socket.socket
_maatouch_stream_storage = None
@cached_property
def maatouch_builder(self):
@@ -107,6 +108,8 @@ class MaaTouch(Connection):
stream=True,
recvall=False
)
# Prevent shell stream from being deleted causing socket close
self._maatouch_stream_storage = stream
stream = stream.conn
stream.settimeout(10)
self._maatouch_stream = stream