game/test.php

34 lines
632 B
PHP

<?php
use DarksLight2\Training\Steps\FirstStep;
use DarksLight2\Training\TrainingException;
use DarksLight2\Training\TrainingManager;
if (session_status() === PHP_SESSION_NONE) {
session_start();
}
if (isset($_GET['unset'])) {
session_unset();
}
if (!defined('GAME_VERSION')) {
require_once '_incl_data/autoload.php';
}
$user = User::start();
$manager = TrainingManager::getInstance($user->info['id']);
$manager->createDatabaseRecord();
try {
$manager->register([
new FirstStep(),
]);
} catch (TrainingException $e) {
}
if(!$manager->first_step->complete) {
$manager->first_step->render();
}