Starlight-30036225 / ChessTCP

FILLMELATER
0 stars 0 forks source link

Accepting move packets #19

Closed Starlight-30036225 closed 9 months ago

Starlight-30036225 commented 9 months ago

So far no pieces can actually move, the possible moves a piece can make are calculated and sent, but actual moves are not yet possible. For this I need the server class to accept move packets, then return the new board if the move was successful. I will add some checks on both sides to make sure the move is allowed.

Starlight-30036225 commented 9 months ago

image

Inside the mouse input handler I am checking if a move is valid, then sending the piece and the move to the server.

This function currently has no respect for which players turn it is, as that's a whole other system yet to be implemented.

Starlight-30036225 commented 9 months ago

image

Here I am accepting the string sent by the client, splitting it into its 4 relevant components and checking if the move is valid.

As the back end for moving pieces isnt done, for now it will just print out "Success"

Starlight-30036225 commented 9 months ago

image Looks good, now to work on the back end in a new issue