Exemple #1
0
$variables['gop'] = round($variables['max_sectors'] * filter_input(INPUT_POST, 'goods', FILTER_SANITIZE_NUMBER_INT) / 100);
$variables['enp'] = round($variables['max_sectors'] * filter_input(INPUT_POST, 'energy', FILTER_SANITIZE_NUMBER_INT) / 100);
$variables['nump'] = round($variables['max_sectors'] * filter_input(INPUT_POST, 'planets', FILTER_SANITIZE_NUMBER_INT) / 100);
$variables['empty'] = $variables['max_sectors'] - $variables['spp'] - $variables['oep'] - $variables['ogp'] - $variables['gop'] - $variables['enp'];
$variables['initscommod'] = filter_input(INPUT_POST, 'initscommod', FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
$variables['initbcommod'] = filter_input(INPUT_POST, 'initbcommod', FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
$variables['fedsecs'] = filter_input(INPUT_POST, 'fedsecs', FILTER_SANITIZE_NUMBER_INT);
$variables['loops'] = filter_input(INPUT_POST, 'loops', FILTER_SANITIZE_NUMBER_INT);
$variables['swordfish'] = filter_input(INPUT_POST, 'swordfish', FILTER_SANITIZE_URL);
$variables['autorun'] = filter_input(INPUT_POST, 'autorun', FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);
// Database driven language entries
$langvars = Tki\Translate::load($pdo_db, $lang, array('common', 'regional', 'footer', 'global_includes', 'create_universe', 'news'));
$variables['update_ticks_results']['sched'] = $tkireg->sched_ticks;
$local_table_timer = new Tki\Timer();
$now = time();
$local_table_timer->start();
// Start benchmarking for turns scheduler
$sched_file = 'sched_turns.php';
$sql = "INSERT INTO ::prefix::scheduler (run_once, ticks_full, sched_file, last_run) VALUES ('N', :ticks_full, :sched_file, :last_run)";
$stmt = $pdo_db->prepare($sql);
$stmt->bindParam(':ticks_full', $tkireg->sched_turns);
$stmt->bindParam(':sched_file', $sched_file);
$stmt->bindParam(':last_run', $now);
$resxx = $stmt->execute();
$variables['update_turns_results']['result'] = Tki\Db::logDbErrors($pdo_db, $resxx, __LINE__, __FILE__);
$variables['update_turns_results']['sched'] = $tkireg->sched_turns;
$local_table_timer->stop();
$variables['update_turns_results']['elapsed'] = $local_table_timer->elapsed();
$local_table_timer->start();
// Start benchmarking for Xenobe
$sql = "INSERT INTO ::prefix::scheduler (run_once, ticks_full, sched_file, last_run) VALUES ('N', :ticks_full, :sched_file, :last_run)";