Skip to content

Conversation

@tom-anders
Copy link
Collaborator

@tom-anders tom-anders commented Mar 29, 2025

tournamentGame.webm

TODO:

  • add berserk.aifc

@tom-anders tom-anders marked this pull request as draft March 29, 2025 23:58
@tom-anders
Copy link
Collaborator Author

tom-anders commented Mar 29, 2025

(converting to a draft until the other PR is merged. I also need to do some more real-world testing)

@tom-anders
Copy link
Collaborator Author

@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?

@veloce
Copy link
Contributor

veloce commented Apr 1, 2025

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.

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.
@tom-anders tom-anders force-pushed the tournamentGameScreen branch from 02835d0 to 26e379b Compare April 9, 2025 17:26
@tom-anders tom-anders marked this pull request as ready for review April 9, 2025 17:26
@tom-anders
Copy link
Collaborator Author

Did some testing with my local lila instance and fixed some small bugs. I think this is ready to go now :)

@tom-anders tom-anders requested a review from veloce April 9, 2025 17:27
@tom-anders
Copy link
Collaborator Author

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.

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
@tom-anders
Copy link
Collaborator Author

Ah, the test failed because I had a bug where one side berserking would reset the other side's berserk status, fixed now

Copy link
Contributor

@veloce veloce left a 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(),
Copy link
Contributor

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?

Copy link
Collaborator Author

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

  1. If clocks is 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.
  2. If clocks is null and winner is null, the game is finished and it's a draw
  3. Otherwise, the game is finished and winner tells us who won

Copy link
Contributor

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)
@veloce
Copy link
Contributor

veloce commented Apr 16, 2025

Not properly merged because it was rebased on main, but effectively merged.

@veloce veloce closed this Apr 16, 2025
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

Successfully merging this pull request may close these issues.

2 participants