Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Board API gameState response has no winner field the first time it is received #61

Closed
mcaap opened this issue Sep 24, 2020 · 3 comments
Closed

Comments

@mcaap
Copy link

mcaap commented Sep 24, 2020

Board API: When a game finishes in mate, the responses received from server are as follows:

  1. "type":"gameState"..."wdraw":false,"bdraw":false,"status":"mate"} (note no winner field)
  2. {"type":"gameFinish",...
  3. "type":"gameState"... ,"status":"mate","winner":"black"} (this time there is both status and winner fields!)

Ideally, in the first case itself, the winner field should have been received, since most Clients/GUIs will probably stop the game since "status" is already mate.. but unfortunately there is no winner field

@ornicar
Copy link
Contributor

ornicar commented Sep 24, 2020

Well usually in case of checkmate, the player who made the last move wins.

@ornicar
Copy link
Contributor

ornicar commented Sep 24, 2020

But yeah that's not great, there are 2 almost similar events. Trying to solve that without breaking existing bots.

@ornicar
Copy link
Contributor

ornicar commented Sep 24, 2020

fixed by lichess-org/lila@d9a8f7a

@ornicar ornicar closed this as completed Sep 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants