Уборка warning и deprecated.

This commit is contained in:
Ivor Barhansky 2023-01-23 12:24:03 +02:00
parent d9ec810f7f
commit b619cd302b
3 changed files with 646 additions and 713 deletions

View File

@ -409,7 +409,7 @@ class Battle
public $aBexp = 0; //Добавочный опыт в боях
public $mainStatus = 1; //Отображаем главное окно (1 - можно бить, 2 - ожидаем ход противника, 3 - Проиграли. Ожидаем завершения поединка)
public $info = []; //Информация о поединке
public $users = []; //Информация о пользователях в этом бою
public $users; //Информация о пользователях в этом бою
public $stats = []; //Информация о статах пользователей в этом бою
public $uids = []; //Список пользователей и их id в stats или users пример id пользователя = 555 , то $uids[555] выдаст его порядковый номер в массиве users \ stats
public $atacks = []; //Список ударов в этом бою (действующих)

File diff suppressed because it is too large Load Diff

View File

@ -1,42 +1,50 @@
<?php
header("Content-type: image/png");
// создаем картинку размером 172X52
$img = imagecreatetruecolor(107, 26) or die('Cannot create image');
$orange = imageColorAllocate($img, 107, 26, 64);
// заполняем фон картинки
imagefill($img, 0, 0, 0x616161);
$x=-20;
$x = -20;
$i = 1;
$sum = "";
//цвет текста
$color_RGB = rand(180,200);
while ($i++ <=5000)
{
imageSetPixel($img, rand(0,105), rand(0,24),0x515151);
$color_RGB = rand(180, 200);
while ($i++ <= 5000) {
imageSetPixel($img, rand(0, 105), rand(0, 24), 0x515151);
}
//рисуем 2 линии
imageLine($img, rand(0,10), rand(0,50), rand(95,105), rand(0,26), 0x909090);
imageLine($img, rand(0,10), rand(0,50), rand(95,105), rand(0,26), 0x909090);
imageLine($img, rand(0, 10), rand(0, 50), rand(95, 105), rand(0, 26), 0x909090);
imageLine($img, rand(0, 10), rand(0, 50), rand(95, 105), rand(0, 26), 0x909090);
//рамка
imageRectangle($img,0,0,105,24,0x343434);
imageRectangle($img, 0, 0, 105, 24, 0x343434);
$fonts = array ('fonts/FRSCRIPT.ttf','fonts/CHILLER.ttf','fonts/Bradley Hand ITC.ttf','fonts/de_Manu_2_Regular.ttf','fonts/Edgar_da_cool_Regular.ttf','fonts/Hurryup_Hurryup.ttf','fonts/Fh_Script_Regular.ttf','fonts/Gabo4_Gabo4.ttf','fonts/JAMI_Regular.ttf','fonts/Justy1_Regular.ttf');
$font = '../'.$fonts[rand(0, sizeof($fonts)-1)];
$fonts = [
'fonts/FRSCRIPT.ttf',
'fonts/CHILLER.ttf',
'fonts/Bradley Hand ITC.ttf',
'fonts/de_Manu_2_Regular.ttf',
'fonts/Edgar_da_cool_Regular.ttf',
'fonts/Hurryup_Hurryup.ttf',
'fonts/Fh_Script_Regular.ttf',
'fonts/Gabo4_Gabo4.ttf',
'fonts/JAMI_Regular.ttf',
'fonts/Justy1_Regular.ttf',
];
$font = '../' . $fonts[rand(0, sizeof($fonts) - 1)];
// выводим одну цифру за один проход цикла (всего 6 цифр)
$i = 1;
while ($i++ <= 4)
{
while ($i++ <= 4) {
// выводим текст поверх картинки
imagettftext($img, 15, 0, $x=$x+25, 20,
imagecolorallocate($img, $color_RGB,$color_RGB,$color_RGB), $font, $rnd = rand(0,9));
imagettftext($img, 15, 0, $x = $x + 25, 20, imagecolorallocate($img, $color_RGB, $color_RGB, $color_RGB), $font, $rnd = mt_rand(0, 9));
// Собираем в одну строку все символы на картинке
$sum = $sum.(string)$rnd;
$sum = $sum . $rnd;
}
//Не забудьте $sum записать в таблицу как STR1
// выводим готовую картинку в формате PNG
@ -45,4 +53,3 @@ imagepng($img);
imagedestroy($img);
// Помещаем защитный код в сессию
$_SESSION['code'] = $sum;
?>