Example #1
0
    if (!empty($legalMoves['success']) && $legalMoves['success'] == 1) {
        $result = $legalMoves['result'];
        $process = 1;
    }
    $arr['result'] = $result;
    $arr['process'] = $process;
    $arr['ponder'] = NULL;
    $arr['time'] = '0 secs';
    if ($data = $Cache_Lite->get($id)) {
        $side = $arr['toMove'];
        replacemove($side, $data);
    } else {
        $arr = json_encode($arr);
        $Cache_Lite->save($arr);
        $side = $arr['toMove'];
        replacemove($side, $arr);
    }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Game</title>
<link rel="stylesheet" type="text/css" media="screen" href="css/chess.css"></link>
	<script type="text/javascript" src="js/ChessFen.js"></script>
	<style type="text/css" media="screen">
	body{
		font-family:"Trebuchet MS";
		font-size:0.9em;
		margin:0px;
Example #2
0
    $data = json_decode($data, 1);
    if (empty($side)) {
        $side = getside($data['toMove']);
    }
    $data['process'] = 0;
    replacemove($side, $data);
    $time2 = microtime(true);
    $data['time'] = $time2 - $time1 . ' secs';
    $data['id'] = $id;
    $data = json_encode($data);
} else {
    // page has to be (re)constructed in $data
    $chess = new Chess();
    $data = $chess->process($standard, $fen);
    if (empty($side)) {
        $side = getside($data['toMove']);
    }
    $data['process'] = 0;
    replacemove($side, $data);
    $time2 = microtime(true);
    $data['time'] = $time2 - $time1 . ' secs';
    $data['id'] = $id;
    $data = json_encode($data);
    $Cache_Lite->save($data);
}
if (isset($_GET['jsoncallback'])) {
    echo $_GET['jsoncallback'] . '(' . $data . ');';
} else {
    echo $data;
}
exit;