Часть логов теперь пишется в SQLITE, а не в текстовые файлы (#33). Проинициализирован класс Nick в свитках.

This commit is contained in:
Igor Barkov (iwork)
2021-08-26 17:44:14 +03:00
parent 6fa217b93b
commit 5e264f837a
65 changed files with 438 additions and 233 deletions
+4 -2
View File
@@ -1,6 +1,8 @@
<?php
use Battles\DressedItems;
use Battles\GameLogs;
use Battles\Nick;
use Battles\Template;
require_once "functions.php";
@@ -214,7 +216,7 @@ if (isset($objs[$user['x']][$user['y']]['id'])) {
exit('Error #1' . $who);
}
mysql_query("UPDATE `users` SET `battle` = {$id}, `zayavka` = 0 WHERE `id`= {$user['id']} LIMIT 1");
addlog($id, "Часы показывали <span class=date>" . date("Y.m.d H.i") . "</span>, когда " . $rr . " бросили вызов друг другу.<BR>");
GameLogs::addBattleLog($id, "Часы показывали <span class=date>" . date("Y.m.d H.i") . "</span>, когда " . $rr . " бросили вызов друг другу.<BR>");
} else {
$bd = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = "' . $btl_pix['battle'] . '" LIMIT 1'));
$botd = mysql_fetch_array(mysql_query('SELECT * FROM `bots` WHERE `battle` = "' . $bd['id'] . '" LIMIT 1'));
@@ -227,7 +229,7 @@ if (isset($objs[$user['x']][$user['y']]['id'])) {
}
$t1 = explode(";", $bd['t1']);
$ttt = 1;
addlog($jert['battle'], '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' вмешался в поединок!<BR>');
GameLogs::addBattleLog($jert['battle'], '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' вмешался в поединок!<BR>');
mysql_query('UPDATE `battle` SET `teams` = \'' . serialize($battle) . '\', `t' . $ttt . '` = CONCAT(`t' . $ttt . '`,\';' . $user['id'] . '\') WHERE `id` = "' . $btl_pix['battle'] . '" LIMIT 1');
mysql_query("UPDATE `users` SET `battle` = '" . $bd['id'] . "', `zayavka` = 0 WHERE `id` = '" . $user['id'] . "' LIMIT 1");
header("Location: fbattle.php");