deeper-blue / negativei2-server

The server for Deeper Blue, an assistive chess-playing robot. Developed for the System Design Project, a 3rd year course offered at the School of Informatics, University of Edinburgh.
Other
3 stars 0 forks source link

Draw and forfeit emits #49

Closed Jeremy643 closed 5 years ago

Jeremy643 commented 5 years ago

Include the ID of the opponent who will be receiving the draw offer or resignation notification in the emit.

notexactlyawe commented 5 years ago

Would it not make sense to include the ID of the person who caused the event? Because then as a unit it's a 'drawoffer' event with the ID of the person who made the offer. Otherwise it could become confusing from a readability perspective.

This shouldn't change the functionality of this either. To see if you need to display the event on the front end you can just check if your user ID doesn't match the one that generated the event.

Jeremy643 commented 5 years ago

The reason why I was thinking of including the ID of the opponent rather than the ID of the player issuing the draw offer or notification was to prevent spectators from receiving them.

notexactlyawe commented 5 years ago

I think that spectators should receive them, but perhaps not display them in the same way that the opponent would. If you're watching a game, I'd imagine you'd like to know if a player has forfeited or made an offer to draw since it reveals information about the game.