-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat: 麻雀 #13112
Draft
syuilo
wants to merge
67
commits into
develop
Choose a base branch
from
mahjong
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+10,028
−14
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
packages/frontend
Client side specific issue/PR
packages/backend
Server side specific issue/PR
packages/misskey-js
labels
Jan 30, 2024
このPRによるapi.jsonの差分 差分はこちら--- base
+++ head
@@ -76097,6 +76097,464 @@
}
}
}
+ },
+ "/mahjong/create-room": {
+ "post": {
+ "operationId": "mahjong___create-room",
+ "summary": "mahjong/create-room",
+ "description": "No description provided.\n\n**Credential required**: *Yes* / **Permission**: *write:account*",
+ "externalDocs": {
+ "description": "Source code",
+ "url": "https://github.com/misskey-dev/misskey/blob/develop/packages/backend/src/server/api/endpoints/mahjong/create-room.ts"
+ },
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK (with results)",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "$ref": "#/components/schemas/MahjongRoomDetailed"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "INVALID_PARAM": {
+ "value": {
+ "error": {
+ "message": "Invalid param.",
+ "code": "INVALID_PARAM",
+ "id": "3d81ceae-475f-4600-b2a8-2bc116157532"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Authentication error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "CREDENTIAL_REQUIRED": {
+ "value": {
+ "error": {
+ "message": "Credential required.",
+ "code": "CREDENTIAL_REQUIRED",
+ "id": "1384574d-a912-4b81-8601-c7b1c4085df1"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "AUTHENTICATION_FAILED": {
+ "value": {
+ "error": {
+ "message": "Authentication failed. Please ensure your token is correct.",
+ "code": "AUTHENTICATION_FAILED",
+ "id": "b0a7f5f8-dc2f-4171-b91f-de88ad238e14"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "418": {
+ "description": "I'm Ai",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "I_AM_AI": {
+ "value": {
+ "error": {
+ "message": "You sent a request to Ai-chan, Misskey's showgirl, instead of the server.",
+ "code": "I_AM_AI",
+ "id": "60c46cd1-f23a-46b1-bebe-5d2b73951a84"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Internal server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "INTERNAL_ERROR": {
+ "value": {
+ "error": {
+ "message": "Internal error occurred. Please contact us if the error persists.",
+ "code": "INTERNAL_ERROR",
+ "id": "5d37dbcb-891e-41ca-a3d6-e690c97775ac"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/mahjong/join-room": {
+ "post": {
+ "operationId": "mahjong___join-room",
+ "summary": "mahjong/join-room",
+ "description": "No description provided.\n\n**Credential required**: *Yes* / **Permission**: *write:account*",
+ "externalDocs": {
+ "description": "Source code",
+ "url": "https://github.com/misskey-dev/misskey/blob/develop/packages/backend/src/server/api/endpoints/mahjong/join-room.ts"
+ },
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "roomId": {
+ "type": "string",
+ "format": "misskey:id"
+ }
+ },
+ "required": [
+ "roomId"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "OK (with results)",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "$ref": "#/components/schemas/MahjongRoomDetailed"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "NO_SUCH_ROOM": {
+ "value": {
+ "error": {
+ "message": "No such room.",
+ "code": "NO_SUCH_ROOM",
+ "id": "370e42b0-2a67-4306-9328-51c5f568f110"
+ }
+ }
+ },
+ "INVALID_PARAM": {
+ "value": {
+ "error": {
+ "message": "Invalid param.",
+ "code": "INVALID_PARAM",
+ "id": "3d81ceae-475f-4600-b2a8-2bc116157532"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Authentication error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "CREDENTIAL_REQUIRED": {
+ "value": {
+ "error": {
+ "message": "Credential required.",
+ "code": "CREDENTIAL_REQUIRED",
+ "id": "1384574d-a912-4b81-8601-c7b1c4085df1"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "AUTHENTICATION_FAILED": {
+ "value": {
+ "error": {
+ "message": "Authentication failed. Please ensure your token is correct.",
+ "code": "AUTHENTICATION_FAILED",
+ "id": "b0a7f5f8-dc2f-4171-b91f-de88ad238e14"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "418": {
+ "description": "I'm Ai",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "I_AM_AI": {
+ "value": {
+ "error": {
+ "message": "You sent a request to Ai-chan, Misskey's showgirl, instead of the server.",
+ "code": "I_AM_AI",
+ "id": "60c46cd1-f23a-46b1-bebe-5d2b73951a84"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Internal server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "INTERNAL_ERROR": {
+ "value": {
+ "error": {
+ "message": "Internal error occurred. Please contact us if the error persists.",
+ "code": "INTERNAL_ERROR",
+ "id": "5d37dbcb-891e-41ca-a3d6-e690c97775ac"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/mahjong/show-room": {
+ "post": {
+ "operationId": "mahjong___show-room",
+ "summary": "mahjong/show-room",
+ "description": "No description provided.\n\n**Credential required**: *Yes* / **Permission**: *read:account*",
+ "externalDocs": {
+ "description": "Source code",
+ "url": "https://github.com/misskey-dev/misskey/blob/develop/packages/backend/src/server/api/endpoints/mahjong/show-room.ts"
+ },
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "roomId": {
+ "type": "string",
+ "format": "misskey:id"
+ }
+ },
+ "required": [
+ "roomId"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "OK (with results)",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "$ref": "#/components/schemas/MahjongRoomDetailed"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "NO_SUCH_ROOM": {
+ "value": {
+ "error": {
+ "message": "No such room.",
+ "code": "NO_SUCH_ROOM",
+ "id": "d77df68f-06f3-492b-9078-e6f72f4acf23"
+ }
+ }
+ },
+ "INVALID_PARAM": {
+ "value": {
+ "error": {
+ "message": "Invalid param.",
+ "code": "INVALID_PARAM",
+ "id": "3d81ceae-475f-4600-b2a8-2bc116157532"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Authentication error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "CREDENTIAL_REQUIRED": {
+ "value": {
+ "error": {
+ "message": "Credential required.",
+ "code": "CREDENTIAL_REQUIRED",
+ "id": "1384574d-a912-4b81-8601-c7b1c4085df1"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "AUTHENTICATION_FAILED": {
+ "value": {
+ "error": {
+ "message": "Authentication failed. Please ensure your token is correct.",
+ "code": "AUTHENTICATION_FAILED",
+ "id": "b0a7f5f8-dc2f-4171-b91f-de88ad238e14"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "418": {
+ "description": "I'm Ai",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "I_AM_AI": {
+ "value": {
+ "error": {
+ "message": "You sent a request to Ai-chan, Misskey's showgirl, instead of the server.",
+ "code": "I_AM_AI",
+ "id": "60c46cd1-f23a-46b1-bebe-5d2b73951a84"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Internal server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "INTERNAL_ERROR": {
+ "value": {
+ "error": {
+ "message": "Internal error occurred. Please contact us if the error persists.",
+ "code": "INTERNAL_ERROR",
+ "id": "5d37dbcb-891e-41ca-a3d6-e690c97775ac"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
}
},
"components": {
@@ -81282,6 +81740,123 @@
"name",
"method"
]
+ },
+ "MahjongRoomDetailed": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "format": "id"
+ },
+ "createdAt": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "startedAt": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "format": "date-time"
+ },
+ "endedAt": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "format": "date-time"
+ },
+ "isStarted": {
+ "type": "boolean"
+ },
+ "isEnded": {
+ "type": "boolean"
+ },
+ "user1Id": {
+ "type": "string",
+ "format": "id"
+ },
+ "user2Id": {
+ "type": "string",
+ "format": "id"
+ },
+ "user3Id": {
+ "type": "string",
+ "format": "id"
+ },
+ "user4Id": {
+ "type": "string",
+ "format": "id"
+ },
+ "user1": {
+ "type": "object",
+ "$ref": "#/components/schemas/User"
+ },
+ "user2": {
+ "type": "object",
+ "$ref": "#/components/schemas/User"
+ },
+ "user3": {
+ "type": "object",
+ "$ref": "#/components/schemas/User"
+ },
+ "user4": {
+ "type": "object",
+ "$ref": "#/components/schemas/User"
+ },
+ "user1Ai": {
+ "type": "boolean"
+ },
+ "user2Ai": {
+ "type": "boolean"
+ },
+ "user3Ai": {
+ "type": "boolean"
+ },
+ "user4Ai": {
+ "type": "boolean"
+ },
+ "user1Ready": {
+ "type": "boolean"
+ },
+ "user2Ready": {
+ "type": "boolean"
+ },
+ "user3Ready": {
+ "type": "boolean"
+ },
+ "user4Ready": {
+ "type": "boolean"
+ },
+ "timeLimitForEachTurn": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "id",
+ "createdAt",
+ "startedAt",
+ "endedAt",
+ "isStarted",
+ "isEnded",
+ "user1Id",
+ "user2Id",
+ "user3Id",
+ "user4Id",
+ "user1",
+ "user2",
+ "user3",
+ "user4",
+ "user1Ai",
+ "user2Ai",
+ "user3Ai",
+ "user4Ai",
+ "user1Ready",
+ "user2Ready",
+ "user3Ready",
+ "user4Ready",
+ "timeLimitForEachTurn"
+ ]
}
},
"securitySchemes": { |
* add daisangen test * add suanko test * add suanko-tanki test * add tsuiso test * fix typo * add test-shosushi * add test-daisushi * add ryuiso-test * add chinroto-test * add sukantsu-test * add kokushi-13-test
* fix typo * add letter-tiles tests * add ippatsu test * add tanyao and pinfu test * fix ippatsu test * add wind tests * add iipeko and chitoitsu test * add sanshoku-doujunn sanshoku-doo ittsu junchan tests * add toitoi sananko test * add ryanpeko test * add honroto sankantsu honitsu chintisu tests * add shosangen test
40%くらい終わってる |
四風連打とか今までなったことないし存在を知らなかった |
なんとなく今の進捗を見てて気づいたけど東風戦、半荘戦の区別がまだない? あと3人麻雀というのもあるわね |
無いわね
好き |
3麻に対応する予定があるならuser4はnullの可能性を考慮する必要がありそう(当分先だろうけど) |
* ビルドによる自動的なソース更新 * 麻雀関連のキーバリューペアを追加 * 役の定義をまとめてエクスポート * タイポ修正 * Revert "麻雀関連のキーバリューペアを追加" This reverts commit c349cdf. * misskey-jsのビルドによる自動更新
* ビルドによる自動的なソース更新 * 麻雀関連のキーバリューペアを追加 * 役の定義をまとめてエクスポート * タイポ修正 * Revert "麻雀関連のキーバリューペアを追加" This reverts commit c349cdf. * misskey-jsのビルドによる自動更新 * 型エラーに対処 * riichiがtrueの場合に門前であるかを確認 * EnvForCalcYakuのhouseプロパティを廃止 * 風牌の役の共通部分をクラスで定義 * タイポ修正 * 役牌をクラスで共通化 * 一盃口と二盃口のテストを通す * 一盃口・二盃口判定関数の調整 * 一気通貫の判定にチーによる順子も考慮する * 混全帯幺九の実装 * 純全帯幺九の実装 * 七対子の実装とテストの修正 * tsumoTileまたはronTileを必須に * 待ちを確認して平和の判定を可能に * 三暗刻と四暗刻、四暗刻単騎の実装 * 四暗刻であるために通常の役を判定できない牌姿のテストを修正 * 混老頭と清老頭を実装 * 三槓子と四槓子を実装 * 平和の実装とテストを修正 * 小三元のテストを修正 * 国士無双に対子の確認を追加 * 国士無双十三面待ちを実装し、テストを修正 * 一部の役の七対子形を認め、テストを追加 * 手牌の数を確認 * 役の定義をカプセル化して型エラーの対処 * ツモ・ロンの判定を修正 * calcYakusの引数のhandTilesを修正 * calcYakusに渡す風をseatWindに修正 * 嶺上開花の実装 * 海底摸月の実装 * FourMentsuOneJyantouWithWait型の作成 * 河底撈魚の実装 * ダブル立直の実装 * 天和・地和の実装 * エンジンのテストを作成 * エンジンによる地和のテストを追加 * 嶺上開花のテスト * ライセンスの記述を追加 * ダブル立直一発ツモのテスト * ダブル立直海底ツモのテスト * ダブル立直河底のテスト * 役満も処理できるように * 点数のテスト * 打牌時にrinshanFlags[house]をfalseに * 七対子形の字一色を認める * typo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
packages/backend
Server side specific issue/PR
packages/frontend
Client side specific issue/PR
packages/misskey-js
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
#1876
Why
Resolve #1876
Additional info (optional)
TODO
Checklist