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

How to decode byte data? #25

Closed
iceshoesss opened this issue Mar 12, 2024 · 1 comment
Closed

How to decode byte data? #25

iceshoesss opened this issue Mar 12, 2024 · 1 comment

Comments

@iceshoesss
Copy link

iceshoesss commented Mar 12, 2024

    req = pb.ReqJoinCustomizedContestChatRoom()
    req.unique_id = unique_id
    res = await lobby.join_customized_contest_chat_room(req)
    print(res.chat_history[2])

I got a byte data like this

b'\n .lq.NotifyCustomContestSystemMsg\x12\xa2\x01\x08\x9a\x88\x01\x10\x01\x1a+240312-867fda4f-3b41-45ac-93ba-3e2ddf72b8c4"m\n\x1c\x08\xb1\x94\x9b\x05\x12\x15\xe6\x95\xa3\xe5\x8f\x91\xe5\xa6\x96\xe6\xb0\x94\xe7\x9a\x84\xe6\x95\xa3\xe4\xbb\x99\n\x1a\x08\xdd\xdd\x9b\x05\x12\x13\xe5\x85\xb3\xe6\xb3\xa8\xe6\xb0\xb8\xe9\x9b\x8f\xe5\xa1\x94\xe8\x8f\xb21\n\x13\x08\xf6\xaf\xb7\x08\x12\x0c\xe9\x82\x91\xe7\xbb\x9f\xe5\xa4\xa9\xe4\xb8\x8b\n\x1c\x08\x96\xeb\xc3\x0b\x12\x15\xe3\x80\xa3\xe3\x80\xa1\xe9\xa5\x85\xe3\x80\xa5\xe9\xa0\xad\xe3\x80\xa2\xe5\xb7\x9c'

How to decode this data to format that human can understand?

@unStatiK
Copy link
Contributor

@iceshoesss in mahjongsoul protobuf protocol bytes data ALWAYS means "protobuf in protobuf". You should use Wrapper for extract inner protobuf data.
See example for that https://github.com/MahjongRepository/mahjong_soul_api/blob/master/example.py#L134-L138

@Nihisil Nihisil closed this as completed Jun 23, 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

No branches or pull requests

3 participants