<?php
require __DIR__.'/_bootstrap.php';

use Zoo\Database;
use Zoo\Auth\PlayerAuthService;
use Zoo\Account\BindService;

try{
    $db=Database::connect();
    $player=(new PlayerAuthService($db))->authenticate([]);
    $status=(new BindService($db))->status((int)$player['user_id']);
    json_out(['ok'=>true,'binding'=>$status]);
}catch(Throwable $e){
    json_out(['ok'=>false,'error'=>$e->getMessage()],400);
}
