#include "bsphp_client.h"
#include "bsphp_config.h"

#include <stdio.h>
#include <stdlib.h>
#include <windows.h>

int main(void) {
    bsphp_client_t client;
    char *resp = NULL;

    SetConsoleOutputCP(65001);
    SetConsoleCP(65001);

    bsphp_client_init(&client);
    bsphp_client_set_verbose(&client, BSPHP_VERBOSE_DEFAULT);

    printf("== BSPHP LOGIN C DEMO ==\n");
    printf("1) bootstrap(connect + BSphpSeSsL)\n");
    if (!bsphp_bootstrap(&client, &resp)) {
        printf("bootstrap failed\n");
        return 1;
    }
    printf("bootstrap raw response: %s\n", resp);
    free(resp);
    resp = NULL;

    printf("2) gg.in notice\n");
    if (bsphp_get_notice(&client, &resp)) {
        printf("notice raw response: %s\n", resp);
        free(resp);
        resp = NULL;
    }

    /*
     * 3) 登录示例（默认注释，避免误请求）
     * if (bsphp_login_lg(&client, "demo_user", "demo_pwd", "1234", "machine_code_xxx", &resp)) {
     *     printf("login raw response: %s\n", resp);
     *     free(resp);
     * }
     */
    return 0;
}
