Skip to content

Conversation

@veloce
Copy link
Contributor

@veloce veloce commented Nov 5, 2024

Make the real time game clocks more precise by implementing:

A new chess clock for playable games with:

  • server lag compensation (network lag returned by server)

An update of CountdownClock widget:

  • UI lag compensation (time between the received clock event and when the change is displayed)
  • server lag compensation (for TV so it matches server, even though it is less important to have a precise time here)

The latter is no more used for playable game, only for read-only display of clocks where live clock ticking is needed (TV, broadcast, etc).

@@ -1,122 +1,99 @@
import 'dart:async';

import 'package:clock/clock.dart';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we using this package for the countdown clock widget ?

I don't see why Datetime.now and the builtin Stopwatch would not work.

Copy link
Contributor Author

@veloce veloce Nov 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be able to test the clocks. Contrary to DateTime, clock is overridden in fakeAsync environment. So we can reliably measure the elapsed time in tests.

@veloce veloce changed the title Move lag compensation Move lag compensation and clock improvements Nov 14, 2024
@veloce veloce marked this pull request as ready for review November 18, 2024 10:52
@veloce veloce merged commit 816a8d4 into main Nov 18, 2024
1 check passed
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.

3 participants