Commit efdf6f5
committed
fix(clock): only flag the player whose turn it is
After the first-move deduction fix, both players had identical stored
times (5000ms). When the clock expired, checkTimeout reported both
players as timed out because it didn't verify whose turn it was.
Whichever flag message arrived first determined the winner — on CI,
black's flag won the race, producing "Black wins" instead of
"White wins".
Add a FEN turn check to checkTimeout: only the player whose clock is
actively ticking (the one whose turn it is) can time out.1 parent 693db1f commit efdf6f5
2 files changed
Lines changed: 27 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1077 | 1077 | | |
1078 | 1078 | | |
1079 | 1079 | | |
| 1080 | + | |
1080 | 1081 | | |
1081 | 1082 | | |
1082 | 1083 | | |
1083 | 1084 | | |
1084 | 1085 | | |
1085 | 1086 | | |
1086 | | - | |
| 1087 | + | |
1087 | 1088 | | |
| 1089 | + | |
1088 | 1090 | | |
1089 | 1091 | | |
1090 | 1092 | | |
1091 | 1093 | | |
| 1094 | + | |
1092 | 1095 | | |
1093 | 1096 | | |
1094 | | - | |
| 1097 | + | |
1095 | 1098 | | |
1096 | 1099 | | |
1097 | 1100 | | |
1098 | 1101 | | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
1099 | 1116 | | |
1100 | 1117 | | |
1101 | 1118 | | |
1102 | 1119 | | |
1103 | 1120 | | |
1104 | 1121 | | |
| 1122 | + | |
1105 | 1123 | | |
1106 | 1124 | | |
1107 | | - | |
| 1125 | + | |
1108 | 1126 | | |
1109 | 1127 | | |
1110 | 1128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
600 | 600 | | |
601 | 601 | | |
602 | 602 | | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
603 | 609 | | |
604 | 610 | | |
605 | 611 | | |
| |||
0 commit comments