Часть логов теперь пишется в 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

View File

@ -1,4 +1,8 @@
<?php
use Battles\GameLogs;
use Battles\Template;
require_once "functions.php";
$start = db::c()->query('SELECT `value` FROM `variables` WHERE `var` = "arena_of_gods"')->fetch_assoc();
@ -22,7 +26,7 @@ function join_arena($u, $btl, $team, $at)
} else {
$adtxt = 'За сторону <b>Света</b>.';
}
addlog($btl, '<span class=date>' . date("H:i") . '</span> ' . Nick::id($u)->short() . ' вмешался в поединок! ' . $adtxt . '<br />');
GameLogs::addBattleLog($btl, '<span class=date>' . date("H:i") . '</span> ' . Nick::id($u)->short() . ' вмешался в поединок! ' . $adtxt . '<br />');
mysql_query('UPDATE `battle` SET `teams` = \'' . serialize($battle) . '\', `t' . $team . '` = CONCAT(`t' . $team . '`,\';' . $u . '\') WHERE `id` = "' . $btl . '" LIMIT 1');
mysql_query("UPDATE users SET `battle` = '" . $btl . "', `zayavka` = 0 WHERE `id` = '" . $u . "' LIMIT 1");
header("Location: fbattle.php");
@ -120,7 +124,7 @@ if (isset($_GET['append'])) {
}
}
}
\Battles\Template::header('Арена Ангелов');
Template::header('Арена Ангелов');
?>
<link href="css/fight.css" rel="stylesheet"/>
<style>

View File

@ -1,4 +1,8 @@
<?php
use Battles\Chat;
use Battles\Template;
require_once "functions.php";
$in_haos = mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_status` WHERE `id` = '{$user['id']}';"));
$owntravma = mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `owner` = " . $user['id'] . " AND (type=13 OR type=12 OR type=14) limit 1;"));
@ -63,7 +67,7 @@ if ($_POST['pay']) {
if ($_POST['adm_start_raid'] && $user['id'] == 1256) {
mysql_query("DELETE FROM `cit_haos_status`;");
mysql_query("DELETE FROM `cit_haos_var`;");
AddChatSystem('<font color=red>Начинается прием заявок в рейд на Цитадель Хаоса! Начало рейда через 15 минут.</font>');
Chat::addSYSMessage('Начинается прием заявок в рейд на Цитадель Хаоса! Начало рейда через 15 минут.');
$ch_time = time();
mysql_query("UPDATE variables SET value='{$ch_time}' where var='cit_haos_time';");
}
@ -89,7 +93,7 @@ if ($in_haos['status'] == 2) {
}
}
$in_haos = mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_status` WHERE `id` = '{$user['id']}' LIMIT 1;"));
\Battles\Template::header('Цитадель Хаоса');
Template::header('Цитадель Хаоса');
?>
<!-- JS -->
<script>

View File

