Часть логов теперь пишется в 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
+6 -2
View File
@@ -1,4 +1,8 @@
<?php
use Battles\GameLogs;
use Battles\Nick;
$us = mysql_fetch_array(mysql_query("SELECT *, (SELECT `id` FROM `online` WHERE `real_time` >= ".(time()-60)." AND `id` = `users`.`id`) AS `online` FROM `users` WHERE `login` = '".mysql_real_escape_string($_POST['target'])."' LIMIT 1"));
$owntravma = mysql_fetch_array(mysql_query("SELECT `id` FROM `effects` WHERE `owner` = ".$us['id']." AND (`type` = 13 OR `type` = 12 OR `type` = 14) LIMIT 1"));
@@ -85,7 +89,7 @@ if($vip['bloodattack'] <= 0) {
addch("<b>".$los."</b> вмешался в <a href=logs.php?log=".$id." target=_blank>поединок »»</a>.", $user->getRoom());
if($user['invis'] == 1) { $lod = '<i><b>невидимка</b></i>'; } else { $lod = Nick::id($user['id'])->short(); }
addlog($jert['battle'], '<span class=date>'.date("H:i").'</span> '.$lod.' вмешался в поединок!<BR>');
GameLogs::addBattleLog($jert['battle'], '<span class=date>'.date("H:i").'</span> '.$lod.' вмешался в поединок!<BR>');
mysql_query('UPDATE `battle` SET `teams` = \''.serialize($battle).'\', `t'.$ttt.'` = CONCAT(`t'.$ttt.'`,\';'.$user['id'].'\'), `blood` = 1 WHERE `id` = "'.$jert['battle'].'" LIMIT 1');
mysql_query("UPDATE `users` SET `battle` = ".$jert['battle'].", `zayavka` = 0 WHERE `id` = '".$user['id']."' LIMIT 1");
header("Location:fbattle.php");
@@ -123,7 +127,7 @@ if($vip['bloodattack'] <= 0) {
$lds = Nick::id($user['id'])->short();
$rr = "<b>".$ld."</b> и <b>".Nick::id($jert['id'])->full(1)."</b>";
addch("<a href=logs.php?log=".$id." target=_blank>Бой</a> между <b>".$lds."</b> и <b>".Nick::id($jert['id'])->short()."</b> начался.", $user->getRoom());
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>");
mysql_query("UPDATE users SET `battle` ={$id},`zayavka`=0 WHERE `id`= {$user['id']} OR `id` = {$jert['id']}");
header("Location: fbattle.php");
}