-
-
Notifications
You must be signed in to change notification settings - Fork 166
Description
I am trying to show the time for moves with the game stream API and the only time related information is bc and wc properties (clock times in seconds for each side). Only the time the moves are sent in the NDJSON stream seems unrelated to the time of the move itself. Two updates two seconds apart can decrease the time of one side by tens of seconds and updates tens of seconds apart can decrease the time of one side with just 2 seconds.
The documentation says "Ongoing games are delayed by 3 moves, as to prevent cheat bots from using this API", however I suspect the time the update is sent is related to the current player move, not the move in the NDJSON update. I may be wrong, but I think what happens is that when a player makes a move, an update is sent, but the update is that of the move three ply back. However, that makes the wc and bc values uncorrelated to the current time.
The updates should come in real time, but delayed with a constant time, not a number of ply. An alternate solution is to include a serverTime property that would tell when the data is from.
Here is an example of how the data is received. The first number is a relative timestamp in seconds, the second and third are white clock and black clock in seconds:
55: 100 | 151
59: 98 | 151
61: 98 | 149
65: 88 | 149
79: 88 | 146
81: 86 | 146
82: 86 | 142
84: 72 | 142
85: 72 | 140
88: 71 | 140
89: 71 | 139
89: 70 | 139
106: 70 | 136
108: 69 | 136
Note how between 82 and 84 two seconds have passed, but the update of White's clock is 14 seconds. That is offset by 89-106 (17 seconds) where Black's clock is updated with just 3 seconds.