Skip to content
This repository was archived by the owner on Jul 8, 2023. It is now read-only.

Conversation

bogachev-pa
Copy link
Collaborator

No description provided.

In tenhou message, player from who the meld was called
is encoded relative to the player who called the meld,
not relative to the player to whom message is sent.
message = '<REINIT seed="0,0,1,4,3,59" ten="250,250,250,240" oya="0" ' \
'hai="1,2,4,13,17,20,46,47,53,71,76,81,85" ' \
'm2="41513" ' \
'm2="41515" ' \
Copy link
Contributor

Choose a reason for hiding this comment

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

41513 был пример из реального лога, так что я думаю это не стоило менять. Возможно оно работало до этого так как хотела тенха :)

meld.from_who = data & 0x3
# 'from_who' is encoded relative the the 'who', so we want
# to convert it to be relative to our player
meld.from_who = ((data & 0x3) + meld.who) % 4
Copy link
Contributor

Choose a reason for hiding this comment

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

Я взял код выше отсюда: https://github.com/NegativeMjark/tenhou-log/blob/master/TenhouDecoder.py#L38

У них же можешь посмотреть на формал мелда: https://github.com/NegativeMjark/tenhou-log#meld-format

@bogachev-pa
Copy link
Collaborator Author

Обсудили в тг, решили мержить.

@bogachev-pa bogachev-pa merged commit d0eed98 into dev Nov 23, 2018
@Nihisil Nihisil deleted the kan_tiles_count branch December 3, 2018 14:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants