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

Fixed the functionality of START_GAME Event #172

Merged
merged 2 commits into from
Jun 28, 2024

Conversation

Abhishek-Punhani
Copy link

Description

Added handler for StartGame at frontend and made some minor corrections. Also Triggered Sync_State Event after Start_Game and draw_card event as these events make changes using backend functions.
These changes require to synced just after the event is triggered

Fixes : #169

Checklist

  • I have tested these changes locally.
  • I have reviewed the code and ensured it follows the project's coding guidelines.
  • I have updated the documentation, if necessary.
  • I have assigned reviewers to this pull request.

Screenshots (if applicable)

[If your changes include any visual updates, provide screenshots here.]

Copy link

vercel bot commented Jun 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
multiplayer-uno ❌ Failed (Inspect) Jun 28, 2024 5:13am

Triggering Sync_State Event after Start_Game and draw_card event as these events make changes using backend functions

These changes require to synced just after the event is triggered

In preperation of shivansh-bhatnagar18#169
Copy link
Collaborator

@kuv2707 kuv2707 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some suggestions. Looks good mostly, haven't tested menually

useEffect(() => {
modal.show(<GamePropertiesModal />, 'large', [], false);
// eslint-disable-next-line
}, []); // todo add the required dependencies
}, [gameState.players.length, gameState.id]); // todo add the required dependencies
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Including id here is necessary as previously explained. As long as the Game component is mounted, the game's id wont change.

This change will cause a UX inconvenience as previously mentioned, but we can ignore that for now.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this , for joining players game id is not visible on the modal , so i included it , for now, i guess, we can keep it like this and fix this in upcoming prs.

@@ -78,10 +80,11 @@ function Game() {
const shuffledCards = [...cards].sort(() => Math.random() - 0.5);
return shuffledCards.slice(0, 7);
}, []);
console.log(gameState);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this

 Added handler for StartGame at frontend and made some minor corrections

Fixes : shivansh-bhatnagar18#169
Copy link
Collaborator

@kuv2707 kuv2707 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good

@kuv2707 kuv2707 merged commit 31b6518 into shivansh-bhatnagar18:master Jun 28, 2024
6 of 8 checks passed
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

Successfully merging this pull request may close these issues.

Implement the START_GAME Event Correctly
2 participants