<?php

// COMMONS + DB

require "include/common.php";

// POST DATA CHECKS

$chapter_name = get_post("chapter_name", false, "");
$variant_name = get_post("variant_name", false, "");
$screen_name  = get_post("screen_name", false, "");
$action_type  = get_post("action_type");
$action_info  = get_post("action_info");

// SESSION MUST BE ACTIVE

$session_id = check_session_post();

// LOG PLAYER ACTION

player_action($session_id, $chapter_name, $variant_name, $screen_name, $action_type, $action_info);

// RESPOND

response_json_ok(array()); // will exit()