<?php

require "../header.php";

MTGImage::resetPlayed();

if ( isset($_REQUEST['cardcount']) ) {
   $_SESSION['cardcount'] = intval($_REQUEST['cardcount']);
   if ( $_SESSION['cardcount'] < 0 ) $_SESSION['cardcount'] = 0;
} else {
   $_SESSION['cardcount'] = 0;
}
$_SESSION['cardlist'] = [];
$_SESSION['startcount'] = $_SESSION['cardcount'];

$data = array();
$data['cardcount'] = $_SESSION['cardcount'];

header('Content-Type: application/json');
echo json_encode($data);
exit();