@ -1,5 +1,7 @@
<?php
use Battles\DressedItems;
use Battles\GameLogs;
use Battles\Template;
require_once 'functions.php';
@ -128,9 +130,9 @@ function battlewithbot($b, $name = '', $time = 3, $blood = 1, $group = 1, $battl
}
if ($user1['invis'] == 1) {
addlog($battleid, '<span class=date>' . date("H:i") . '</span> <b>невидимка</b> вмешался в поединок!<BR>');
GameLogs::addBattleLog($battleid, '<span class=date>' . date("H:i") . '</span> <b>невидимка</b> вмешался в поединок!<BR>');
} else {
addlog($battleid, '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' вмешался в поединок!<BR>');
GameLogs::addBattleLog($battleid, '<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 . '`,\';' . $user1['id'] . '\') WHERE `id` = ' . $battleid . ' LIMIT 1');
@ -185,7 +187,7 @@ function battlewithbot($b, $name = '', $time = 3, $blood = 1, $group = 1, $battl
} else {
$rr = "<b>" . Nick::id($user1['id'])->full(1) . "</b> и <b>" . Nick::id($botid1)->full(1) . "</b>";
}
addlog($battleid, "Часы показывали <span class=date>" . date("Y.m.d H.i") . "</span>, когда " . $rr . " бросили вызов друг другу. <BR>" . ($others ? "$others<BR>" : ""));
GameLogs::addBattleLog($battleid, "Часы показывали <span class=date>" . date("Y.m.d H.i") . "</span>, когда " . $rr . " бросили вызов друг другу. <BR>" . ($others ? "$others<BR>" : ""));
if (!$noredir) {
header("Location: fbattle.php");
}
@ -486,7 +488,7 @@ if (@$_GET['kill'] && $user['id'] == $user['caveleader'] && $_GET['kill'] != $us
while ($rec = mysql_fetch_assoc($r)) {
$slot = getslot($rec['id'], $usr);
if ($slot) {
$item = new \Battles\DressedItems($v['user']);
$item = new DressedItems($v['user']);
$item->undressItem($slot);
}
}
@ -898,7 +900,7 @@ if (@$_GET['exit']) {
while ($rec = mysql_fetch_assoc($r)) {
$slot = getslot($rec['id']);
if ($slot) {
$item = new \Battles\DressedItems($user['id']);
$item = new DressedItems($user['id']);
$item->undressItem($slot);
}
}

View File

@ -1,4 +1,9 @@
<?php
use Battles\Chat;
use Battles\GameLogs;
use Battles\Template;
require_once "functions.php";
$owntravma = mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `owner` = " . $user['id'] . " AND (type=13 OR type=12 OR type=14) limit 1;"));
$klan = mysql_fetch_array(mysql_query("SELECT * FROM `clans` WHERE `id` = '{$user['klan']}' LIMIT 1;"));
@ -20,7 +25,7 @@ if ($_POST['add_zay']) {
mysql_query("INSERT INTO `clan_castle` VALUES ('{$user['id']}','{$user['klan']}');");
exit("<script>location.href='clan_castle.php';</script>");
}
\Battles\Template::header('Замок Мэра');
Template::header('Замок Мэра');
?>
<script>
function refreshPeriodic() {
@ -154,7 +159,7 @@ if ($_POST['add_zay']) {
$cc_att = mysql_fetch_array(mysql_query("SELECT `value` FROM variables WHERE var='castle_att' LIMIT 1;"));
$cc_a = mysql_fetch_array(mysql_query("SELECT `name` FROM `clans` WHERE `id` = '{$cc_att['value']}' LIMIT 1;"));
AddChatSystem('<font color=red><strong>Клан <img title="' . $cc_a['name'] . '" src="i/clan/' . $cc_a['name'] . '.png">' . $cc_a['name'] . '</strong> без боя забрал у <strong>клана <img title="' . $cc_k['name'] . '" src="i/clan/' . $cc_k['name'] . '.gif">' . $cc_k['name'] . '</strong> Замок Мэра</font>');
Chat::addSYSMessage('Клан <img title="' . $cc_a['name'] . '" src="i/clan/' . $cc_a['name'] . '.png">' . $cc_a['name'] . ' без боя забрал у <strong>клана <img title="' . $cc_k['name'] . '" src="i/clan/' . $cc_k['name'] . '.gif">' . $cc_k['name'] . '</strong> Замок Мэра');
$c_prev = mysql_fetch_array(mysql_query("SELECT `glava`,`align` FROM `clans` WHERE `id`='{$own['value']}' LIMIT 1;"));
@ -231,7 +236,7 @@ if ($_POST['add_zay']) {
addch("<a href=logs.php?log=" . $id . " target=_blank>Поединок</a> между <B>" . $rrc . "</B> начался. ", $user->getRoom());
mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}','Часы показывали <span class=date>" . date("Y.m.d H.i") . "</span>, когда " . $rr . " бросили вызов друг другу. <BR>');");
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>");
$add_time = time();
// всех в БОЙ!!!
foreach ($at_t as $k => $v) {
@ -289,7 +294,7 @@ if ($_POST['add_zay']) {
addch("<a href=logs.php?log=" . $id . " target=_blank>Поединок</a> между <B>" . $rrc . "</B> начался. ", $user->getRoom());
mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}','Часы показывали <span class=date>" . date("Y.m.d H.i") . "</span>, когда " . $rr . " бросили вызов друг другу. <BR>');");
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>");
$add_time = time();
// всех в БОЙ!!!
foreach ($at_t as $k => $v) {

View File

@ -43,10 +43,12 @@ class Chat
echo 'Chat Datetime Whoops!';
}
$m = htmlspecialchars($row->msg);
if ($row->type === 'sys') {
if ($row->type === 'sys' && empty($row->rid)) {
$wrappedMessage .= sprintf('<span class="chatsys">%s %s</span><br>', $this->d->format('H:i'), $m);
} elseif ($row->rid == User::$current->getId()) {
if ($row->type == 'sms') {
} elseif ($row->rid === User::$current->getId()) {
if ($row->type === 'sys') {
$wrappedMessage .= sprintf('<span class="chatsys">%s [Система] → %s</span><br>', $this->d->format('H:i'), $m);
} elseif ($row->type == 'sms') {
$wrappedMessage .= sprintf('<span class="chatsms">%s Телеграмма от [%s]: %s</span><br>', $this->d->format('d.m.Y H:i'), $row->sender, $m);
} elseif ($row->type == 'private') {
$wrappedMessage .= sprintf('<span class="chatprivate">%s [%s] → [%s]: %s</span><br>', $this->d->format('H:i'), $row->sender, $row->receiver, $m);
@ -60,9 +62,14 @@ class Chat
return $wrappedMessage;
}
public function addMessage($msg)
public function addMessage(string $msg)
{
$this->db->execute('insert into chat (user_id, msg) values (?,?)', [User::$current->getId(), $msg]);
}
public static function addSYSMessage( string $msg, ?int $receiver_id = null)
{
DBPDO::$db->execute('insert into chat (user_id, msg, receiver_id, type) values (?,?,?,?)', [User::$current->getId(), $msg, $receiver_id, 'sys']);
}
}

View File

@ -57,7 +57,7 @@ class GameLogs
public static function getUserLogs($userId = null, $type = null): SQLite3Result
{
$db = new SQLite3(GameConfigs::DB_SQLITE);
$row = false;
if ($userId && $type) {
$query = "SELECT * FROM users_logs WHERE user_id = ? AND type = ?";
$row = $db->prepare($query);
@ -78,4 +78,14 @@ class GameLogs
return $row->execute();
}
public static function addBattleLog(int $battle_id, string $text)
{
$db = new SQLite3(__DIR__ . '../../Database/battle.logs.db');
$row = $db->prepare('insert into newbattles (battle_id, text) values (?,?)');
$row->bindParam(1, $battle_id, SQLITE3_INTEGER);
$row->bindParam(2, $text, SQLITE3_TEXT);
$row->execute();
$row->close();
}
}

View File

@ -100,11 +100,6 @@ class User
$this->pass = $pass;
}
public function savePass()
{
self::$db->execute('UPDATE users SET pass = ? WHERE id = ?', [$this->pass, $this->id]);
}
public function getRealname(): string
{
return $this->realname;
@ -151,13 +146,8 @@ class User
*/
public function setClan(?string $short_name)
{
if (is_null($short_name)) {
$this->clan = null;
self::$db->execute('update users set clan = null where id = ?', $this->id);
} else {
$this->clan = $short_name;
self::$db->execute('update users set clan = ? where id = ?', [$short_name, $this->id]);
}
$this->clan = is_null($short_name) ? null : $short_name;
$this->saveUser();
}
public function getMoney(): int
@ -217,11 +207,6 @@ class User
}
}
public function saveShadow()
{
self::$db->execute('UPDATE users SET shadow = ? WHERE id = ?', [$this->shadow, $this->id]);
}
public function getExperience(): int
{
return $this->experience;
@ -242,11 +227,6 @@ class User
return $this->zayavka;
}
public function saveAnketa()
{
self::$db->execute('UPDATE users SET realname = ?, info = ? WHERE id = ?', [$this->realname, $this->info, $this->id]);
}
public function setOnline()
{
self::$db->execute('update online set real_time = ? where user_id = ?', [time(), $this->getId()]);
@ -285,4 +265,26 @@ class User
return true;
}
/** Сохраняет в базу актуальные логин, пароль, email, имя, дату рождения, текст инфы, склонность, клан, образ, права админа.
*
*/
public function saveUser()
{
$query = 'update users set login = ?, pass = ?, email = ?, realname = ?, borndate = ?, info = ?, align = ?, clan = ?, shadow = ?, admin = ? where id = ?';
$vals = [
$this->login, //set
$this->pass,
$this->email,
$this->realname,
$this->borndate,
$this->info,
$this->align,
$this->clan,
$this->shadow,
$this->admin,
$this->id //where
];
DBPDO::$db->execute($query, $vals);
}
}

View File

@ -3,6 +3,7 @@
namespace Battles;
use Battles\Database\DBPDO;
use Exceptions\GameException;
class UserStats extends User
@ -22,16 +23,16 @@ class UserStats extends User
//// Неизменяемые для игрока(!) переменные.
// Удар кулаком всегда 1-2.
protected $minDamage = 1;
protected $maxDamage = 2;
protected int $minDamage = 1;
protected int $maxDamage = 2;
// Природная броня всегда 0.
// Зачем их три, если во всех формулах она одна?
protected $headArmor = 0;
protected $chestArmor = 0;
protected $legArmor = 0;
protected int $headArmor = 0;
protected int $chestArmor = 0;
protected int $legArmor = 0;
// Динамически рассчитываемые
protected $maxHealth;
protected $maxMana;
protected int $maxHealth;
protected int $maxMana;
/**
* UserStats constructor.
@ -48,7 +49,7 @@ class UserStats extends User
/**
* Отдаёт информацию о базовом(!) стате.
*
* @param $stat_name - имя стата. Может принимать значения 'strength', 'dexterity', 'intuition',
* @param $stat_name - имя стата. Может принимать значения 'strength', 'dexterity', 'intuition',
* 'endurance', 'intelligence', 'wisdom'.
* @param int $isMainWindow - переключатель "главного окна". Если включить, дополнительно будет показывать ссылку
* на повышение стата на 1, при условии наличия свободных очков статов.
@ -220,4 +221,36 @@ class UserStats extends User
return self::$db->ofetch($query);
}
public function levelUp(): string
{
$this->level += 1;
$this->free_stat_points += 2;
$this->saveStats();
Chat::addSYSMessage('Внимание, вы получили ' . $this->level . 'уровень. Доступны очки распределения параметров.');
return 'Персонаж перешёл на ' . $this->level . 'уровень.';
}
/** Сохраняет в базу актуальные статы, здоровье, ману, свободные очки статов и уровень.
*
*/
private function saveStats()
{
$query = 'update users set strength = ?, dexterity = ?, intuition = ?, endurance = ?,
intelligence = ?, wisdom = ?, health = ?, mana = ?, free_stat_points = ?,
level = ? where id = ?';
$vals = [
$this->strength, //set
$this->dexterity,
$this->intuition,
$this->endurance,
$this->intelligence,
$this->wisdom,
$this->health,
$this->mana,
$this->free_stat_points,
$this->level,
$this->id //where
];
DBPDO::$db->execute($query, $vals);
}
}

View File

@ -1,5 +1,8 @@
<?php
use Battles\GameLogs;
use Battles\Nick;
class Tournament
{
public $MaxUserLevel = 9;
@ -159,7 +162,7 @@ class Tournament
// создаем лог
$rr = "<b>" . Nick::id($user['id'])->full(1) . "</b> и <b>" . Nick::id($jert['id'])->full(1) . "</b>";
addch("<a href=logs.php?log=" . $id . " target=_blank>Бой</a> между <B><b>" . Nick::id($user['id'])->short() . "</b> и <b>" . Nick::id($jert['id'])->short() . "</b> начался. ", $user->getRoom());
addlog($id, "Часы показывали <span class=date>" . date("Y.m.d H.i") . "</span>, когда " . $rr . " решили выяснить кто из них сильнее. <i>(турнир)</i><BR>");
GameLogs::addBattleLog($id, "Часы показывали <span class=date>" . date("Y.m.d H.i") . "</span>, когда " . $rr . " решили выяснить кто из них сильнее. <i>(турнир)</i><BR>");
return $id;
}
}

View File

@ -5,6 +5,9 @@
* Project name: Battles-Game
*/
use Battles\GameLogs;
use Battles\Nick;
include_once '../config.php';
include_once '../functions.php';
$tm = time();
@ -206,7 +209,7 @@ function startbattle($id, $zay, $r)
}
$rr .= "</b>";
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>");
foreach ($z['team1'] as $k => $v) {
if ($v < _BOTSEPARATOR_) {
@ -287,7 +290,7 @@ if ($st_ar['value'] <= time()) {
$id = mysql_insert_id();
mysql_query("UPDATE `bots` SET `battle` = {$id} WHERE (`id` = {$dark['id_at']} OR `id` = {$light['id_at']}) LIMIT 2");
$rr = "<b>" . Nick::id($dark['id_at'])->full(1) . "</b> и <b>" . Nick::id($light['id_at'])->full(1) . "</b>";
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` = {$dark['id']} OR `id` = {$light['id']}) LIMIT 2");
file_get_contents(GAMEDOMAIN . '/chats.php?id=2');
mysql_query('UPDATE `variables` SET `value` = "' . (time() + 60 * 60 * 24 * 7) . '" WHERE `var` = "arena_of_gods" LIMIT 1');

View File

@ -5,6 +5,10 @@
* Project name: Battles-Game
*/
use Battles\Chat;
use Battles\DressedItems;
use Battles\GameLogs;
include_once '../config.php';
include_once '../functions.php';
//include_once '../cave/cave_bots.php';
@ -486,7 +490,7 @@ class fbattle
$inv_broken = mysql_query("SELECT * FROM `inventory` WHERE `type` != 12 AND `dressed` = 1 AND ((`maxdur` <= `duration`) OR (`dategoden` > 0 AND `dategoden` <= '" . time() . "')) AND `owner` = '{$v}'");
while ($br = mysql_fetch_array($inv_broken)) {
$item = new \Battles\DressedItems($v);
$item = new DressedItems($v);
$item->undressItem($br['type']);
}
@ -548,10 +552,10 @@ class fbattle
}
if ($arr_battle['win'] == 1) {
AddChatSystem("<font color=red>Внимание! Тьма одержала победу благодаря великим воинам : <b>$uss</b></font>");
Chat::addSYSMessage('Внимание! Тьма одержала победу благодаря великим воинам: <b>' . $uss . '</b>');
$this->AddToLog('<span class=date>' . date("H:i") . '</span> ' . 'Бой закончен, победа за <B>Силами Тьмы</B><BR>');
} else {
AddChatSystem("<font color=red>Внимание! Свет одержал победу благодаря великим воинам : <b>$uss</b></font>");
Chat::addSYSMessage('Внимание! Свет одержал победу благодаря великим воинам: <b>' . $uss . '</b>');
$this->AddToLog('<span class=date>' . date("H:i") . '</span> ' . 'Бой закончен, победа за <B>Силами Света</B><BR>');
}
mysql_query('UPDATE `variables` SET `value` = "' . $arr_battle['win'] . '" WHERE `var` = "arena_win" LIMIT 1');
@ -574,7 +578,7 @@ class fbattle
$this->AddToLog('<span class=date>' . date("H:i") . '</span> <b>' . Nick::id($v)->short() . '</b> получил повреждение: <font color=red>' . $tr . '</font><BR>');
$inv_broken = mysql_query("SELECT `id`, `type`, `dressed`, `duration`, `maxdur`, `dategoden`, `owner` FROM `inventory` WHERE `type` != 12 AND `dressed` = 1 AND ((`maxdur` <= `duration`) OR (`dategoden` > 0 AND `dategoden` <= '" . time() . "')) AND `owner` = '{$v}'");
while ($br = mysql_fetch_array($inv_broken)) {
$item = new \Battles\DressedItems($v);
$item = new DressedItems($v);
$item->undressItem($br['type']);
}
}
@ -582,7 +586,7 @@ class fbattle
}
} else {
if ($this->battle_data['aren_of'] == 1) {
AddChatSystem("<font color=red>Внимание! Бой на Арене Ангелов завершился ничьей, на этой недели силы тьмы и света равны.</font>");
Chat::addSYSMessage('Внимание! Бой на Арене Ангелов завершился ничьей, на этой недели силы тьмы и света равны.');
mysql_query('UPDATE `variables` SET `value` = 3 WHERE `var` = "arena_win" LIMIT 1');
mysql_query('UPDATE `battle` SET `aren_of` = 0 WHERE `id` = "' . $arr_battle['id'] . '" AND `aren_of` = 1 LIMIT 1');
}
@ -1881,21 +1885,9 @@ class fbattle
if ($this->log) {
$this->log = $this->log . "<hr>";
}
$this->addlogs($this->battle_data['id'], $this->log);
GameLogs::addBattleLog($this->battle_data['id'], $this->log);
$this->log = '';
}
private function addlogs($id, $log)
{
$fp = fopen("backup/logs/battle" . $id . ".txt", "a");
flock($fp, LOCK_EX);
fputs($fp, $log);
fflush($fp);
flock($fp, LOCK_UN);
fclose($fp);
unset($id, $log);
}
}
$r = mysql_query("SELECT `id`, `win` FROM `battle` WHERE `win` = 3");

