KYLChiu / sporkfish

Chess engine in Python
MIT License
5 stars 0 forks source link

[Feature] Synchronously handle opponentGone #131

Closed KYLChiu closed 3 months ago

KYLChiu commented 6 months ago

https://lichess.org/api#tag/Bot/operation/botGameStream

Handle the opponentGoneTrue and opponentGoneFalse states - if True we should try to claim victory after waiting for some time. Ideally I'd like to make it asynchronous - if we have to wait a long time to claim a win but then the opponent comes back, we want to start the search immediately. Don't worry about rate limiting for now, I'll do that part.

EDIT: we changed to busy polling but still able to restart the search immediately.

See https://github.com/KYLChiu/sporkfish/blob/master/sporkfish/lichess_bot/lichess_bot_berserk.py#L131 for examples of how we handle game states now.

KYLChiu commented 6 months ago

@claudiayip to implement, @kwngggg and me to review pls! Much appreciated