BizHawkClient: Add lock for communicating with lua script (#2369)

This commit is contained in:
Bryce Wilson
2023-10-26 18:55:46 -07:00
committed by GitHub
parent 88d69dba97
commit b16804102d
2 changed files with 50 additions and 74 deletions

View File

@@ -13,8 +13,8 @@ from CommonClient import CommonContext, ClientCommandProcessor, get_base_parser,
import Patch
import Utils
from . import BizHawkContext, ConnectionStatus, RequestFailedError, connect, disconnect, get_hash, get_script_version, \
get_system, ping
from . import BizHawkContext, ConnectionStatus, NotConnectedError, RequestFailedError, connect, disconnect, get_hash, \
get_script_version, get_system, ping
from .client import BizHawkClient, AutoBizHawkClientRegister
@@ -133,6 +133,8 @@ async def _game_watcher(ctx: BizHawkClientContext):
except RequestFailedError as exc:
logger.info(f"Lost connection to BizHawk: {exc.args[0]}")
continue
except NotConnectedError:
continue
# Get slot name and send `Connect`
if ctx.server is not None and ctx.username is None: