hahaharry10 / Chess-Game

This project will create a command line chess game that will talk wirelessly to a second device.
0 stars 0 forks source link

Notify client when the game is won or lost #18

Closed hahaharry10 closed 11 months ago

hahaharry10 commented 11 months ago

At this point a lot of the game logic is implemented but the big issue is that when the opponent is checkmate, there is no way for the opponent to be told the game is lost.

hahaharry10 commented 11 months ago

The current idea I am considering using is having 3 message terminators.

We already have a message terminator telling the client to stop listening, but if we have 3 terminators we can have one for telling the client to stop listening to the server, one to tell the client the message is finished and the game is lost, and one to tell the client the message is finished and that the game is won.

hahaharry10 commented 11 months ago

We could however keep the logic server-side and maybe have only 2 terminators (the second says the game is finished) and the server handles the win-lose messages

hahaharry10 commented 11 months ago

chose to keep the win-lose messages on the server side and implement 2 terminators. This allows for the client to close down even if there is a server error and no matter why the game ends the server can send a more customizable message to the players.