chaitu236 / TakServer

Server to handle online TAK games
https://www.playtak.com
GNU General Public License v2.0
35 stars 8 forks source link

server is double-sending moves in some cases #15

Open nelhage opened 8 years ago

nelhage commented 8 years ago

I have a bot that's logging all games on the server for analysis. In some cases where White plays a move and then the game ends (I can't tell from logs if this is due to time or resignation or what), it double-sends the opening move.

2016/05/04 10:46:26 < GameList Add Game#309 TakticianBot vs onewhohides, 5x5, 1200, 0 half-moves played, TakticianBot to move
2016/05/04 10:46:26 > Observe 309
2016/05/04 10:46:26 < Observe Game#309 TakticianBot vs onewhohides, 5x5, 1200, 1 half-moves played, onewhohides to move
2016/05/04 10:46:26 < Game#309 P A1
2016/05/04 10:46:26 < Game#309 Time 1200 -2216321
2016/05/04 10:46:26 < Game#309 P A1
2016/05/04 10:46:26 < Game#309 Time 1200 -2216321
2016/05/04 10:46:26 < GameList Remove Game#309 TakticianBot vs onewhohides, 5x5, 1200, 1 half-moves played, onewhohides to move
2016/05/04 10:46:26 < Game#309 Over 1-0
2016/05/04 10:46:26 < GameList Remove Game#309 TakticianBot vs onewhohides, 5x5, 1200, 1 half-moves played, onewhohides to move

There's also some weirdness with the time, which is being reported as -2216321 here…

chaitu236 commented 8 years ago

This looks like a synchronization issue. Currently, when I add a new spectator, I send the move list, but if the one of the players moves at the same time, there is a possibility of sending the move twice. Thanks for the bug report, I'd not noticed it before.

chaitu236 commented 8 years ago

Oh and recording games at your end might be redundant as I plan to release all the games.

nelhage commented 8 years ago

Yeah, I figured you'd get around to it, but it was easy and I wanted them for TakticianBot analysis. Thanks for the response!

On Wed, May 4, 2016, 17:03 Chaitanya Vadrevu notifications@github.com wrote:

Oh and recording games at your end might be redundant as I plan to release all the games.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/chaitu236/TakServer/issues/15#issuecomment-217043228