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

进入对局后报错(更新proto后仍报错) #44

Open
Missdrop opened this issue Apr 30, 2022 · 2 comments
Open

进入对局后报错(更新proto后仍报错) #44

Missdrop opened this issue Apr 30, 2022 · 2 comments

Comments

@Missdrop
Copy link

Missdrop commented Apr 30, 2022

使用了-level 1 命令
在AI自动点击银之间按钮之后AI报错,经多次测试仍出现相同情况
报错信息如下

  majsoul menu not found, calibrate again]
  Number of good matches: 1071
  Homography Matrix: [[ 8.18263740e-01 -1.19836177e-03  6.32067758e+00]
 [-2.10630195e-03  8.22187602e-01  1.73237682e+02]
 [-3.05598975e-06 -5.09500683e-07  1.00000000e+00]]
Similarity: 0.7084269662921349
create AI subprocess locally
starting up on 127.0.0.1 port 7479
waiting for the AI
AI connection:  <class 'socket.socket'> <socket.socket fd=1404, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 7479), raddr=('127.0.0.1', 56918)> ('127.0.0.1', 56918)
waiting for the game to start
Traceback (most recent call last):
  File "main.py", line 744, in <module>
    MainLoop(level=level)
  File "main.py", line 705, in MainLoop
    while not aiWrapper.isPlaying():
  File "main.py", line 107, in isPlaying
    result = liqiProto.parse(flow_msg)
  File "C:\Desktop\MajsoulAI\majsoul_wrapper\liqi.py", line 84, in parse
    proto_domain = self.jsonProto['nested'][lq]['nested'][service]['methods'][rpc]
KeyError: 'fetchLastPrivacy'
@Missdrop Missdrop changed the title 有关AI AI进入对局后报错 Apr 30, 2022
@Missdrop Missdrop changed the title AI进入对局后报错 进入对局后报错 Apr 30, 2022
@Missdrop
Copy link
Author

Missdrop commented May 5, 2022

更新liqi_pb2.py后运行报错

Traceback (most recent call last):
  File "C:\Desktop\MajsoulAI\majsoul_wrapper\sdk.py", line 17, in <module>
    from liqi import LiqiProto, MsgType
ModuleNotFoundError: No module named 'liqi'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Desktop\MajsoulAI\majsoul_wrapper\liqi.py", line 20, in <module>
    from .proto import liqi_pb2 as pb
  File "C:\Desktop\MajsoulAI\majsoul_wrapper\proto\liqi_pb2.py", line 22, in <module>
    create_key=_descriptor._internal_create_key,
AttributeError: module 'google.protobuf.descriptor' has no attribute '_internal_create_key'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\software\Python\Python37\lib\runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "D:\software\Python\Python37\lib\runpy.py", line 142, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "D:\software\Python\Python37\lib\runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "C:\Desktop\MajsoulAI\majsoul_wrapper\__init__.py", line 5, in <module>
    from .sdk import MajsoulHandler, Operation, all_tiles
  File "C:\Desktop\MajsoulAI\majsoul_wrapper\sdk.py", line 19, in <module>
    from .liqi import LiqiProto, MsgType
  File "C:\Desktop\MajsoulAI\majsoul_wrapper\liqi.py", line 22, in <module>
    from proto import liqi_pb2 as pb
ModuleNotFoundError: No module named 'proto'

@Missdrop Missdrop changed the title 进入对局后报错 进入对局后报错(更新proto后仍报错) May 5, 2022
@nicognaW
Copy link

nicognaW commented May 15, 2022

你应该使用项目对应的protobuf版本转换你的proto文件,请参考 747929791/majsoul_wrapper#13 。这是因为protobuf不支持将新版本程序生成的文件应用在旧版本运行时上。

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

No branches or pull requests

2 participants