feat: 麻雀
What
#1876
Why
Resolve #1876
Additional info (optional)
TODO
- [ ] 各種役
- [ ] AIのロジックを別クラスに切り出す
- [ ] 流し満貫
- [ ] 四風連打
- [ ] さんま
Checklist
- [ ] Read the contribution guide
- [ ] Test working in a local environment
- [ ] (If needed) Add story of storybook
- [ ] (If needed) Update CHANGELOG.md
- [ ] (If possible) Add tests
この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": {
Codecov Report
Attention: Patch coverage is 17.96130% with 3010 lines in your changes missing coverage. Please review.
Project coverage is 41.21%. Comparing base (
865b303) to head (bf818a6). Report is 69 commits behind head on develop.
Additional details and impacted files
@@ Coverage Diff @@
## develop #13112 +/- ##
===========================================
+ Coverage 40.18% 41.21% +1.03%
===========================================
Files 1524 1567 +43
Lines 188816 200223 +11407
Branches 3466 2746 -720
===========================================
+ Hits 75875 82530 +6655
- Misses 112369 117119 +4750
- Partials 572 574 +2
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
完成度としては28%くらい
2DでのレンダリングめんどくさいからThreejsで3D描画にしたい
misskey-jsのchannel.types.tsも更新したいところ
35%くらい終わった
40%くらい終わってる
四風連打とか今までなったことないし存在を知らなかった
なんとなく今の進捗を見てて気づいたけど東風戦、半荘戦の区別がまだない?
あと3人麻雀というのもあるわね
東風戦、半荘戦の区別がまだない?
無いわね
あと3人麻雀というのもあるわね
好き
3麻に対応する予定があるならuser4はnullの可能性を考慮する必要がありそう(当分先だろうけど)