-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add API endpoint for starting a game #12
Comments
Is there anyone who can discuss and work on the issue together ? |
It's better for all the players to call the endpoint to at least they are not afk and will join the game |
OK , I can take this after #37 , |
So you will try to use the player ID to find which room game that you should mark it as start |
Hi, wingtkw Yes , due to the fact custom data like player ID cannot be embedded in authentication token (JWT) provided by the Lobby Platform, I would consider to add the field to the request body.
Also note another REST endpoint |
- forward the request to relevant socket.io event `game-start` - the use-case layer simply invokes `Game.start(player-id)` TODO - set up ready flag in `Player` model, avoid subsequent configuration after the flag is set - update Open API spec Signed-off-by: T.H. <[email protected]>
Signed-off-by: T.H. <[email protected]>
Signed-off-by: T.H. <[email protected]>
Thanks wingtkw for the approval. |
Overview
The endpoint is in current Open API doc :
/games/{gameId}/start
,PATCH
method , no request bodyThe backend service will :
start-playing
, subsequent configuration will be rejected, such as switch to different investigator.game-start
event with it to all other playersI'll modify request body of the REST endpoint to something like :
Since the endpoint needs to know which player triggers the start button
Question (Answered / Closed)
what is the effect of the endpoint ? here are 2 options :
Then both of the options should trigger event to
socket.io
server, which notifies other players the game has started.c.c. @wingtkw,
For those still interested with the game dev, please take a look,
feedback or suggestion are welcome.
I am working on this GitHub Issue ,
It is simply creating new endpoint and a use-case class with empty logic,
left rest of detail to game domain model.
The text was updated successfully, but these errors were encountered: