Skip to content

[Feature Request] Add possible_actions and cannot_dahai to Mjai Protocol Messages #56

@Apricot-S

Description

@Apricot-S

In the final version of the Mjai protocol (protocol_version == 3), messages sent from the server to the client include possible_actions and cannot_dahai fields.
This field allows the server to explicitly communicate which actions are available to the client, including the set of possible calls, whether winning is allowed, and which tiles cannot be discarded due to kuikae restrictions or after declaring riichi.

Pros

  • The client no longer needs to compute its own set of legal actions, reducing implementation complexity.

Cons

  • The server must customize outgoing messages for each client.
  • Messages sent to clients during a match must be separated from those stored as logs.

Reference

For reference, the corresponding implementation in the original mjai project can be found here:
https://github.com/gimite/mjai/blob/master/lib/mjai/game.rb

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions