Фиксим мелкие ошибки.
This commit is contained in:
@@ -100,14 +100,9 @@ class BotPriemLogic
|
||||
return true;
|
||||
}
|
||||
|
||||
private static function usePriem($id, $on = null)
|
||||
private static function usePriem($id)
|
||||
{
|
||||
$go_txt = '&usepriem=' . $id;
|
||||
if ($on != '') {
|
||||
$on = str_replace(' ', '%20', $on);
|
||||
$go_txt .= '&useon=' . $on;
|
||||
}
|
||||
BotLogic::inuser_go_btl(BotLogic::$bot, $go_txt);
|
||||
BotLogic::inuser_go_btl(BotLogic::$bot, '&usepriem=' . $id);
|
||||
}
|
||||
|
||||
//Ставка на опережение
|
||||
@@ -328,13 +323,13 @@ class BotPriemLogic
|
||||
}
|
||||
|
||||
|
||||
private static function hp()
|
||||
private static function hp(): float
|
||||
{
|
||||
return round((BotLogic::$st['hpNow'] / BotLogic::$st['hpAll'] * 100), 2);
|
||||
}
|
||||
|
||||
//Тест на возможность использования
|
||||
private static function testpriem($pl)
|
||||
private static function testpriem($pl): int
|
||||
{
|
||||
global $u;
|
||||
$notr = 0;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -7,14 +7,14 @@ class Config
|
||||
private static self $instance;
|
||||
private function __construct()
|
||||
{
|
||||
error_reporting(E_ALL ^ E_NOTICE);
|
||||
// error_reporting(E_ALL ^ E_NOTICE);
|
||||
|
||||
ini_set('display_errors', 'Off');
|
||||
ini_set('date.timezone', 'Europe/Moscow');
|
||||
// ini_set('display_errors', 'Off');
|
||||
// ini_set('date.timezone', 'Europe/Moscow');
|
||||
|
||||
header('Cache-Control: no-cache, no-store, must-revalidate');
|
||||
header('Pragma: no-cache');
|
||||
header('Expires: 0');
|
||||
// header('Cache-Control: no-cache, no-store, must-revalidate');
|
||||
// header('Pragma: no-cache');
|
||||
// header('Expires: 0');
|
||||
}
|
||||
|
||||
public static function get(?string $key = null)
|
||||
|
||||
@@ -2,10 +2,16 @@
|
||||
|
||||
class Dialog
|
||||
{
|
||||
private $info;
|
||||
public $dText = '', $aText = '', $youInfo = '', $botInfo = '', $title = '', $p = 1, $pg = 1;
|
||||
private array $info;
|
||||
public string $dText = '';
|
||||
public string $aText = '';
|
||||
public string $youInfo = '';
|
||||
public string $botInfo = '';
|
||||
public string $title = '';
|
||||
public int $p = 1;
|
||||
public int $pg = 1;
|
||||
|
||||
public function trnObj($x, $j)
|
||||
public function trnObj($x, $j): array
|
||||
{
|
||||
$i = floor($x / $j);
|
||||
return [0 => $i, 1 => $x - ($i * $j)];
|
||||
|
||||
+12
-47
@@ -11,7 +11,7 @@ class Filter
|
||||
}
|
||||
//
|
||||
//Смайлики
|
||||
private $sm = ["laugh" => 1, "fingal" => 1, "eek" => 1, "smoke" => 1, "hi" => 1, "bye" => 1, "king" => 1, "king2" => 1, "boks2" => 1, "boks" => 1, "gent" => 1, "lady" => 1, "tongue" => 1, "smil" => 1, "rotate" => 1, "ponder" => 1, "bow" => 1, "angel" => 1, "angel2" => 1, "hello" => 1, "dont" => 1, "idea" => 1, "mol" => 1, "super" => 1, "beer" => 1, "drink" => 1, "baby" => 1, "tongue2" => 1, "sword" => 1, "agree" => 1, "loveya" => 1, "kiss" => 1, "kiss2" => 1, "kiss3" => 1, "kiss4" => 1, "rose" => 1, "love" => 1, "love2" => 1, "confused" => 1, "yes" => 1, "no" => 1, "shuffle" => 1, "nono" => 1, "maniac" => 1, "privet" => 1, "ok" => 1, "ninja" => 1, "pif" => 1, "smash" => 1, "alien" => 1, "pirate" => 1, "gun" => 1, "trup" => 1, "mdr" => 1, "sneeze" => 1, "mad" => 1, "friday" => 1, "cry" => 1, "grust" => 1, "rupor" => 1, "fie" => 1, "nnn" => 1, "row" => 1, "red" => 1, "lick" => 1, "help" => 1, "wink" => 1, "jeer" => 1, "tease" => 1, "nunu" => 1, "inv" => 1, "duel" => 1, "susel" => 1, "nun" => 1, "kruger" => 1, "flowers" => 1, "horse" => 1, "hug" => 1, "str" => 1, "alch" => 1, "pal" => 1, "mag" => 1, "sniper" => 1, "vamp" => 1, "doc" => 1, "doc2" => 1, "sharp" => 1, "naem" => 1, "naem2" => 1, "naem3" => 1, "invis" => 1, "chtoza" => 1, "beggar" => 1, "sorry" => 1, "sorry2" => 1, "creator" => 1, "grace" => 1, "dustman" => 1, "carreat" => 1, "lordhaos" => 1, "ura" => 1, "elix" => 1, "dedmoroz" => 1, "snegur" => 1, "showng" => 1, "superng" => 1, "podz" => 1, "sten" => 1, "devil" => 1, "cat" => 1, "owl" => 1, "lightfly" => 1, "snowfight" => 1, "rocket" => 1, "ball" => 1, "smile" => 1, "fuck" => 1];
|
||||
private array $sm = ["laugh" => 1, "fingal" => 1, "eek" => 1, "smoke" => 1, "hi" => 1, "bye" => 1, "king" => 1, "king2" => 1, "boks2" => 1, "boks" => 1, "gent" => 1, "lady" => 1, "tongue" => 1, "smil" => 1, "rotate" => 1, "ponder" => 1, "bow" => 1, "angel" => 1, "angel2" => 1, "hello" => 1, "dont" => 1, "idea" => 1, "mol" => 1, "super" => 1, "beer" => 1, "drink" => 1, "baby" => 1, "tongue2" => 1, "sword" => 1, "agree" => 1, "loveya" => 1, "kiss" => 1, "kiss2" => 1, "kiss3" => 1, "kiss4" => 1, "rose" => 1, "love" => 1, "love2" => 1, "confused" => 1, "yes" => 1, "no" => 1, "shuffle" => 1, "nono" => 1, "maniac" => 1, "privet" => 1, "ok" => 1, "ninja" => 1, "pif" => 1, "smash" => 1, "alien" => 1, "pirate" => 1, "gun" => 1, "trup" => 1, "mdr" => 1, "sneeze" => 1, "mad" => 1, "friday" => 1, "cry" => 1, "grust" => 1, "rupor" => 1, "fie" => 1, "nnn" => 1, "row" => 1, "red" => 1, "lick" => 1, "help" => 1, "wink" => 1, "jeer" => 1, "tease" => 1, "nunu" => 1, "inv" => 1, "duel" => 1, "susel" => 1, "nun" => 1, "kruger" => 1, "flowers" => 1, "horse" => 1, "hug" => 1, "str" => 1, "alch" => 1, "pal" => 1, "mag" => 1, "sniper" => 1, "vamp" => 1, "doc" => 1, "doc2" => 1, "sharp" => 1, "naem" => 1, "naem2" => 1, "naem3" => 1, "invis" => 1, "chtoza" => 1, "beggar" => 1, "sorry" => 1, "sorry2" => 1, "creator" => 1, "grace" => 1, "dustman" => 1, "carreat" => 1, "lordhaos" => 1, "ura" => 1, "elix" => 1, "dedmoroz" => 1, "snegur" => 1, "showng" => 1, "superng" => 1, "podz" => 1, "sten" => 1, "devil" => 1, "cat" => 1, "owl" => 1, "lightfly" => 1, "snowfight" => 1, "rocket" => 1, "ball" => 1, "smile" => 1, "fuck" => 1];
|
||||
|
||||
public function e($t)
|
||||
{
|
||||
@@ -48,7 +48,7 @@ class Filter
|
||||
}
|
||||
}
|
||||
|
||||
public function mystr($string)
|
||||
public function mystr($string): string
|
||||
{
|
||||
$str = strtolower($string);
|
||||
if (strtolower('S') != 's') {
|
||||
@@ -90,57 +90,22 @@ class Filter
|
||||
/* фильтр */
|
||||
$spam = mysql_fetch_array(mysql_query('SELECT * FROM `spam_word` WHERE `id` = 1 LIMIT 1'));
|
||||
$spam = $spam['data'];
|
||||
//
|
||||
$testEN = preg_replace('/[^A-z]*/i', '', $txt);
|
||||
$testEN2 = $txt;
|
||||
|
||||
$testEN2 = str_replace('"', '', $testEN2);
|
||||
$testEN2 = str_replace(' ', '', $testEN2);
|
||||
$testEN2 = str_replace('а', 'a', $testEN2);
|
||||
$testEN2 = str_replace('б', 'b', $testEN2);
|
||||
$testEN2 = str_replace('с', 'c', $testEN2);
|
||||
$testEN2 = str_replace('в', 'b', $testEN2);
|
||||
$testEN2 = str_replace('е', 'e', $testEN2);
|
||||
$testEN2 = str_replace('т', 't', $testEN2);
|
||||
$testEN2 = str_replace('о', 'o', $testEN2);
|
||||
$testEN2 = str_replace('р', 'p', $testEN2);
|
||||
$testEN2 = str_replace('м', 'm', $testEN2);
|
||||
$testEN2 = str_replace('н', 'h', $testEN2);
|
||||
$testEN2 = str_replace('у', 'y', $testEN2);
|
||||
$testEN2 = str_replace('к', 'k', $testEN2);
|
||||
$testEN2 = str_replace('и', 'u', $testEN2);
|
||||
$testEN2 = str_replace('х', 'x', $testEN2);
|
||||
$testEN2 = str_replace('я', '9', $testEN2);
|
||||
$testEN2 = str_replace('()', 'o', $testEN2);
|
||||
$testEN2 = str_replace('0', 'o', $testEN2);
|
||||
$testEN2 = preg_replace('/[^A-z]*/i', '', $testEN2);
|
||||
$testEN = preg_replace('/[^A-z]*/i', '', $txt);
|
||||
$testRU = preg_replace('/[^А-я]*/i', '', $txt);
|
||||
|
||||
$testRU2 = $txt;
|
||||
$testRU2 = str_replace('a', 'а', $testRU2);
|
||||
$testRU2 = str_replace('b', 'б', $testRU2);
|
||||
$testRU2 = str_replace('c', 'с', $testRU2);
|
||||
$testRU2 = str_replace('b', 'в', $testRU2);
|
||||
$testRU2 = str_replace('e', 'е', $testRU2);
|
||||
$testRU2 = str_replace('t', 'т', $testRU2);
|
||||
$testRU2 = str_replace('o', 'о', $testRU2);
|
||||
$testRU2 = str_replace('p', 'р', $testRU2);
|
||||
$testRU2 = str_replace('m', 'м', $testRU2);
|
||||
$testRU2 = str_replace('h', 'н', $testRU2);
|
||||
$testRU2 = str_replace('y', 'у', $testRU2);
|
||||
$testRU2 = str_replace('k', 'к', $testRU2);
|
||||
$testRU2 = str_replace('x', 'х', $testRU2);
|
||||
$testRU2 = str_replace('u', 'и', $testRU2);
|
||||
$testRU2 = str_replace('()', 'о', $testRU2);
|
||||
$testRU2 = str_replace('0', 'о', $testRU2);
|
||||
$testRU2 = preg_replace('/[^А-я]*/i', ' ', $testRU2);
|
||||
$testRU2 = preg_replace('/[^А-Я]*/i', ' ', $testRU2);
|
||||
$i = 0;
|
||||
$spe = explode('|', $spam);
|
||||
while ($i <= count($spe)) {
|
||||
if (isset($spe[$i]) && $spe[$i] != '' && $spe[$i] != 'new-combats.com' && (stristr(
|
||||
$testEN, $spe[$i]
|
||||
) || stristr($testRU, $spe[$i]))) {
|
||||
if (
|
||||
isset($spe[$i]) &&
|
||||
$spe[$i] != '' &&
|
||||
$spe[$i] != 'new-combats.tech' &&
|
||||
(
|
||||
stristr($testEN, $spe[$i]) ||
|
||||
stristr($testRU, $spe[$i])
|
||||
)
|
||||
) {
|
||||
$nospam .= '%' . $spe[$i];
|
||||
}
|
||||
$i++;
|
||||
|
||||
@@ -9,15 +9,15 @@
|
||||
|
||||
class Uploader
|
||||
{
|
||||
private $width = ['min' => 0, 'max' => 0];
|
||||
private $height = ['min' => 0, 'max' => 0];
|
||||
private $maxFileSizeMb;
|
||||
private $savePath;
|
||||
private $extensions = 'jpg|png|jpeg|gif';
|
||||
private $extMatches = [];
|
||||
private $FILE;
|
||||
private array $width = ['min' => 0, 'max' => 0];
|
||||
private array $height = ['min' => 0, 'max' => 0];
|
||||
private int $maxFileSizeMb;
|
||||
private string $savePath;
|
||||
private string $extensions = 'jpg|png|jpeg|gif';
|
||||
private array $extMatches = [];
|
||||
private array $FILE;
|
||||
private $cnm;
|
||||
public static $error;
|
||||
public static string $error;
|
||||
|
||||
public function __construct($name, $cnm = null)
|
||||
{
|
||||
@@ -29,22 +29,22 @@ class Uploader
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $max
|
||||
* @param int $min
|
||||
* @param int $max
|
||||
* @param int|null $min
|
||||
* @return void
|
||||
*/
|
||||
public function setWidth($max, $min = null)
|
||||
public function setWidth(int $max, ?int $min = null)
|
||||
{
|
||||
$this->width['min'] = is_null($min) ? $max : $min;
|
||||
$this->width['max'] = $max;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $max
|
||||
* @param int $min
|
||||
* @param int $max
|
||||
* @param int|null $min
|
||||
* @return void
|
||||
*/
|
||||
public function setHeight($max, $min = null)
|
||||
public function setHeight(int $max, ?int $min = null)
|
||||
{
|
||||
$this->height['min'] = is_null($min) ? $max : $min;
|
||||
$this->height['max'] = $max;
|
||||
@@ -63,7 +63,7 @@ class Uploader
|
||||
* @param string $path путь от корня до конечной папки без открывающего слеша.
|
||||
* @return void
|
||||
*/
|
||||
public function setSavePath($path)
|
||||
public function setSavePath(string $path)
|
||||
{
|
||||
$this->savePath = $_SERVER['DOCUMENT_ROOT'] . '/' . $path;
|
||||
}
|
||||
@@ -90,15 +90,15 @@ class Uploader
|
||||
* @param int $height
|
||||
* @return void
|
||||
*/
|
||||
public function setDimensions($width, $height)
|
||||
public function setDimensions(int $width, int $height)
|
||||
{
|
||||
$this->setWidth($width);
|
||||
$this->setHeight($height);
|
||||
}
|
||||
|
||||
private function hasNormalDimensions()
|
||||
private function hasNormalDimensions(): bool
|
||||
{
|
||||
list($width, $height) = getimagesize($this->FILE['tmp_name']);
|
||||
[$width, $height] = getimagesize($this->FILE['tmp_name']);
|
||||
if (!$width || !$height) {
|
||||
self::$error = 'Не подтянулись размеры файла.';
|
||||
return false;
|
||||
@@ -118,7 +118,7 @@ class Uploader
|
||||
return true;
|
||||
}
|
||||
|
||||
private function hasNormalFileSize()
|
||||
private function hasNormalFileSize(): bool
|
||||
{
|
||||
if (!$this->maxFileSizeMb) {
|
||||
$this->setMaxFileSize(2);
|
||||
@@ -130,7 +130,7 @@ class Uploader
|
||||
return true;
|
||||
}
|
||||
|
||||
private function hasNormalType()
|
||||
private function hasNormalType(): bool
|
||||
{
|
||||
if (
|
||||
!preg_match('/\.(' . $this->extensions . ')$/i', $this->FILE['name'], $this->extMatches) ||
|
||||
@@ -142,7 +142,7 @@ class Uploader
|
||||
return true;
|
||||
}
|
||||
|
||||
private function hasNormalFilePath()
|
||||
private function hasNormalFilePath(): bool
|
||||
{
|
||||
if (!$this->savePath || !is_dir($this->savePath)) {
|
||||
self::$error = 'Ошибка загрузки: нет такой папки.';
|
||||
@@ -167,7 +167,7 @@ class Uploader
|
||||
return [$fn2, $fn, $this->savePath . $fn];
|
||||
}
|
||||
|
||||
function saveimg()
|
||||
public function saveimg()
|
||||
{
|
||||
return $this->hasNormalFilePath() &&
|
||||
$this->hasNormalDimensions() &&
|
||||
|
||||
@@ -4,7 +4,7 @@ if (!defined('GAME')) {
|
||||
}
|
||||
|
||||
$db = [
|
||||
's' => 'localhost', // server
|
||||
's' => 'db', // server
|
||||
'd' => 'game_production', // database
|
||||
'u' => 'prod1', // user
|
||||
'p' => 'Bz@fGaZjFU2206Ua' // password
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
date.timezone=Europe/Moscow
|
||||
|
||||
allow_url_fopen = On
|
||||
session.auto_start=On
|
||||
allow_url_include = On
|
||||
|
||||
display_errors = Off
|
||||
display_startup_errors = Off
|
||||
log_errors = Off
|
||||
error_log = /home/newcom1/error_log
|
||||
Reference in New Issue
Block a user