-
-
Notifications
You must be signed in to change notification settings - Fork 310
feat: add tournament support to game screen #1597
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
Conversation
|
(converting to a draft until the other PR is merged. I also need to do some more real-world testing) |
|
@veloce what's the process for adding new sound assets? I found the mp3 for the berserk sound in the old app, but looks like for the new app I need to convert to .aifc as well? |
|
If you cannot convert easily to aifc I can do it myself no worries. The process to add new sounds is to check if the sound is available in the supported sound themes. Then adding all the required assets. |
This reverts commit d7529f2.
If open the tournament screen and the featured game is currently finished, the `finished` field would never be set (as we receive that via the websocket). Instead, check the clocks, as the server only includes them if the game is active.
02835d0 to
26e379b
Compare
|
Did some testing with my local lila instance and fixed some small bugs. I think this is ready to go now :) |
alright, I added the mp3 from the old app, I couldn't figure out how to get ffmpeg to convert that to aifc |
- Send server confirmation - Don't reset opposite side's berserk status
|
Ah, the test failed because I had a bug where one side berserking would reset the other side's |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Note I only reviewed the code, and won't be able to test it before a few days.
| orientation: pick('orientation').asSideOrThrow(), | ||
| fen: pick('fen').asStringOrThrow(), | ||
| lastMove: pick('lastMove').asUciMoveOrNull(), | ||
| finished: pick('finished').asBoolOrNull(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might still want to keep it. Perhaps I'm wrong but if server provides that fields doesn't it mean that absence of clocks is not enough to determine a tournament is finished on some cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why I thought so, but the server does not actually provide this field: https://github.com/lichess-org/lila/blob/cc2156805a95b5156e096166db067fd7c8950a07/ui/tournament/src/interfaces.ts#L100
As far as I understand it, you can fully determine the state from the combination of clocks, winner and fen
- If
clocksis not null, the game is either started or not started yet
a) If the FEN is the initial FEN, the game is not started (yes, this breaks for some variants, but lila uses the same heuristic and most tournament games start quickly)
b) Otherwise, the game is started. - If
clocksis null andwinneris null, the game is finished and it's a draw - Otherwise, the game is finished and
winnertells us who won
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I thought it was for the tournament, but it is for the featured game. Fine then.
(accidentally committed, needs to be converted from the corresponding mp3)
|
Not properly merged because it was rebased on main, but effectively merged. |
tournamentGame.webm
TODO: