shinkuan/Akagi

运行过程中报错

GldHkkowo opened this issue · 6 comments

╭───────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────╮
│ E:\Akagi\client.py:470 in get_messages                                                                               │
│                                                                                                                      │
│   467 │   │   │   │   │   if liqi_msg['method'] == '.lq.FastTest.authGame' and liqi_msg['type'                       │
│   468 │   │   │   │   │   │   self.app.push_screen(FlowScreen(flow_id))                                              │
│   469 │   │   │   │   │   │   pass                                                                                   │
│ ❱ 470 │   │   │   │   │   mjai_msg = self.bridge[flow_id].input(self.four_mjai_client, liqi_ms                       │
│   471 │   │   │   │   │   if mjai_msg is not None:                                                                   │
│   472 │   │   │   │   │   │   if self.bridge[flow_id].reach and mjai_msg["type"] == "dahai":                         │
│   473 │   │   │   │   │   │   │   mjai_msg["type"] = "reach"                                                         │
│                                                                                                                      │
│ ╭───────────────────────────────────────────────────── locals ─────────────────────────────────────────────────────╮ │
│ │  flow_id = '2c6204bd-b88c-4796-bf76-eb7b4ab3c13a'                                                                │ │
│ │ liqi_msg = {                                                                                                     │ │
│ │            │   'id': -1,                                                                                         │ │
│ │            │   'type': <MsgType.Notify: 1>,                                                                      │ │
│ │            │   'method': '.lq.ActionPrototype',                                                                  │ │
│ │            │   'data': {                                                                                         │ │
│ │            │   │   'step': 12,                                                                                   │ │
│ │            │   │   'name': 'ActionDiscardTile',                                                                  │ │
│ │            │   │   'data': {                                                                                     │ │
│ │            │   │   │   'seat': 1,                                                                                │ │
│ │            │   │   │   'tile': '8s',                                                                             │ │
│ │            │   │   │   'moqie': True,                                                                            │ │
│ │            │   │   │   'isLiqi': False,                                                                          │ │
│ │            │   │   │   'zhenting': False,                                                                        │ │
│ │            │   │   │   'tingpais': [],                                                                           │ │
│ │            │   │   │   'doras': [],                                                                              │ │
│ │            │   │   │   'isWliqi': False,                                                                         │ │
│ │            │   │   │   'tileState': 0,                                                                           │ │
│ │            │   │   │   'revealed': False,                                                                        │ │
│ │            │   │   │   ... +2                                                                                    │ │
│ │            │   │   }                                                                                             │ │
│ │            │   }                                                                                                 │ │
│ │            }                                                                                                     │ │
│ │ messages = b'\x01\n\x13.lq.ActionPrototype\x12%\x08\x0c\x12\x11ActionDiscardTile\x1a\x0e\x95}ch^\xa7N\x9cu\xcb\… │ │
│ │ mjai_msg = None                                                                                                  │ │
│ │     self = Akagi(title='Akagi', classes={'-dark-mode'})                                                          │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                                      │
│ E:\Akagi\majsoul2mjai.py:208 in input                                                                                │
│                                                                                                                      │
│   205 │   │   │   │   │   │   self.my_tsumohai = "?"                                                                 │
│   206 │   │   │   │   │   else:                                                                                      │
│   207 │   │   │   │   │   │   self.my_tehais.append("?")                                                             │
│ ❱ 208 │   │   │   │   │   self.my_tehais.remove(pai)                                                                 │
│   209 │   │   │   │   │   self.my_tehais = sorted(self.my_tehais, key=cmp_to_key(compare_pai))                       │
│   210 │   │   │   # Reach                                                                                            │
│   211 │   │   │   if parse_msg['data']['name'] == 'ActionReach':                                                     │
│                                                                                                                      │
│ ╭──────────────────────────────────── locals ────────────────────────────────────╮                                   │
│ │       actor = 1                                                                │                                   │
│ │ mjai_client = [                                                                │                                   │
│ │               │   <mjai.player.MjaiPlayerClient object at 0x000001B6F9203C50>, │                                   │
│ │               │   <mjai.player.MjaiPlayerClient object at 0x000001B6F9203910>, │                                   │
│ │               │   <mjai.player.MjaiPlayerClient object at 0x000001B6F9200E90>, │                                   │
│ │               │   <mjai.player.MjaiPlayerClient object at 0x000001B6F9206E90>  │                                   │
│ │               ]                                                                │                                   │
│ │         pai = '8s'                                                             │                                   │
│ │   parse_msg = {                                                                │                                   │
│ │               │   'id': -1,                                                    │                                   │
│ │               │   'type': <MsgType.Notify: 1>,                                 │                                   │
│ │               │   'method': '.lq.ActionPrototype',                             │                                   │
│ │               │   'data': {                                                    │                                   │
│ │               │   │   'step': 12,                                              │                                   │
│ │               │   │   'name': 'ActionDiscardTile',                             │                                   │
│ │               │   │   'data': {                                                │                                   │
│ │               │   │   │   'seat': 1,                                           │                                   │
│ │               │   │   │   'tile': '8s',                                        │                                   │
│ │               │   │   │   'moqie': True,                                       │                                   │
│ │               │   │   │   'isLiqi': False,                                     │                                   │
│ │               │   │   │   'zhenting': False,                                   │                                   │
│ │               │   │   │   'tingpais': [],                                      │                                   │
│ │               │   │   │   'doras': [],                                         │                                   │
│ │               │   │   │   'isWliqi': False,                                    │                                   │
│ │               │   │   │   'tileState': 0,                                      │                                   │
│ │               │   │   │   'revealed': False,                                   │                                   │
│ │               │   │   │   ... +2                                               │                                   │
│ │               │   │   }                                                        │                                   │
│ │               │   }                                                            │                                   │
│ │               }                                                                │                                   │
│ │        self = <majsoul2mjai.MajsoulBridge object at 0x000001B6F9386910>        │                                   │
│ │   tsumogiri = True                                                             │                                   │
│ ╰────────────────────────────────────────────────────────────────────────────────╯                                   │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
ValueError: list.remove(x): x not in list

win11下频发,不知道原因,感觉可能是因为我把docker镜像目录迁移了所以不太稳定(?

這是由於你打出了8s,但是不知道為什麼Akagi認為你手上應該沒有8s。
如果可以的話請附給我遊戲過程的Akagi.log
請注意將含有機密資料的部分刪除,裡面可能會包括你的帳號的access token

請刪除akagi.log之後,開啟遊戲直到遇到此bug後將akagi.log交給我。
與此同時我也會注意我這邊有沒有發生這個bug。

akagi.log
又运行了一天,这次复现之后马上保存了,不过在dc看好像说没法修,总之logs先上传了

感謝你提供的log檔,我已經知道問題出在何處了,但是修正這個bug會需要一段時間。

5d31d1b 應該可以修正

你開頭講的錯誤其實與這一次錯誤成因不同,我先留著這個issue,請你之後更新到最新版後如果還是遇到ValueError: list.remove(x): x not in list再把log給我看。
我有在 13573b4 log加上了顯示目前手牌

我在目前的dev分支移除了majsoul2mjai.py裡的MajsoulBridge.my_tehaisMajsoulBridge.my_tsumohai,v1.5之後將不會再遇到這個錯誤。

majsoul2mjai.py