Skip to content

Commit cb09173

Browse files
authored
Merge pull request #216 from online-go/fix_stone_removal_expiration_update
Put stone_removal_expiration onto AdHocClock
2 parents 1c2222d + 2566f23 commit cb09173

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/Goban/OGSConnectivity.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1698,7 +1698,9 @@ export abstract class OGSConnectivity extends GobanInteractive {
16981698
}
16991699
clock.pause_state = AdHocPauseControl2JGOFPauseState(this.pause_control);
17001700
if (clock.pause_state.stone_removal) {
1701-
clock.stone_removal_time_left = original_clock.expiration - current_server_time;
1701+
clock.stone_removal_time_left =
1702+
(original_clock.stone_removal_expiration ?? original_clock.expiration) -
1703+
current_server_time;
17021704
}
17031705
}
17041706

src/engine/formats/AdHocFormat.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,13 @@ export interface AdHocClock {
8989
* `expiration` (in ms) */
9090
start_mode?: boolean;
9191

92+
/** If true, the game is in stone removal phase */
93+
stone_removal_mode?: boolean;
94+
95+
/** Time the stone removal phase will end if no action is taken,
96+
* in milliseconds since 1970. Only set when stone_removal_mode is true. */
97+
stone_removal_expiration?: number;
98+
9299
/** If set, this AdHocClock is updating the pause state */
93100
pause?: {
94101
paused: boolean;

0 commit comments

Comments
 (0)