import { GobanInteractive, MoveCommand } from "./InteractiveBase"; import { GobanConfig } from "../GobanBase"; import { AdHocClock, AdHocPlayerClock, IGobanSocket, GobanSocketEvents, GobanEngine, JGOFPlayerClock, JGOFTimeControl, ReviewMessage } from "../engine"; import { ChatMessageBody } from "../engine/protocol"; interface JGOFPlayerClockWithTimedOut extends JGOFPlayerClock { timed_out: boolean; } /** How long a player's client waits for the server's dead-stone proposal * before scoring locally. A scorer that fails fast is reported by the * server's failure broadcast, which ends the wait at once; this bounds the * wait for a scorer that is slow or hung, or a server that never answers. */ export declare const SERVER_AUTOSCORE_WAIT_MS = 15000; /** * This class serves as a functionality layer encapsulating the logic connection * that manages connections to the online-go.com servers. * * We have it as a separate base class simply to help with code organization * and to keep our Goban class size down. */ export declare abstract class OGSConnectivity extends GobanInteractive { sent_timed_out_message: boolean; protected socket: IGobanSocket; protected socket_event_bindings: Array<[keyof GobanSocketEvents, () => void]>; protected connectToReviewSent?: boolean; private server_autoscore_timer?; constructor(config: GobanConfig, preloaded_data?: GobanConfig); protected post_config_constructor(): GobanEngine; destroy(): void; protected _socket_on(event: KeyT, cb: any): void; protected getClockDrift(): number; protected getNetworkLatency(): number; protected connect(server_socket: IGobanSocket): void; protected disconnect(): void; sendChat(msg_body: string | ChatMessageBody, type: string): void; /** * When we think our clock has runout, send a message to the server * letting it know. Otherwise we have to wait for the server grace * period to expire for it to time us out. */ sendTimedOut(): void; /** Sets (or, with null, clears) a player's clock on the current review * node, as the review's controller. */ setReviewNodeClock(color: "black" | "white", clock: JGOFPlayerClock | null): void; syncReviewMove(msg_override?: ReviewMessage, node_text?: string): void; protected sendMove(mv: MoveCommand, cb?: () => void): boolean; giveReviewControl(player_id: number): void; saveConditionalMoves(): void; resign(): void; protected sendPendingResignation(): void; protected clearPendingResignation(): void; cancelGame(): void; protected annul(): void; pass(): void; requestUndo(): void; acceptUndo(): void; cancelUndo(): void; pauseGame(): void; resumeGame(): void; deleteBranch(): void; /** This is a callback that gets called by GobanEngine.setState to load * previously saved board state. */ setState(): void; sendPreventStalling(winner: "black" | "white"): void; sendPreventEscaping(winner: "black" | "white", annul: boolean): void; /** True for the player whose client takes part in stone removal * scoring: a seated player viewing the game screen. */ private isStoneRemovalAutoScoringPlayer; /** * Entry point when the game is in stone removal. The server proposes * the dead stones for boards it can score, so this waits for that; a * larger board is scored locally; a game whose data already carries a * proposal needs nothing. */ private startStoneRemovalAutoScoring; private awaitServerAutoScoring; private cancelServerAutoScoringWait; /** The stone removal state is settled without this client scoring: * ends the wait if one is running. */ private serverAutoScoringEnded; /** * The "Auto-score" button. Scores with the remote scorer, and the result * replaces the stone removal state, including the players' manual marks. */ performStoneRemovalAutoScoring(): void; /** * Scores with the local WASM estimator when the server has no proposal. * The server merges the result with the players' manual marks and * broadcasts it, so the board is not changed here. */ protected scoreStoneRemovalLocally(): void; private runStoneRemovalAutoScoring; acceptRemovedStones(): void; rejectRemovedStones(): void; getPlayerRelativeLatency(player_id: number): number; getLastReviewMessage(): ReviewMessage; setLastReviewMessage(m: ReviewMessage): void; setGameClock(original_clock: AdHocClock | null): void; protected computeNewPlayerClock(original_player_clock: Readonly, is_current_player: boolean, time_elapsed: number, time_control: Readonly): JGOFPlayerClockWithTimedOut; setStrictSekiMode(tf: boolean): void; } export {};