BotActionLock
机器人行动锁, 用于防止多个线程同时使用机器人与游戏交互, 造成错误
Attributes
attribute
__slots__= ('name', 'when_locked')
attribute
name= lock_name
attribute
when_locked= when_locked
Functions
func
__init__(self, lock_name, when_locked=None)
Args: lock_name (str): 行动锁名
Args: lock_name (str): description when_locked (Callable[[], None] | None, optional): description. Defaults to None.
param
selfparam
lock_namestr
param
when_lockedCallable[[], None] | None
= None
Returns
None
func
__enter__(self)
param
selfReturns
None
func
__exit__(self, *_)
param
selfparam
_= ()
Returns
None