quasoft / backgammonjs

`backgammonjs` is an extensible multiplayer backgammon game written in JavaScript.
MIT License
90 stars 54 forks source link

Resign Game #31

Open Ali9731 opened 1 year ago

Ali9731 commented 1 year ago

Hi, when i using resign game . it runs 3 times till the match ends. this is the logs on server:

---->these are the logs after clicking resign game just one time

Resign game { clientMsgSeq: 11 } match score before update------------- [ 0, 0 ] score ====== 3 match score after update=============== [ 3, 0 ] Game finished , Creating new one ... bankemoon0000000000000000 180 Timer started for match with ID: 48082354 Players remaining time for match: 48082354 [ 0, 0 ] Resign game { clientMsgSeq: 12 } match score before update------------- [ 3, 0 ] score ====== 3 match score after update=============== [ 6, 0 ] match score > match length!!! match isover == true , so match is over Resign game { clientMsgSeq: 13 } match score before update------------- [ 6, 0 ] match score after update=============== [ 6, 0 ] match score > match length!!! match isover == true , so match is over Socket ID: k4vL5OdpN7d71dLrAAAA 38 not_double Recursion time: 1.374ms Socket ID: k4vL5OdpN7d71dLrAAAA Socket ID: k4vL5OdpN7d71dLrAAAA Socket ID: k4vL5OdpN7d71dLrAAAA Socket ID: k4vL5OdpN7d71dLrAAAA Axios: Match result of set

Ali9731 commented 1 year ago

why it runs resign game 3 times??

quasoft commented 1 year ago

Looks like a bug that should be traced all the way from clicking the button, through updating the match state, to updating the UI on the client.

Don't have suitable environment or time to test it myself.

Ali9731 commented 1 year ago

thanks ,fixed