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

串接大平台項目 #92

Open
3 of 5 tasks
s9891326 opened this issue Aug 31, 2023 · 0 comments
Open
3 of 5 tasks

串接大平台項目 #92

s9891326 opened this issue Aug 31, 2023 · 0 comments

Comments

@s9891326
Copy link
Collaborator

s9891326 commented Aug 31, 2023

  • 新增API 心跳(/health),固定回傳status = 200
  • 驗證JWT是否正確
    image
  • 新增API 開始遊戲(/games),把既有的create_game()、join_game()、start_game()整合在同一支API中
    image
  • 新增API 取得遊戲狀態(/games/{gameId}/status) Authorization: Bearer <playerJwt>,透過playerJWT,去訪問大平台的GET /users/me取得該用戶ID,就能透過用戶ID、gameID辨別是哪一場遊戲中的玩家,playerJWT短時間不會變,cache起來
GET /games/{game_id}/status
Authorization: Bearer <playerJwt>

image

  • 增加前端入口https://{遊戲前端主機}/games/{gameId}?token={playerJwt},顯示遊戲畫面,再去呼叫後端API(/games/{gameId}/status Authorization: Bearer <playerJwt>)取得遊戲狀態
    image
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

1 participant