View File

@ -1,5 +1,7 @@
<?php
use Battles\GameLogs;
use Battles\Nick;
use Battles\Template;
require_once "functions.php";
@ -57,7 +59,7 @@ if ($rand < 15 && $user['battle'] == 0) {
$id = mysql_insert_id();
mysql_query("UPDATE `bots` SET `battle` = {$id} WHERE `id` = {$bot} LIMIT 1");
$rr = "<b>" . Nick::id($user['id'])->full(1) . "</b> и <b>" . Nick::id($bot)->full(1) . "</b>";
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'] . "' LIMIT 1");
addchp('<b style="color:#990000">Внимание!</b> На вас напал "' . $bots[$rbot] . '". ', '{[]}' . Nick::id($user["id"])->short() . '{[]}');
}

View File

@ -10,6 +10,7 @@ use Battles\DressedItems;
use Battles\InventoryItem;
use Battles\Travel;
use Battles\User;
use Battles\UserInfo;
require_once 'config.php';
if (empty($_SESSION['uid'])) {
@ -204,39 +205,7 @@ function takeshopitem($item, $table = "shop", $present = '', $onlyonetrip = '',
return ["img" => $rec1['img'], "name" => $rec1['name'], "id" => mysql_insert_id()];
}
define('_BOTSEPARATOR_', 10000000);
function level_up($uid)
{
$us = db::c()->query('SELECT `id`, `login`, `level`, `money`, `exp`, `nextup`, `stats`, `master`, `ip`, `in_tower` FROM `users` WHERE `id` =?i', $uid)->fetch_assoc();
if (isset($us['id']) && $us['exp'] >= $us['nextup'] && !$us['in_tower']) {
if (EXPTABLE[$us['nextup']][4] == 1) {
addch("Персонаж <b>{$us['login']}</b> перешел на " . ($us['level'] + 1) . " уровень.");
addchp('<span class=\'success\'>Внимание!</span> Вы перешли на новый уровень. За это Вы получаете: ' . EXPTABLE[$us['nextup']][3] . ' кр.', '{[]}' . $us['login'] . '{[]}');
}
$us['nextup'] = EXPTABLE[$us['nextup']][5];
$us['stats'] += EXPTABLE[$us['nextup']][0];
$us['master'] += EXPTABLE[$us['nextup']][1];
db::c()->query('UPDATE `users` SET `nextup` = ?i, `stats` = ?i, `master` = ?i, `level` = ?i WHERE `id` = ?i', $us['nextup'], $us['stats'], $us['master'], $us['level'], $us['id']);
}
}
/*
* Проверка делающая левелап и ограничитель максимального уровня.
*/
//if (isset($_SESSION['uid'])) {
// try {
// $userInfo = db::c()->query('SELECT `exp`, `nextup`, `level` FROM `users` WHERE `id` = ?i', $_SESSION['uid'])->fetch_assoc();
// if ($userInfo && ($userInfo['exp'] >= $userInfo['nextup']) && $userInfo['level'] < 50) {
// level_up($_SESSION['uid']);
// $levelUpArray = ['nextup' => $nextup, 'stats' =>];
// db::c()->query('UPDATE users SET ?Ai, stats = (stats +2), level = (level +1) WHERE id = ?i', $levelUpArray, $_SESSION['uid']);
// }
// } catch (\Krugozor\Database\Mysql\Exception $e) {
// echo $e->getTraceAsString();
// }
//}
const _BOTSEPARATOR_ = 10000000;
function savecavedata($cavedata, $caveleader, $floor)
{
@ -265,7 +234,7 @@ function GiveRep($id, $rep)
* @param string $bg_color - Фон прогрессбара.
* @return string
*/
function showProgressBar($current, $maximum, $line_color = 'limegreen', $bg_color = 'silver')
function showProgressBar($current, $maximum, string $line_color = 'limegreen', string $bg_color = 'silver'): string
{
$bar = round($current / $maximum * 100);
return <<<HTML
@ -582,19 +551,6 @@ function addchp($text, $who, $room = 0)
fclose($fp); //закрытие
}
/**
* @param $msg
*
* @throws \Krugozor\Database\Mysql\Exception
* Отправка системного сообщения в чат.
*/
function AddChatSystem($msg)
{
if ($msg) {
db::c()->query('INSERT INTO `chat` (`cid`,`msg`,`type`) VALUES (?i,"?s","?s")', 1, $msg, 'sys');
}
}
function err($t)
{
echo '<span class="error">' . $t . '</span>';
@ -614,11 +570,6 @@ function telegraph(int $userId, string $text)
}
}
function get_meshok()
{
$itemsWeight = db::c()->query('SELECT SUM(weight) AS all_weight FROM `inventory` WHERE owner_id = ?i AND on_sale = 0', $_SESSION['uid'])->fetch_assoc();
return (User::$current->getStrength() * 4 + $itemsWeight['all_weight']);
}
/**
* Надеюсь временная заглушка, которая объединяет get_meshok() и другую выдачу одной строкой.
@ -635,18 +586,6 @@ function getItemsMassaInfo(): string
return "<span$textStyle>$itemRow->all_weight / $userRow->max_weight</span>";
}
function addlog($id, $log)
{
$fp = fopen("backup/logs/battle" . $id . ".txt", "a");
flock($fp, LOCK_EX);
fputs($fp, $log);
fflush($fp);
flock($fp, LOCK_UN);
fclose($fp);
unset($id, $log);
}
function SolveExp($at_id, $def_id, $damage)
{
$mods = ['bloodb' => 1.2, 'btl_1' => 1, 'btl_2' => 0.5, 'btl_3' => 0.05];

View File

@ -1,4 +1,11 @@
<?php
use Battles\Database\DBPDO;
use Battles\InventoryItem;
use Battles\Template;
use Battles\User;
use Battles\UserInfo;
require_once "functions.php";
$d = mysql_fetch_array(mysql_query("SELECT SUM(`massa`) AS `mass` FROM `inventory` WHERE `owner` = '{$user['id']}' AND `dressed` = 0 AND `setsale` = 0"));
@ -8,10 +15,21 @@ $hostel = mysql_fetch_array(mysql_query('SELECT * FROM `hostel` WHERE `uid` = "'
$base = [1 => 15, 2 => 30, 3 => 50, 4 => 100];
$vips = [1 => 0.15, 2 => 0.30, 3 => 0.45];
function get_meshok(): object
{
$allweight = DBPDO::$db->ofetch('select sum(weight) as items_weight_sum from inventory where on_sale = 0 and owner_id = ?', User::$current->getId());
$stat = new UserInfo(User::$current->getId());
return (object)[
'currentweight' => $allweight->items_weight_sum,
'maxweight' => $stat->getStat('strength') * 4 + $allweight->items_weight_sum,
];
}
function show_item($row, $txt, $place)
{
if (($row['maxdur'] <= $row['duration']) || ($row['dategoden'] && $row['dategoden'] <= time())) {
\Battles\InventoryItem::destroyItem($row['id']);
InventoryItem::destroyItem($row['id']);
}
$r = '';
@ -317,7 +335,8 @@ if ($_GET['search']) {
}
#######
$w = (270 * $d['mass'] / get_meshok());
$w = (270 * get_meshok()->currentweight / get_meshok()->allweight);
$w_a = 270 - $w;
$h = (270 * $in['cnt'] / $count);
$h_a = 270 - $h;
@ -328,7 +347,7 @@ if ($_GET['go_back'] == 1) {
header('Location: hostel.php');
}
\Battles\Template::header('hostel_room');
Template::header('hostel_room');
?>
<script src="js/ajaxLoad.js"></script>
<link rel="stylesheet" type="text/css" href="css/hostel.css"/>
@ -442,7 +461,7 @@ if ($_GET['go_back'] == 1) {
style="width: <?= $w; ?>px; height: 14px;"><img
title="Мешок за спиной" src="/i/1silver.gif"
style=" width: <?= $w_a; ?>px; height:14px"><tt
style="font-size:13px"> <?= $d['mass']; ?>/<?= get_meshok() ?></tt></div>
style="font-size:13px"> <?= getItemsMassaInfo() ?> </tt></div>
<div class="progressBar" style='height:14px'><img title="Заполнение сундука" src="/i/chest.gif"
height="14px"><img title="Заполнение сундука"
src="/i/1blue.gif"

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");

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` = '{$_POST['target']}' LIMIT 1;"));
$owntravma = mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `owner` = ".$us['id']." AND (type=13 OR ND type=12 OR type=14);"));
$magic = mysql_fetch_array(mysql_query("SELECT `chanse` FROM `magic` WHERE `id` = '23' ;"));
@ -99,7 +103,7 @@ if ($user['battle'] > 0) {
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' вмешался в поединок!<BR>\') WHERE `id` = '.$jert['battle'].'');
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` = '.$jert['battle'].' ;');
mysql_query("UPDATE users SET `battle` =".$jert['battle'].",`zayavka`=0 WHERE `id`= ".$user['id']);
@ -162,7 +166,7 @@ if ($user['battle'] > 0) {
//mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}',"Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>");
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");

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"));
@ -84,7 +88,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");
@ -122,7 +126,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");
}

View File

@ -1,5 +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` = '{$_POST['target']}' LIMIT 1;"));
$owntravma = mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `owner` = ".$us['id']." AND (type=13 OR ND type=12 OR type=14);"));
$magic = mysql_fetch_array(mysql_query("SELECT `chanse` FROM `magic` WHERE `id` = '24' ;"));
@ -110,7 +113,7 @@ elseif (!$us['online']) {
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' вмешался в поединок!<BR>\') WHERE `id` = '.$jert['battle'].'');
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` = '.$jert['battle'].' ;');
mysql_query("UPDATE users SET `battle` =".$jert['battle'].",`zayavka`=0 WHERE `id`= ".$user['id']);
@ -172,7 +175,7 @@ elseif (!$us['online']) {
addch ("<a href=logs.php?log=".$id." target=_blank>Бой</a> между <B><b>".Nick::id($user['id'])->short()."</b> и <b>".Nick::id($jert['id'])->short()."</b> начался. ",$user->getRoom());
//mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}','Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>');");
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>");

View File

@ -1,5 +1,7 @@
<?php
#$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` = '{$_POST['target']}' LIMIT 1;"));
use Battles\Nick;
$owntravma = mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `owner` = ".$us['id']." AND (type=13 OR ND type=12 OR type=14);"));
$magic = mysql_fetch_array(mysql_query("SELECT `chanse` FROM `magic` WHERE `id` = '23' ;"));
$us_b=mysql_fetch_array(mysql_query("SELECT `type`,`open` FROM `battle` WHERE `id`='{$us['battle']}';"));
@ -65,7 +67,7 @@ if ($user['battle'] > 0) {
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' вмешался в поединок!<BR>\') WHERE `id` = '.$jert['battle'].'');
//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` = '.$jert['battle'].' ;');
mysql_query("UPDATE users SET `battle` =".$jert['battle'].",`zayavka`=0 WHERE `id`= ".$user['id']);

View File

@ -1,5 +1,9 @@
<?php
use Battles\DressedItems;
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` = '{$_POST['target']}' LIMIT 1;"));
$owntravma = mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `owner` = " . $us['id'] . " AND (type=13 OR ND type=12 OR type=14);"));
$magic = mysql_fetch_array(mysql_query("SELECT `chanse` FROM `magic` WHERE `id` = '23' ;"));
@ -85,7 +89,7 @@ if ($user['battle'] > 0) {
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' вмешался в поединок!<BR>\') WHERE `id` = '.$jert['battle'].'');
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` = ' . $jert['battle'] . ' ;');
mysql_query("UPDATE users SET `battle` =" . $jert['battle'] . ",`zayavka`=0 WHERE `id`= " . $user['id']);
@ -117,8 +121,8 @@ if ($user['battle'] > 0) {
mysql_query("INSERT INTO `bots` (`name`,`prototype`,`battle`,`hp`) values ('Архивариус','83','','" . $jert['hp'] . "');");
$jert['id'] = mysql_insert_id();
}
\Battles\DressedItems::undressAllItems($jert['id']);
\Battles\DressedItems::undressAllItems($user['id']);
DressedItems::undressAllItems($jert['id']);
DressedItems::undressAllItems($user['id']);
$teams = [];
$teams[$user['id']][$jert['id']] = [0, 0, time()];
$teams[$jert['id']][$user['id']] = [0, 0, time()];
@ -150,7 +154,7 @@ if ($user['battle'] > 0) {
//mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}',"Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>");
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");

View File

@ -1,5 +1,9 @@
<?php
use Battles\DressedItems;
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` = '{$_POST['target']}' LIMIT 1;"));
$owntravma = mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `owner` = ".$us['id']." AND (type=13 OR ND type=12 OR type=14);"));
$magic = mysql_fetch_array(mysql_query("SELECT `chanse` FROM `magic` WHERE `id` = '23' ;"));
@ -104,8 +108,8 @@ elseif (!$us['online']) {
}
if(rand(0,100)<80)
\Battles\DressedItems::undressAllItems($jert['id']);
\Battles\DressedItems::undressAllItems($user['id']);
DressedItems::undressAllItems($jert['id']);
DressedItems::undressAllItems($user['id']);
$teams = array();
$teams[$user['id']][$jert['id']] = array(0,0,time());
$teams[$jert['id']][$user['id']] = array(0,0,time());
@ -137,7 +141,7 @@ elseif (!$us['online']) {
//mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}',"Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>");
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']}");
$outok=1;

View File

@ -1,5 +1,9 @@
<?php
use Battles\DressedItems;
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` = '{$_POST['target']}' LIMIT 1;"));
$owntravma = mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `owner` = ".$us['id']." AND (type=13 OR ND type=12 OR type=14);"));
$magic = mysql_fetch_array(mysql_query("SELECT `chanse` FROM `magic` WHERE `id` = '23' ;"));
@ -104,8 +108,8 @@ if ($user['battle'] > 0) {
}
if(rand(0,100)<80)
\Battles\DressedItems::undressAllItems($jert['id']);
\Battles\DressedItems::undressAllItems($user['id']);
DressedItems::undressAllItems($jert['id']);
DressedItems::undressAllItems($user['id']);
$teams = array();
$teams[$user['id']][$jert['id']] = array(0,0,time());
$teams[$jert['id']][$user['id']] = array(0,0,time());
@ -137,7 +141,7 @@ if ($user['battle'] > 0) {
//mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}',"Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>");
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']}");
$outok=1;

View File

@ -1,5 +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` = '{$_POST['target']}' LIMIT 1;"));
$owntravma = mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `owner` = ".$us['id']." AND (type=13 OR ND type=12 OR type=14);"));
$magic = mysql_fetch_array(mysql_query("SELECT `chanse` FROM `magic` WHERE `id` = '24' ;"));
@ -110,7 +113,7 @@ elseif (!$us['online']) {
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' вмешался в поединок!<BR>\') WHERE `id` = '.$jert['battle'].'');
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` = '.$jert['battle'].' ;');
mysql_query("UPDATE users SET `battle` =".$jert['battle'].",`zayavka`=0 WHERE `id`= ".$user['id']);
@ -172,7 +175,7 @@ elseif (!$us['online']) {
addch ("<a href=logs.php?log=".$id." target=_blank>Бой</a> между <B><b>".Nick::id($user['id'])->short()."</b> и <b>".Nick::id($jert['id'])->short()."</b> начался. ",$user->getRoom());
//mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}','Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>');");
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>");

View File

@ -1,5 +1,8 @@
<?php
// magic выход из боя
use Battles\GameLogs;
use Battles\Nick;
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
@ -18,9 +21,9 @@ if ($user['battle'] == 0) {
//unset($fbattle->battle[$user['id']]);
if ($us['sex'] == 1) {
addlog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' вышла из боя!<BR>');
GameLogs::addBattleLog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' вышла из боя!<BR>');
} else {
addlog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' вышел из боя!<BR>');
GameLogs::addBattleLog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' вышел из боя!<BR>');
}
$bd = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = ' . $user['battle'] . ' LIMIT 1;'));

View File

@ -1,5 +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` = '{$_POST['target']}' LIMIT 1;"));
$battle = mysql_fetch_array(mysql_query("SELECT `close` FROM `battle` WHERE `id` = '{$us['battle']}' ;"));
$owntravma = mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `owner` = ".$us['id']." AND (type=13 OR ND type=12 OR type=14);"));
@ -82,7 +85,7 @@ elseif ($user['zayavka'] > 0) {
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' вмешался в поединок!<BR>\') WHERE `id` = '.$jert['battle'].'');
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` = '.$jert['battle'].' ;');
mysql_query("UPDATE users SET `battle` =".$jert['battle'].",`zayavka`=0 WHERE `id`= ".$user['id']);
@ -146,7 +149,7 @@ elseif ($user['zayavka'] > 0) {
//mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}',"Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>");
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");

View File

@ -1,4 +1,8 @@
<?php
use Battles\GameLogs;
use Battles\Nick;
if ($user->getRoom() == 20) {
//нападение
$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` = '{$_POST['target']}' LIMIT 1;"));
@ -65,7 +69,7 @@ if ($user->getRoom() == 20) {
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' вмешался в поединок!<BR>\') WHERE `id` = '.$jert['battle'].'');
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` = ' . $jert['battle'] . ' ;');
mysql_query("UPDATE users SET `battle` =" . $jert['battle'] . ",`zayavka`=0,`hit`=0,`parry`=0,`krit`=0,`counter`=0,`hp2`=0 WHERE `id`= " . $user['id']);
@ -134,7 +138,7 @@ if ($user->getRoom() == 20) {
$jert['id'] = 3954;
}
$rr = "<b>" . Nick::id($user['id'])->full(1) . "</b> и <b>" . Nick::id($jert['id'])->full(1) . "</b>";
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>");
if ($jert['id'] && $user['id'] && $jert['id'] < 999999) {
$btfl = fopen('tmp/' . $user['id'] . '.btl', 'a');

View File

@ -1,5 +1,8 @@
<?php
// magic идентификацыя
use Battles\GameLogs;
use Battles\Nick;
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
@ -35,7 +38,7 @@ if ($user['battle'] == 0) {
$ttt = 2;
}
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' породил своего клона '.nick::id($bot)->short().'<BR>\') WHERE `id` = '.$user['battle'].';');
addlog($user['battle'],'<span class=date>'.date("H:i").'</span> '.Nick::id($user['id'])->short().' породил своего клона '.Nick::id($bot)->short().'<BR>');
GameLogs::addBattleLog($user['battle'],'<span class=date>'.date("H:i").'</span> '.Nick::id($user['id'])->short().' породил своего клона '.Nick::id($bot)->short().'<BR>');
mysql_query('UPDATE `battle` SET `teams` = \''.serialize($battle).'\', `t'.$ttt.'`=CONCAT(`t'.$ttt.'`,\';'.$bot.'\') WHERE `id` = '.$user['battle'].' ;');

View File

@ -1,4 +1,8 @@
<?php
use Battles\GameLogs;
use Battles\Nick;
if ($_SESSION['uid'] == null) {
header("Location: index.php");
exit;
@ -31,7 +35,7 @@ if ($user['battle'] == 0) {
}
$lo = Nick::id($user['id'])->short();
$los = Nick::id($bot)->short();
addlog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . $lo . ' породил своего клона ' . $los . '.<BR>');
GameLogs::addBattleLog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . $lo . ' породил своего клона ' . $los . '.<BR>');
mysql_query('UPDATE `battle` SET `teams` = \'' . serialize($battle) . '\', `t' . $ttt . '` = CONCAT(`t' . $ttt . '`,\';' . $bot . '\') WHERE `id` = "' . $user['battle'] . '" LIMIT 1');
mysql_query("UPDATE `battle` SET `to1` = '" . time() . "', `to2` = '" . time() . "' WHERE `id` = " . $user['battle'] . " LIMIT 1");
echo "Клон создан";

View File

@ -1,5 +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` = '{$_POST['target']}' LIMIT 1;"));
$owntravma = mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `owner` = ".$us['id']." AND (type=13 OR type=12 OR type=14);"));
$raid_t=mysql_fetch_array(mysql_query("SELECT * FROM variables WHERE var='raid_on_status' limit 1;"));
@ -110,7 +113,7 @@ elseif (!$us['online']) {
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' вмешался в поединок!<BR>\') WHERE `id` = '.$jert['battle'].'');
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` = '.$jert['battle'].' ;');
mysql_query("UPDATE users SET `battle` =".$jert['battle'].",`zayavka`=0 WHERE `id`= ".$user['id']);
@ -173,7 +176,7 @@ elseif (!$us['online']) {
//mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}','Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>');");
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");

View File

@ -1,5 +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 * FROM `effects` WHERE `owner` = ".$us['id']." AND (type=13 OR type=12 OR type=14);"));
$raid_t=mysql_fetch_array(mysql_query("SELECT * FROM variables WHERE var='raid_on_status' limit 1;"));
@ -115,7 +118,7 @@ elseif ($user['zayavka'] > 0) {
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' вмешался в поединок!<BR>\') WHERE `id` = '.$jert['battle'].'');
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` = '.$jert['battle'].' ;');
mysql_query("UPDATE users SET `battle` =".$jert['battle'].",`zayavka`=0 WHERE `id`= ".$user['id']);
@ -186,7 +189,7 @@ $outok=1;
//mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}','Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>');");
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']}");
$outok=1;

View File

@ -1,5 +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` = '{$_POST['target']}' LIMIT 1;"));
$owntravma = mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `owner` = ".$us['id']." AND (type=13 OR type=12 OR type=14);"));
$raid_t=mysql_fetch_array(mysql_query("SELECT * FROM variables WHERE var='raid_on_status' limit 1;"));
@ -115,7 +118,7 @@ elseif ($user['zayavka'] > 0) {
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' вмешался в поединок!<BR>\') WHERE `id` = '.$jert['battle'].'');
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` = '.$jert['battle'].' ;');
mysql_query("UPDATE users SET `battle` =".$jert['battle'].",`zayavka`=0 WHERE `id`= ".$user['id']);
@ -185,7 +188,7 @@ $outok=1;
addch ("<a href=logs.php?log=".$id." target=_blank>Бой</a> между <B><b>".Nick::id($user['id'])->short()."</b> и <b>".Nick::id($jert['id'])->short()."</b> начался. ",$user->getRoom());
//mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}','Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>');");
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>");

View File

@ -1,4 +1,8 @@
<?php
use Battles\GameLogs;
use Battles\Nick;
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
@ -36,7 +40,7 @@ if ($user['battle'] == 0) {
$ttt = 2;
}
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' породил своего клона '.nick::id($bot)->short().'<BR>\') WHERE `id` = '.$user['battle'].';');
addlog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' вызвал ' . Nick::id($bot)->short() . '<BR>');
GameLogs::addBattleLog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' вызвал ' . Nick::id($bot)->short() . '<BR>');
mysql_query('UPDATE `battle` SET `teams` = \'' . serialize($battle) . '\', `t' . $ttt . '`=CONCAT(`t' . $ttt . '`,\';' . $bot . '\') WHERE `id` = ' . $user['battle'] . ' ;');

View File

@ -1,4 +1,8 @@
<?php
use Battles\GameLogs;
use Battles\Nick;
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
@ -36,7 +40,7 @@ if ($user['battle'] == 0) {
$ttt = 2;
}
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' породил своего клона '.nick::id($bot)->short().'<BR>\') WHERE `id` = '.$user['battle'].';');
addlog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' вызвал ' . Nick::id($bot)->short() . '<BR>');
GameLogs::addBattleLog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' вызвал ' . Nick::id($bot)->short() . '<BR>');
mysql_query('UPDATE `battle` SET `teams` = \'' . serialize($battle) . '\', `t' . $ttt . '`=CONCAT(`t' . $ttt . '`,\';' . $bot . '\') WHERE `id` = ' . $user['battle'] . ' ;');

View File

@ -1,4 +1,8 @@
<?php
use Battles\GameLogs;
use Battles\Nick;
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
@ -36,7 +40,7 @@ if ($user['battle'] == 0) {
$ttt = 2;
}
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' породил своего клона '.nick::id($bot)->short().'<BR>\') WHERE `id` = '.$user['battle'].';');
addlog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' вызвал ' . Nick::id($bot)->short() . '<BR>');
GameLogs::addBattleLog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' вызвал ' . Nick::id($bot)->short() . '<BR>');
mysql_query('UPDATE `battle` SET `teams` = \'' . serialize($battle) . '\', `t' . $ttt . '`=CONCAT(`t' . $ttt . '`,\';' . $bot . '\') WHERE `id` = ' . $user['battle'] . ' ;');

View File

@ -1,4 +1,8 @@
<?php
use Battles\GameLogs;
use Battles\Nick;
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
@ -36,7 +40,7 @@ if ($user['battle'] == 0) {
$ttt = 2;
}
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' породил своего клона '.nick::id($bot)->short().'<BR>\') WHERE `id` = '.$user['battle'].';');
addlog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' вызвал ' . Nick::id($bot)->short() . '<BR>');
GameLogs::addBattleLog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' вызвал ' . Nick::id($bot)->short() . '<BR>');
mysql_query('UPDATE `battle` SET `teams` = \'' . serialize($battle) . '\', `t' . $ttt . '`=CONCAT(`t' . $ttt . '`,\';' . $bot . '\') WHERE `id` = ' . $user['battle'] . ' ;');

View File

@ -1,5 +1,8 @@
<?php
use Battles\GameLogs;
use Battles\Nick;
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
@ -40,7 +43,7 @@ if ($user['battle'] == 0) {
$ttt = 2;
}
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' породил своего клона '.nick::id($bot)->short().'<BR>\') WHERE `id` = '.$user['battle'].';');
addlog($user['battle'],'<span class=date>'.date("H:i").'</span> '.Nick::id($user['id'])->short().' вызвал '.Nick::id($bot)->short().'<BR>');
GameLogs::addBattleLog($user['battle'],'<span class=date>'.date("H:i").'</span> '.Nick::id($user['id'])->short().' вызвал '.Nick::id($bot)->short().'<BR>');
mysql_query('UPDATE `battle` SET `teams` = \''.serialize($battle).'\', `t'.$ttt.'`=CONCAT(`t'.$ttt.'`,\';'.$bot.'\') WHERE `id` = '.$user['battle'].' ;');

View File

@ -1,5 +1,8 @@
<?php
use Battles\GameLogs;
use Battles\Nick;
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
@ -40,7 +43,7 @@ if ($user['battle'] == 0) {
$ttt = 2;
}
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' породил своего клона '.nick::id($bot)->short().'<BR>\') WHERE `id` = '.$user['battle'].';');
addlog($user['battle'],'<span class=date>'.date("H:i").'</span> '.Nick::id($user['id'])->short().' вызвал '.Nick::id($bot)->short().'<BR>');
GameLogs::addBattleLog($user['battle'],'<span class=date>'.date("H:i").'</span> '.Nick::id($user['id'])->short().' вызвал '.Nick::id($bot)->short().'<BR>');
mysql_query('UPDATE `battle` SET `teams` = \''.serialize($battle).'\', `t'.$ttt.'`=CONCAT(`t'.$ttt.'`,\';'.$bot.'\') WHERE `id` = '.$user['battle'].' ;');

View File

@ -1,4 +1,8 @@
<?php
use Battles\GameLogs;
use Battles\Nick;
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
@ -41,7 +45,7 @@ if ($user['battle'] == 0) {
$ttt = 2;
}
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' породил своего клона '.nick::id($bot)->short().'<BR>\') WHERE `id` = '.$user['battle'].';');
addlog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' вызвал ' . Nick::id($bot)->short() . '<BR>');
GameLogs::addBattleLog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' вызвал ' . Nick::id($bot)->short() . '<BR>');
mysql_query('UPDATE `battle` SET `teams` = \'' . serialize($battle) . '\', `t' . $ttt . '`=CONCAT(`t' . $ttt . '`,\';' . $bot . '\') WHERE `id` = ' . $user['battle'] . ' ;');

View File

@ -1,4 +1,8 @@
<?php
use Battles\GameLogs;
use Battles\Nick;
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
@ -41,7 +45,7 @@ if ($user['battle'] == 0) {
$ttt = 2;
}
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' породил своего клона '.nick::id($bot)->short().'<BR>\') WHERE `id` = '.$user['battle'].';');
addlog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' вызвал ' . Nick::id($bot)->short() . '<BR>');
GameLogs::addBattleLog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' вызвал ' . Nick::id($bot)->short() . '<BR>');
mysql_query('UPDATE `battle` SET `teams` = \'' . serialize($battle) . '\', `t' . $ttt . '`=CONCAT(`t' . $ttt . '`,\';' . $bot . '\') WHERE `id` = ' . $user['battle'] . ' ;');

View File

@ -1,5 +1,9 @@
<?
if (empty($_SESSION['uid'])) {
use Battles\GameLogs;
use Battles\Nick;
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
}
@ -15,5 +19,5 @@ echo"В тексте не должно присутствовать подряд
}else{
$mess = $_POST['target'];
if ($user['sex'] == 1) {$action="выкрикнул";} else {$action="выкрикнула";}
addlog($user['battle'],'<span class=sysdate>'.date("H:i").'</span> '.Nick::id($user['id'])->short().' '.$action.': '.$mess.'<BR>');
GameLogs::addBattleLog($user['battle'],'<span class=sysdate>'.date("H:i").'</span> '.Nick::id($user['id'])->short().' '.$action.': '.$mess.'<BR>');
}

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"));
@ -78,7 +82,7 @@ if($vip['pers_attack'] <= 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");
@ -116,7 +120,7 @@ if($vip['pers_attack'] <= 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");
}

View File

@ -1,4 +1,8 @@
<?php
use Battles\GameLogs;
use Battles\Nick;
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
@ -57,7 +61,7 @@ if ($user['battle'] == 0) {
$t1 = implode(";", $t1);
$t2 = implode(";", $t2);
addlog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' переманил клона ' . Nick::id($bot)->short() . ' на свою сторону<BR>');
GameLogs::addBattleLog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' переманил клона ' . Nick::id($bot)->short() . ' на свою сторону<BR>');
mysql_query('UPDATE `battle` SET `teams` = \'' . serialize($battle) . '\', `t1` = \'' . $t1 . '\', `t2` = \'' . $t2 . '\' WHERE `id` = ' . $user['battle'] . ' ;');
mysql_query("UPDATE `battle` SET `to1` = '" . time() . "', `to2` = '" . time() . "' WHERE `id` = " . $user['battle'] . " LIMIT 1;");

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['attack'] <= 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'].'\') 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['attack'] <= 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");
}

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");
}

View File

@ -1,4 +1,7 @@
<?php
use Battles\GameLogs;
if ($_SESSION['uid'] == null) {
header("Location: index.php");
exit;
@ -31,7 +34,7 @@ if ($user['battle'] == 0) {
}
$lo = Nick::id($user['id'])->short();
$los = Nick::id($bot)->short();
addlog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . $lo . ' породил своего клона ' . $los . '.<BR>');
GameLogs::addBattleLog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . $lo . ' породил своего клона ' . $los . '.<BR>');
mysql_query('UPDATE `battle` SET `teams` = \'' . serialize($battle) . '\', `t' . $ttt . '` = CONCAT(`t' . $ttt . '`,\';' . $bot . '\') WHERE `id` = "' . $user['battle'] . '" LIMIT 1');
mysql_query("UPDATE `battle` SET `to1` = '" . time() . "', `to2` = '" . time() . "' WHERE `id` = " . $user['battle'] . " LIMIT 1");
echo "Клон создан";

View File

@ -1,5 +1,9 @@
<?php
$us = mysql_fetch_array(mysql_query("SELECT *, (SELECT `id` FROM `online` WHERE `date` >= ".(time()-60)." AND `id` = `users`.`id`) AS `online` FROM `users` WHERE `login` = '".mysql_real_escape_string($_POST['target'])."' LIMIT 1"));
use Battles\GameLogs;
use Battles\Nick;
$us = mysql_fetch_array(mysql_query("SELECT *, (SELECT `id` FROM `online` WHERE `date` >= ".(time()-60)." AND `id` = `users`.`id`) AS `online` FROM `users` WHERE `login` = '".mysql_real_escape_string($_POST['target'])."' LIMIT 1"));
$vip = mysql_fetch_array(mysql_query('SELECT `id`, `klan`, `closebattle` FROM `abils_klan` WHERE `klan` = "'.$user['klan'].'" LIMIT 1'));
$battle = mysql_fetch_array(mysql_query('SELECT `id`, `open`, `close` FROM `battle` WHERE `id` = "'.$user['battle'].'" LIMIT 1'));
@ -12,7 +16,7 @@ if($user['battle'] <= 0) {
} else {
$vip['closebattle'] -= 1;
if($user['invis'] == 1) { $lod = '<i><b>невидимка</b></i>'; } else { $lod = Nick::id($user['id'])->short(); }
addlog($battle['id'], '<span class=date>'.date("H:i").'</span> '.$lod.' закрыл поединок от внешних вмешательств!<BR>');
GameLogs::addBattleLog($battle['id'], '<span class=date>'.date("H:i").'</span> '.$lod.' закрыл поединок от внешних вмешательств!<BR>');
mysql_query('UPDATE `battle` SET `open` = 0 WHERE `id` = "'.$battle['id'].'" LIMIT 1');
mysql_query('UPDATE `abils_klan` SET `closebattle` = "'.$vip['closebattle'].'" WHERE `klan` = "'.$vip['klan'].'" LIMIT 1');
echo 'Ваш поединок, закрыт...';

View File

@ -1,4 +1,8 @@
<?
<?php
use Battles\GameLogs;
use Battles\Nick;
$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$_SESSION['uid']}' LIMIT 1"));
$vip = mysql_fetch_array(mysql_query('SELECT `id`, `klan`, `comment` FROM `abils_klan` WHERE `klan` = "'.$user['klan'].'" LIMIT 1'));
$battle = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle` WHERE `id` = "'.$user['battle'].'" LIMIT 1'));
@ -29,6 +33,6 @@ if($_POST['target'] == '' || $_POST['target'] == "") {
}
$vip['comment'] -= 1;
if($user['invis'] == 1) { $lod = '<i><b>невидимка</b></i>'; } else { $lod = Nick::id($user['id'])->short(); }
addlog($user['battle'], '<span class=sysdate>'.date("H:i").'</span> '.$lod.' '.$action.': '.$mess.'<BR>');
GameLogs::addBattleLog($user['battle'], '<span class=sysdate>'.date("H:i").'</span> '.$lod.' '.$action.': '.$mess.'<BR>');
mysql_query('UPDATE `abils_klan` SET `comment` = "'.$vip['comment'].'" WHERE `klan` = "'.$vip['klan'].'" LIMIT 1');
}

View File

@ -1,5 +1,9 @@
<?php
$us = mysql_fetch_array(mysql_query("SELECT *, (SELECT `id` FROM `online` WHERE `date` >= ".(time()-60)." AND `id` = `users`.`id`) AS `online` FROM `users` WHERE `login` = '".mysql_real_escape_string($_POST['target'])."' LIMIT 1"));
use Battles\GameLogs;
use Battles\Nick;
$us = mysql_fetch_array(mysql_query("SELECT *, (SELECT `id` FROM `online` WHERE `date` >= ".(time()-60)." AND `id` = `users`.`id`) AS `online` FROM `users` WHERE `login` = '".mysql_real_escape_string($_POST['target'])."' LIMIT 1"));
$vip = mysql_fetch_array(mysql_query('SELECT `id`, `klan`, `openbattle` FROM `abils_klan` WHERE `klan` = "'.$user['klan'].'" LIMIT 1'));
$battle = mysql_fetch_array(mysql_query('SELECT `id`, `open`, `close` FROM `battle` WHERE `id` = "'.$user['battle'].'" LIMIT 1'));
@ -14,7 +18,7 @@ if($user['battle'] <= 0) {
} else {
$vip['openbattle'] -= 1;
if($user['invis'] == 1) { $lod = '<i><b>невидимка</b></i>'; } else { $lod = Nick::id($user['id'])->short(); }
addlog($battle['id'], '<span class=date>'.date("H:i").'</span> '.$lod.' открыл поединок для внешних вмешательств!<BR>');
GameLogs::addBattleLog($battle['id'], '<span class=date>'.date("H:i").'</span> '.$lod.' открыл поединок для внешних вмешательств!<BR>');
mysql_query('UPDATE `battle` SET `open` = 1 WHERE `id` = "'.$battle['id'].'" LIMIT 1');
mysql_query('UPDATE `abils_klan` SET `openbattle` = "'.$vip['openbattle'].'" WHERE `klan` = "'.$vip['klan'].'" LIMIT 1');
echo 'Ваш поединок, открыт...';

View File

@ -1,5 +1,9 @@
<?php
$us = mysql_fetch_array(mysql_query("SELECT *, (SELECT `id` FROM `online` WHERE `date` >= ".(time()-60)." AND `id` = `users`.`id`) AS `online` FROM `users` WHERE `login` = '".mysql_real_escape_string($_POST['target'])."' LIMIT 1"));
use Battles\GameLogs;
use Battles\Nick;
$us = mysql_fetch_array(mysql_query("SELECT *, (SELECT `id` FROM `online` WHERE `date` >= ".(time()-60)." AND `id` = `users`.`id`) AS `online` FROM `users` WHERE `login` = '".mysql_real_escape_string($_POST['target'])."' LIMIT 1"));
$vip = mysql_fetch_array(mysql_query('SELECT `id`, `klan`, `reamdeath` FROM `abils_klan` WHERE `klan` = "'.$user['klan'].'" LIMIT 1'));
$battle = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle` WHERE `id` = "'.$user['battle'].'" LIMIT 1'));
@ -20,7 +24,7 @@ if(!isset($battle['id'])) {
echo "Персонаж не в игре!";
} else {
if($user['invis'] == 1) { $lod = '<i><b>невидимка</b></i>'; } else { $lod = Nick::id($user['id'])->short(); }
addlog($battle['id'], '<span class=date>'.date("H:i").'</span> '.$lod.' применил заклятие &quot;Поднять мертвого&quot;, и воскресил персонажа <b>'.$us['login'].'</b>!<BR>');
GameLogs::addBattleLog($battle['id'], '<span class=date>'.date("H:i").'</span> '.$lod.' применил заклятие &quot;Поднять мертвого&quot;, и воскресил персонажа <b>'.$us['login'].'</b>!<BR>');
mysql_query('UPDATE `users` SET `hp` = `maxhp` WHERE `id` = "'.$us['id'].'" LIMIT 1');
$vip['reamdeath'] -= 1;
mysql_query('UPDATE `abils_klan` SET `reamdeath` = "'.$vip['reamdeath'].'" WHERE `klan` = "'.$vip['klan'].'" LIMIT 1');

View File

@ -1,4 +1,8 @@
<?php
use Battles\GameLogs;
use Battles\Nick;
if ($_SESSION['uid'] == null) {
header("Location: index.php");
exit;
@ -55,7 +59,7 @@ if ($user['battle'] == 0) {
$t1 = implode(";", $t1);
$t2 = implode(";", $t2);
addlog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' переманил клона ' . Nick::id($bot)->short() . ' на свою сторону<BR>');
GameLogs::addBattleLog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' переманил клона ' . Nick::id($bot)->short() . ' на свою сторону<BR>');
mysql_query('UPDATE `battle` SET `teams` = \'' . serialize($battle) . '\', `t1` = \'' . $t1 . '\', `t2` = \'' . $t2 . '\' WHERE `id` = ' . $user['battle'] . ' LIMIT 1');
mysql_query("UPDATE `battle` SET `to1` = '" . time() . "', `to2` = '" . time() . "' WHERE `id` = " . $user['battle'] . " LIMIT 1");
echo "Вы переманили клона";

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['attack'] <= 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'].'\') 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['attack'] <= 0) {
if($user['invis'] == 1) { $lds = '<i><b>невидимка</b></i>'; } else { $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");
}

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");
}

View File

@ -1,4 +1,8 @@
<?php
use Battles\GameLogs;
use Battles\Nick;
if ($_SESSION['uid'] == null) {
header("Location: index.php");
exit;
@ -39,7 +43,7 @@ if ($user['battle'] == 0) {
} else {
$los = Nick::id($bot)->short();
}
addlog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . $lo . ' породил своего клона ' . $los . '.<BR><hr>');
GameLogs::addBattleLog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . $lo . ' породил своего клона ' . $los . '.<BR><hr>');
mysql_query('UPDATE `battle` SET `teams` = \'' . serialize($battle) . '\', `t' . $ttt . '` = CONCAT(`t' . $ttt . '`,\';' . $bot . '\') WHERE `id` = "' . $user['battle'] . '" LIMIT 1');
mysql_query("UPDATE `battle` SET `to1` = '" . time() . "', `to2` = '" . time() . "' WHERE `id` = " . $user['battle'] . " LIMIT 1");
echo "Клон создан";

View File

@ -1,5 +1,9 @@
<?php
$us = mysql_fetch_array(mysql_query("SELECT *, (SELECT `id` FROM `online` WHERE `date` >= ".(time()-60)." AND `id` = `users`.`id`) AS `online` FROM `users` WHERE `login` = '".mysql_real_escape_string($_POST['target'])."' LIMIT 1"));
use Battles\GameLogs;
use Battles\Nick;
$us = mysql_fetch_array(mysql_query("SELECT *, (SELECT `id` FROM `online` WHERE `date` >= ".(time()-60)." AND `id` = `users`.`id`) AS `online` FROM `users` WHERE `login` = '".mysql_real_escape_string($_POST['target'])."' LIMIT 1"));
$vip = mysql_fetch_array(mysql_query('SELECT `id`, `uid`, `closebattle` FROM `abils_user` WHERE `uid` = "'.$user['id'].'" LIMIT 1'));
$battle = mysql_fetch_array(mysql_query('SELECT `id`, `open`, `close` FROM `battle` WHERE `id` = "'.$user['battle'].'" LIMIT 1'));
@ -12,7 +16,7 @@ if($user['battle'] <= 0) {
} else {
$vip['closebattle'] -= 1;
if($user['invis'] == 1) { $lod = '<i><b>невидимка</b></i>'; } else { $lod = Nick::id($user['id'])->short(); }
addlog($battle['id'], '<span class=date>'.date("H:i").'</span> '.$lod.' закрыл поединок от внешних вмешательств!<BR>');
GameLogs::addBattleLog($battle['id'], '<span class=date>'.date("H:i").'</span> '.$lod.' закрыл поединок от внешних вмешательств!<BR>');
mysql_query('UPDATE `battle` SET `open` = 0 WHERE `id` = "'.$battle['id'].'" LIMIT 1');
mysql_query('UPDATE `abils_user` SET `closebattle` = "'.$vip['closebattle'].'" WHERE `id` = "'.$vip['id'].'" LIMIT 1');
echo 'Ваш поединок, закрыт...';

View File

@ -1,4 +1,8 @@
<?
<?php
use Battles\GameLogs;
use Battles\Nick;
$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$_SESSION['uid']}' LIMIT 1"));
$vip = mysql_fetch_array(mysql_query('SELECT `id`, `uid`, `comment` FROM `abils_user` WHERE `uid` = "'.$user['id'].'" LIMIT 1'));
$battle = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle` WHERE `id` = "'.$user['battle'].'" LIMIT 1'));
@ -29,6 +33,6 @@ if($_POST['target'] == '' || $_POST['target'] == "") {
}
$vip['comment'] -= 1;
if($user['invis'] == 1) { $lod = '<i><b>невидимка</b></i>'; } else { $lod = Nick::id($user['id'])->short(); }
addlog($user['battle'], '<span class=sysdate>'.date("H:i").'</span> '.$lod.' '.$action.': '.$mess.'<BR>');
GameLogs::addBattleLog($user['battle'], '<span class=sysdate>'.date("H:i").'</span> '.$lod.' '.$action.': '.$mess.'<BR>');
mysql_query('UPDATE `abils_user` SET `comment` = "'.$vip['comment'].'" WHERE `id` = "'.$vip['id'].'" LIMIT 1');
}

View File

@ -1,5 +1,9 @@
<?php
$us = mysql_fetch_array(mysql_query("SELECT *, (SELECT `id` FROM `online` WHERE `date` >= ".(time()-60)." AND `id` = `users`.`id`) AS `online` FROM `users` WHERE `login` = '".mysql_real_escape_string($_POST['target'])."' LIMIT 1"));
use Battles\GameLogs;
use Battles\Nick;
$us = mysql_fetch_array(mysql_query("SELECT *, (SELECT `id` FROM `online` WHERE `date` >= ".(time()-60)." AND `id` = `users`.`id`) AS `online` FROM `users` WHERE `login` = '".mysql_real_escape_string($_POST['target'])."' LIMIT 1"));
$vip = mysql_fetch_array(mysql_query('SELECT `id`, `uid`, `openbattle` FROM `abils_user` WHERE `uid` = "'.$user['id'].'" LIMIT 1'));
$battle = mysql_fetch_array(mysql_query('SELECT `id`, `open`, `close` FROM `battle` WHERE `id` = "'.$user['battle'].'" LIMIT 1'));
@ -14,7 +18,7 @@ if($user['battle'] <= 0) {
} else {
$vip['openbattle'] -= 1;
if($user['invis'] == 1) { $lod = '<i><b>невидимка</b></i>'; } else { $lod = Nick::id($user['id'])->short(); }
addlog($battle['id'], '<span class=date>'.date("H:i").'</span> '.$lod.' открыл поединок для внешних вмешательств!<BR>');
GameLogs::addBattleLog($battle['id'], '<span class=date>'.date("H:i").'</span> '.$lod.' открыл поединок для внешних вмешательств!<BR>');
mysql_query('UPDATE `battle` SET `open` = 1 WHERE `id` = "'.$battle['id'].'" LIMIT 1');
mysql_query('UPDATE `abils_user` SET `openbattle` = "'.$vip['openbattle'].'" WHERE `id` = "'.$vip['id'].'" LIMIT 1');
echo 'Ваш поединок, открыт...';

View File

@ -1,5 +1,9 @@
<?php
$us = mysql_fetch_array(mysql_query("SELECT *, (SELECT `id` FROM `online` WHERE `date` >= ".(time()-60)." AND `id` = `users`.`id`) AS `online` FROM `users` WHERE `login` = '".mysql_real_escape_string($_POST['target'])."' LIMIT 1"));
use Battles\GameLogs;
use Battles\Nick;
$us = mysql_fetch_array(mysql_query("SELECT *, (SELECT `id` FROM `online` WHERE `date` >= ".(time()-60)." AND `id` = `users`.`id`) AS `online` FROM `users` WHERE `login` = '".mysql_real_escape_string($_POST['target'])."' LIMIT 1"));
$vip = mysql_fetch_array(mysql_query('SELECT `id`, `uid`, `reamdeath` FROM `abils_user` WHERE `uid` = "'.$user['id'].'" LIMIT 1'));
$battle = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle` WHERE `id` = "'.$user['battle'].'" LIMIT 1'));
@ -20,7 +24,7 @@ if(!isset($battle['id'])) {
echo "Персонаж не в игре!";
} else {
if($user['invis'] == 1) { $lod = '<i><b>невидимка</b></i>'; } else { $lod = Nick::id($user['id'])->short(); }
addlog($battle['id'], '<span class=date>'.date("H:i").'</span> '.$lod.' применил заклятие &quot;Поднять мертвого&quot;, и воскресил персонажа <b>'.$us['login'].'</b>!<BR>');
GameLogs::addBattleLog($battle['id'], '<span class=date>'.date("H:i").'</span> '.$lod.' применил заклятие &quot;Поднять мертвого&quot;, и воскресил персонажа <b>'.$us['login'].'</b>!<BR>');
mysql_query('UPDATE `users` SET `hp` = `maxhp` WHERE `id` = "'.$us['id'].'" LIMIT 1');
$vip['reamdeath'] -= 1;
mysql_query('UPDATE `abils_user` SET `reamdeath` = "'.$vip['reamdeath'].'" WHERE `id` = "'.$vip['id'].'" LIMIT 1');

View File

@ -1,4 +1,8 @@
<?php
use Battles\GameLogs;
use Battles\Nick;
if ($_SESSION['uid'] == null) {
header("Location: index.php");
exit;
@ -58,7 +62,7 @@ if ($user['battle'] == 0) {
$t1 = implode(";", $t1);
$t2 = implode(";", $t2);
addlog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' переманил клона ' . Nick::id($bot)->short() . ' на свою сторону.<BR>');
GameLogs::addBattleLog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' переманил клона ' . Nick::id($bot)->short() . ' на свою сторону.<BR>');
mysql_query('UPDATE `battle` SET `teams` = \'' . serialize($battle) . '\', `t1` = \'' . $t1 . '\', `t2` = \'' . $t2 . '\' WHERE `id` = "' . $user['battle'] . '" LIMIT 1');
mysql_query("UPDATE `battle` SET `to1` = '" . time() . "', `to2` = '" . time() . "' WHERE `id` = '" . $user['battle'] . "' LIMIT 1");
echo mysql_error();

View File

@ -1,4 +1,8 @@
<?php
use Battles\GameLogs;
use Battles\Nick;
$coma = [
"Покупайте чеснок!",
"Теперь на кровь остальные сбегутся.",
@ -154,7 +158,7 @@ if ($user['battle'] > 0) {
addch("<a href=logs.php?log=" . $id . " target=_blank>Бой</a> между <B><b>" . Nick::id($user['id'])->short() . "</b> и <b>" . Nick::id($us['id'])->short() . "</b> начался. ", $user->getRoom());
//mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}','Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>');");
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` = {$us['id']}");

View File

@ -167,7 +167,7 @@ if (isset($_GET['use'])) {
if ($obraz) {
User::$current->setShadow($obraz);
User::$current->saveShadow();
User::$current->saveUser();
}
if ($setShadow) {

View File

@ -1,4 +1,8 @@
<?php
use Battles\GameLogs;
use Battles\Nick;
require_once "functions.php";
if ($_GET['act'] == "atk") {
$ass = mysql_query("SELECT glav_id,glava,name FROM labirint WHERE user_id=" . $user['id'] . "");
@ -42,7 +46,7 @@ if ($_GET['act'] == "atk") {
$ttt = 2;
}
addlog($jert['battle'], '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' вмешался в поединок1!<BR>');
GameLogs::addBattleLog($jert['battle'], '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' вмешался в поединок1!<BR>');
mysql_query('UPDATE `battle` SET `teams` = \'' . serialize($battle) . '\', `t' . $ttt . '`=CONCAT(`t' . $ttt . '`,\';' . $user['id'] . '\') WHERE `id` = ' . $jert['battle'] . ' ;');
mysql_query("UPDATE users SET `battle` =" . $jert['battle'] . ",`zayavka`=0 WHERE `id`= " . $user['id']);
mysql_query("UPDATE `labirint` SET `boi`='" . $_GET['n'] . "',`di`='0' WHERE `user_id`='" . $user['id'] . "'");

View File

@ -1,4 +1,8 @@
<?php
use Battles\GameLogs;
use Battles\Nick;
function startpod($who, $bot, $nomer, $user)
{
$query = mysql_query("SELECT id FROM users WHERE login='$who'");
@ -202,7 +206,7 @@ function startpod($who, $bot, $nomer, $user)
mysql_query("UPDATE `bots` SET `battle` = {$id} WHERE `id` = {$bot} LIMIT 1;");
// создаем лог
$rr = "<b>" . Nick::id($user['id'])->full(1) . "</b> и <b>" . Nick::id($bot)->full(1) . "</b>";
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']};");
if ($name2 != '') {

View File

@ -1,5 +1,10 @@
<?php
use Battles\Chat;
use Battles\DressedItems;
use Battles\GameLogs;
use Battles\Nick;
use Battles\Template;
use Battles\User;
require_once "functions.php";
@ -131,7 +136,7 @@ if ($_POST['attack']) {
$ttt2 = 2;
}
addch("<b>" . Nick::id($user['id'])->short() . "</b> вмешался в <a href=logs.php?log=" . $id . " target=_blank>поединок »»</a>.", $user->getRoom());
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'] . '\'), `to' . $ttt . '` = \'' . time() . '\', `to' . $ttt2 . '` = \'' . (time() - 1) . '\' WHERE `id` = "' . $jert['battle'] . '" LIMIT 1');
mysql_query("UPDATE `users` SET `battle` = '" . $jert['battle'] . "', `zayavka` = 0 WHERE `id` = '" . $user['id'] . "' LIMIT 1");
mysql_query('UPDATE `deztow_turnir` SET `log` = CONCAT(`log`,\'' . "<span class=date>" . date("d.m.y H:i") . "</span> " . Nick::id($user['id'])->full(1) . " вмешался в поединок против " . Nick::id($jert['id'])->full(1) . " <a href=\"logs.php?log={$jert['battle']}\" target=_blank>»»</a><BR>" . '\') WHERE `active` = TRUE LIMIT 1');
@ -157,7 +162,7 @@ if ($_POST['attack']) {
$rr = "<b>" . Nick::id($user['id'])->full(1) . "</b> и <b>" . Nick::id($jert['id'])->full(1) . "</b>";
addch("<B><b>" . Nick::id($user['id'])->short() . "</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']})");
mysql_query('UPDATE `deztow_turnir` SET `log` = CONCAT(`log`,\'' . "<span class=date>" . date("d.m.y H:i") . "</span> " . Nick::id($user['id'])->full(1) . " напал на " . Nick::id($jert['id'])->full(1) . " завязался <a href=\"logs.php?log={$id}\" target=_blank>бой »»</a><BR>" . '\') WHERE `active` = TRUE LIMIT 1');
header("Location: fbattle.php");
@ -193,7 +198,7 @@ if ($rhar[$user->getRoom()][$_GET['path']] > 0 && $_GET['path'] < 5 && $_GET['pa
$list = mysql_query("SELECT * FROM `users` WHERE `in_tower` = 1 AND `battle` = 0");
while ($u = mysql_fetch_array($list)) {
if ($u['hp'] <= 0) {
\Battles\DressedItems::undressAllItems($u['id']);
DressedItems::undressAllItems($u['id']);
$rep = mysql_query("SELECT * FROM `inventory` WHERE `owner` = '" . $u['id'] . "' AND `bs` = 1");
while ($r = mysql_fetch_array($rep)) {
mysql_query("INSERT `deztow_items` (`iteam_id`, `name`, `img`, `room`) VALUES ('" . $r['prototype'] . "', '" . $r['name'] . "', '" . $r['img'] . "', '" . $u['room'] . "')");
@ -227,7 +232,7 @@ while ($u = mysql_fetch_array($list)) {
if (($kol_pl + $ls) < 2 && ($tur_data['start_time'] + 60) <= time()) {
$tur = mysql_fetch_array(mysql_query("SELECT * FROM `deztow_turnir` WHERE `active` = TRUE LIMIT 1"));
\Battles\DressedItems::undressAllItems($user['id']);
DressedItems::undressAllItems($user['id']);
$rep = mysql_query("SELECT * FROM `inventory` WHERE `owner` = '" . $user['id'] . "' AND `bs` = 1");
while ($r = mysql_fetch_array($rep)) {
mysql_query("INSERT `deztow_items` (`iteam_id`, `name`, `img`, `room`) VALUES ('" . $r['prototype'] . "', '" . $r['name'] . "', '" . $r['img'] . "', '" . $user->getRoom() . "');");
@ -247,7 +252,7 @@ if (($kol_pl + $ls) < 2 && ($tur_data['start_time'] + 60) <= time()) {
mysql_query('UPDATE `deztow_turnir` SET `winner` = \'' . $user['id'] . '\', `winnerlog` = \'' . Nick::id($user['id'])->full(1) . '\', `endtime` = \'' . time() . '\', `active` = FALSE, `log` = CONCAT(`log`,\'' . "<span class=date>" . date("d.m.y H:i") . "</span> Турнир завершен. Победитель : " . Nick::id($user['id'])->full(1) . " Приз : <b>" . $tur['coin'] . "</b> кр. <br />" . '\') WHERE `active` = TRUE LIMIT 1');
addchp('<font color=red>Внимание!</font> Поздравляем! Вы победитель турнира Башни смерти! Получаете <b>' . $tur['coin'] . '</b> кр.', '{[]}' . $user['login'] . '{[]}');
AddChatSystem('<font color=red>Внимание!</font> Битва в Башне Смерти завершена. Победитель : <b>' . $user['login'] . ' [' . $user['level'] . ']</b>');
Chat::addSYSMessage('Внимание! Битва в Башне Смерти завершена. Победитель:' . $user['login'] . ' [' . $user['level'] . ']');
if ($tur['art'] == 1) {
$bs_art = 0;
} else {
@ -268,7 +273,7 @@ if ($user['hp'] <= 0) {
header('Location: tower.php');
exit;
}
\Battles\Template::header('towerin');
Template::header('towerin');
?>
<script>
let Hint3Name = '';
@ -661,7 +666,7 @@ if ($user['hp'] <= 0) {
<script language="javascript" type="text/javascript">
const progressEnd = 32;
let progressColor = '#00CC00';
let mtime = parseInt('<?=($_SESSION["time"]-time())?>');
let mtime = parseInt('<?=($_SESSION["time"] - time())?>');
if (!mtime || mtime <= 0) {
mtime = 0;
}

View File

@ -22,13 +22,13 @@ if ($name || $hobbie) {
if ($hobbie) {
$user->setInfo($hobbie);
}
$user->saveAnketa();
$user->saveUser();
}
}
if ($oldpsw && $newpsw) {
if (password_verify($oldpsw, $user->getPass())) {
$user->setPass(password_hash($newpsw, PASSWORD_DEFAULT));
$user->savePass();
$user->saveUser();
} else {
err('Неверный текущий пароль!');
}

View File

@ -1,6 +1,8 @@
<?php
use Battles\Chat;
use Battles\DressedItems;
use Battles\GameLogs;
use Battles\Nick;
use Battles\Template;
@ -203,7 +205,7 @@ class Zayavka
return $this->errorMessage;
} else {
if ($type == 3) {
AddChatSystem('Внимание! Подана заявка на хаотический поединок ({$t1min} - {$t1max}), который начнется через {$start} минут.');
Chat::addSYSMessage("Внимание! Подана заявка на хаотический поединок ({$t1min} - {$t1max}), который начнется через {$start} минут.");
}
$start = time() + $start * 60;
@ -563,7 +565,7 @@ VALUES ("?s","?s",?i,?i,?i,"?s","?s",?i,?i,?i,?i)',
}
$rr .= "</b>";
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>");
foreach ($z['team1'] as $k => $v) {
if ($v < _BOTSEPARATOR_) {
@ -658,19 +660,19 @@ Template::header('zayavka');
}
if (!empty($_POST['back2'])) {
$z = $zay->getlist(2, null, $user->getZayavka());
AddChatSystem('Внимание!' . Nick::id($user->getId())->short() . ' отозвал заявку.');
Chat::addSYSMessage('Внимание!' . Nick::id($user->getId())->short() . ' отозвал заявку.');
echo $zay->delteam($user->getId(), $user->getZayavka(), 2);
}
if (!empty($_POST['cansel'])) {
$z = $zay->getlist(2, null, $user->getZayavka());
echo $zay->delteam($z[$user->getZayavka()]['team2'][0], $user->getZayavka(), 2);
AddChatSystem('Внимание!' . Nick::id($user->getId())->short() . ' отказался от поединка.');
Chat::addSYSMessage('Внимание!' . Nick::id($user->getId())->short() . ' отказался от поединка.');
}
if (!empty($_POST['confirm2']) && empty($user->getZayavka())) {
$z = $zay->getlist(2, null, $_REQUEST['gocombat']);
$toper = db::c()->query('SELECT `klan` FROM `users` WHERE `id` = ?i', $z[$_REQUEST['gocombat']]['team1'][0])->fetch_assoc();
if ($user->getClan() != $toper['klan'] || !$user->getClan()) {
AddChatSystem('Внимание!' . Nick::id($user->getId())->short() . ' принял заявку, нужно принять вызов или отказать.');
Chat::addSYSMessage('Внимание!' . Nick::id($user->getId())->short() . ' принял заявку, нужно принять вызов или отказать.');
}
echo $zay->addteam(2, 2);
echo "</b></font><BR>Ожидаем подтверждения боя. <input type=submit name=back2 value='Отозвать заявку'>";
@ -732,7 +734,7 @@ Template::header('zayavka');
$id = mysql_insert_id();
mysql_query("UPDATE `bots` SET `battle` = {$id} WHERE `id` = {$bot} LIMIT 1");
$rr = "<b>" . Nick::id($user->id)->full(1) . "</b> и <b>" . Nick::id($bot)->full(1) . "</b>";
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};");
exit("<script>location.href='fbattle.php';</script>");
}