Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check whether autoplay is executed correctly #38

Merged
merged 7 commits into from
Mar 21, 2024
Merged

Conversation

motoiro
Copy link
Contributor

@motoiro motoiro commented Mar 20, 2024

检查所有操作是否成功执行,若没有执行,则每间隔1.5秒再执行一次,直到成功。

Copy link
Owner

@shinkuan shinkuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need some changes, see comments for details.

client.py Outdated Show resolved Hide resolved
client.py Outdated Show resolved Hide resolved
client.py Show resolved Hide resolved
client.py Outdated
isliqi = self.isLiqi
self.action.mjai2action(self.app.mjai_msg_dict[self.flow_id][-1], self.tehai, self.tsumohai, isliqi, False)
self.isLiqi = False
self.app.action_verify_job = self.set_interval(1.5, self.app.dahai_verfication)
self.app.dahaiyanzhenhg = self.set_interval(2.5, self.dahai_yanzheng)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use "yanzheng".

client.py Outdated
@@ -476,15 +476,12 @@ def __init__(self, rpc_server, *args, **kwargs) -> None:
self.mjai_msg_dict = dict() # flow.id -> List[mjai_msg]
self.akagi_log_dict = dict() # flow.id -> List[akagi_log]
self.mitm_started = False
self.action_verify_job = None
self.dahaiyanzhenhg = None
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move the verify job into FlowScreen.

client.py Outdated
self.stopA = self.action_verify_job.stop()
if liqi_msg['data']['name'] in ['ActionDealTile', 'ActionDiscardTile', 'ActionChiPengGang', 'ActionAnGangAddGang', 'ActionBaBei', 'ActionHule', 'ActionLiuJu', 'ActionNoTile']:
if self.dahaiyanzhenhg is not None:
self.stopA = self.dahaiyanzhenhg.stop()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move the verify job into FlowScreen.

stopA is bad var name.

client.py Outdated
@@ -577,7 +576,7 @@ def mitm_connected(self):
def action_quit(self) -> None:
self.update_flow.stop()
self.get_messages_flow.stop()
self.action_verify_job.stop()
self.dahaiyanzhenhg.stop()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move the verify job into FlowScreen.

Copy link
Owner

@shinkuan shinkuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments for more details.

@shinkuan shinkuan merged commit b4d2146 into shinkuan:dev Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants