This commit is contained in:
@ -157,10 +157,9 @@ class IdiomGame:
|
|||||||
"""
|
"""
|
||||||
跳过当前成语,选择下一个成语
|
跳过当前成语,选择下一个成语
|
||||||
"""
|
"""
|
||||||
await self.lock.acquire()
|
async with self.lock:
|
||||||
self._skip_idiom_async()
|
self._skip_idiom_async()
|
||||||
self.add_buff_score(buff_score)
|
self.add_buff_score(buff_score)
|
||||||
self.lock.release()
|
|
||||||
return self.last_idiom
|
return self.last_idiom
|
||||||
|
|
||||||
def _skip_idiom_async(self) -> str:
|
def _skip_idiom_async(self) -> str:
|
||||||
@ -174,9 +173,8 @@ class IdiomGame:
|
|||||||
"""
|
"""
|
||||||
用户发送成语
|
用户发送成语
|
||||||
"""
|
"""
|
||||||
await self.lock.acquire()
|
async with self.lock:
|
||||||
state = self._verify_idiom(idiom, user_id)
|
state = self._verify_idiom(idiom, user_id)
|
||||||
self.lock.release()
|
|
||||||
return state
|
return state
|
||||||
|
|
||||||
def is_nextable(self, last_char: str) -> bool:
|
def is_nextable(self, last_char: str) -> bool:
|
||||||
|
|||||||
Reference in New Issue
Block a user