Чистка оптимизация и унификация кода.

This commit is contained in:
lopar
2020-08-30 02:21:22 +03:00
parent 8a2dfea36b
commit 427149b90e
16 changed files with 2119 additions and 2019 deletions
+3
View File
@@ -41,6 +41,9 @@ class User
// Пока несуществующие, для совместимости.
public $married = 'Someone или нет.';
public $experience = 200;
public $battle = 0;
public $in_tower = 0; // Скорее башню похороним чем запустим...
public $zayavka = 0;
// Динамически рассчитываемые
public $maxHealth = 5;
public $maxMana = 5;
+2 -2
View File
@@ -1567,7 +1567,7 @@ class fbattle
include "../darkness_quest.php";
$this->exp[$v] = round($this->exp[$v]);
$dop_exp = check_proc($this->user['id']);
$dop_exp = 100; //процент опыта
if ($dop_exp > 100) {
$add = ($dop_exp - 100);
$this->exp[$v] += round(($this->exp[$v] * $add) / 100, 0);
@@ -1641,7 +1641,7 @@ class fbattle
}
$this->exp[$v] = round($this->exp[$v]);
$dop_exp = check_proc($this->user['id']);
$dop_exp = 100; //процент опыта
if ($dop_exp > 100) {
$add = ($dop_exp - 100);
$this->exp[$v] += round(($this->exp[$v] * $add) / 100, 0);
-31
View File
@@ -1,31 +0,0 @@
<?php
/**
* Copyright (c) 2018.
* Author: Igor Barkov <lopar.4ever@gmail.com>
* Project name: Battles-Game
*/
class input
{
public static function get($name) {
$var = trim(filter_input(INPUT_GET,$name));
if (isset($var) AND !empty($var))
return $var;
else return null;
}
public static function post($name) {
$var = trim(filter_input(INPUT_POST,$name));
if (isset($var) AND !empty($var))
return $var;
else return null;
}
public static function check($name) {
# Срезаем с значения переменной табы, пробелы, другие невидимые символы по краям.
# Проверяем, что у переменной точно есть значение.
if (!empty(trim(filter_input(INPUT_GET,$name)))) return trim(filter_input(INPUT_GET,$name));
if (!empty(trim(filter_input(INPUT_POST,$name)))) return trim(filter_input(INPUT_POST,$name));
return null;
}
}