Interface ClientToAIServer

This is an exhaustive list of the messages that the client can send to the AI servers.

Hierarchy

Properties

ai-analyze-variation: ((data: {
    ai_review_id: string | number;
    from: number;
    game_id: string | number;
    uuid: string;
    variation: string;
}) => void)

Type declaration

    • (data: {
          ai_review_id: string | number;
          from: number;
          game_id: string | number;
          uuid: string;
          variation: string;
      }): void
    • Parameters

      • data: {
            ai_review_id: string | number;
            from: number;
            game_id: string | number;
            uuid: string;
            variation: string;
        }
        • ai_review_id: string | number

          The AI review id we're basing our analysis off of

        • from: number

          The move number we're branching from

        • game_id: string | number

          The game id we're analyzing

        • uuid: string

          AI UUID

        • variation: string

          Move string

      Returns void

ai-review-connect: ((data: {
    ai_review_id: string | number;
    game_id: string | number;
    uuid: string;
}) => void)

Type declaration

    • (data: {
          ai_review_id: string | number;
          game_id: string | number;
          uuid: string;
      }): void
    • Parameters

      • data: {
            ai_review_id: string | number;
            game_id: string | number;
            uuid: string;
        }
        • ai_review_id: string | number

          The AI review id we're basing our analysis off of

        • game_id: string | number

          The game id we're reviewing

        • uuid: string

          AI UUID

      Returns void

ai-review-disconnect: ((data: {
    uuid: string;
}) => void)

Type declaration

    • (data: {
          uuid: string;
      }): void
    • Parameters

      • data: {
            uuid: string;
        }
        • uuid: string

          AI UUID

      Returns void

authenticate: ((data: {
    bot_apikey?: string;
    bot_username?: string;
    client?: string;
    client_version?: string;
    device_id?: string;
    jwt: string;
    language?: string;
    language_version?: string;
    user_agent?: string;
}) => undefined | {
    id: number;
    username: string;
})

Type declaration

    • (data: {
          bot_apikey?: string;
          bot_username?: string;
          client?: string;
          client_version?: string;
          device_id?: string;
          jwt: string;
          language?: string;
          language_version?: string;
          user_agent?: string;
      }): undefined | {
          id: number;
          username: string;
      }
    • Authenticate with the server.

      Prior to authentication, you should perform a GET request to /api/v1/ui/config to get the current configuration. Within the returned JSON you will find all of the necessary fields to authenticate.

      Parameters

      • data: {
            bot_apikey?: string;
            bot_username?: string;
            client?: string;
            client_version?: string;
            device_id?: string;
            jwt: string;
            language?: string;
            language_version?: string;
            user_agent?: string;
        }
        • Optional bot_apikey?: string

          Bot API key, if applicable

        • Optional bot_username?: string

          Bot username connecting, if applicable

        • Optional client?: string

          Client name (your application name)

        • Optional client_version?: string

          Client version string.

        • Optional device_id?: string

          Client generated unique id for the device.

        • jwt: string

          The JSON Web Token (user_jwt field) from /api/v1/ui/config

        • Optional language?: string

          ISO 639-1 language code used on this device.

        • Optional language_version?: string

          The version of the translation dictionary.

        • Optional user_agent?: string

          Browser user agent (or websocket library)

      Returns undefined | {
          id: number;
          username: string;
      }

net/ping: ((data: {
    client: number;
    drift: number;
    latency: number;
}) => void)

Type declaration

    • (data: {
          client: number;
          drift: number;
          latency: number;
      }): void
    • Sends a ping to the server. This message should be sent regularly. The default interval is 10 seconds. This keeps the connection alive and allows a client to measure clock drift and latency, both of which are vital to adjusting the client's game clock displays.

      Parameters

      • data: {
            client: number;
            drift: number;
            latency: number;
        }
        • client: number

          Client timestamp - milliseconds since epoch

        • drift: number

          Last clock drift measurement, or 0

        • latency: number

          Last latency measurement, or 0

      Returns void

Generated using TypeDoc