-
Notifications
You must be signed in to change notification settings - Fork 703
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
player information should come through to the client #1117
Comments
Is the [
{ id: 0, name: 'Alice' },
{ id: 1, name: 'Bob', isConnected: true }
] |
It's possible! I was looking for a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's a bit awkward that player information is only available at the endpoint
/games/[game]/[matchID]
. I want to be able to access the players'name
andisConnected
properties to provide a better UI experience. Right now I have to rely on separately making a call to the REST endpoint only to capture the data about the match I'm in!For example, the
Board
defined in the Client's documentation should receive an additional prop (in the case of React) calledplayers
containing their ID, name, and online status. This way we could add elements around the board to make it clear who is playing and whose turn is it by highlighting different areas of the UI outside the board itself that is, we could make a dedicated player card for each player.This would also make it trivial to pass the names of the players to the
Chat
component, as it is currently only possible to post "Player 0 says..." instead of their name, but the name is required to join a match! Ideally, thechatMessages
prop would also be expanded to include the name alongsideid
(msg ID),sender
(player ID) and payload (which I realize can include the name, but it still doesn't make it available to theBoard
).I might put some work towards creating a push request if the idea is approved. This wouldn't break backwards compatibility.
The text was updated successfully, but these errors were encountered: