<?php
include('../session.php');

header('Content-Type: application/json');

$user = $_POST['user'];
$game = $_POST['game'];

$postArray = [
    'method'      => 'call_scatter',
    'agent_code'  => NEXUS_AGENT,
    'agent_token' => NEXUS_TOKEN,
    'user_code'   => $user,
    'game_code'   => $game
];

$ch = curl_init(NEXUS_URL);
curl_setopt_array($ch,[
    CURLOPT_RETURNTRANSFER=>true,
    CURLOPT_POST=>true,
    CURLOPT_HTTPHEADER=>['Content-Type: application/json'],
    CURLOPT_POSTFIELDS=>json_encode($postArray),
    CURLOPT_TIMEOUT=>10
]);

$res = curl_exec($ch);
curl_close($ch);
echo $res;
?>