dev #41
@ -9,23 +9,24 @@ require_once '../functions.php';
|
||||
|
||||
use Battles\Bank;
|
||||
use Battles\Database\DBPDO;
|
||||
use Battles\GameConfigs;
|
||||
use Battles\Moderation;
|
||||
use Battles\Nick;
|
||||
use Battles\Template;
|
||||
use Battles\User;
|
||||
|
||||
$user = $user ?? new User($_SESSION['uid']);
|
||||
if (!$user->getAdmin()) {
|
||||
header("HTTP/1.0 404 Not Found");
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_GET['sleep'])) {
|
||||
Moderation::muteChat($user->getId(), strtotime('15min'));
|
||||
}
|
||||
|
||||
if (isset($_POST['ldnick']) && isset($_POST['ldtext'])) {
|
||||
Moderation::addToUserLog($_POST['ldnick'], $_POST['ldtext'], $user->getId());
|
||||
$u = new User($_POST['ldnick']);
|
||||
Moderation::addToUserLog($u->getId(), $_POST['ldtext'], $user->getId());
|
||||
unset($u);
|
||||
}
|
||||
|
||||
if (isset($_POST['syschatmsg'])) {
|
||||
@ -72,7 +73,7 @@ UNREGCLANLIST;
|
||||
{
|
||||
$bank = new Bank($id);
|
||||
$this->db->execute('DELETE FROM clans WHERE status = 0 AND owner_id = ?', $id);
|
||||
$bank::setBankMoney($bank->getMoney() + Config::$clan_register_cost, $id);
|
||||
$bank::setBankMoney($bank->getMoney() + GameConfigs::CLAN_REGISTER_COST, $id);
|
||||
}
|
||||
};
|
||||
$unregisteredClans->db = new DBPDO();
|
||||
|
@ -38,7 +38,7 @@
|
||||
}
|
||||
if(!$kompl_har) $kompl_har=0;
|
||||
$explim=0;
|
||||
foreach(array_keys(Config::$exptable) as $k)
|
||||
foreach(array_keys(EXPTABLE) as $k)
|
||||
{
|
||||
if($k>=$ku['exp'])
|
||||
{
|
||||
@ -47,14 +47,14 @@
|
||||
}
|
||||
}
|
||||
$sum_stat=15;
|
||||
foreach(array_keys(Config::$exptable) as $k)
|
||||
foreach(array_keys(EXPTABLE) as $k)
|
||||
{
|
||||
if($k==$explim)
|
||||
break;
|
||||
else
|
||||
{
|
||||
$sum_stat+=Config::$exptable[$k][0];
|
||||
$sum_stat+=Config::$exptable[$k][2];
|
||||
$sum_stat+=EXPTABLE[$k][0];
|
||||
$sum_stat+=EXPTABLE[$k][2];
|
||||
}
|
||||
}
|
||||
$res=mysql_fetch_array(
|
||||
|
3
bank.php
3
bank.php
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Battles\Bank;
|
||||
use Battles\GameConfigs;
|
||||
use Battles\Rooms;
|
||||
use Battles\Template;
|
||||
use Battles\User;
|
||||
@ -75,5 +76,5 @@ Template::header('Банк');
|
||||
<input type="hidden" name="action" value="sendMoney">
|
||||
<input type="submit" value="Перевести кредиты">
|
||||
</form>
|
||||
<span class="wrap">Комиссия: <?= Config::$bank_commission * 100 ?>% от переводимой суммы, но не менее 1 кр.</span>
|
||||
<span class="wrap">Комиссия: <?= GameConfigs::BANK_COMISSION * 100 ?>% от переводимой суммы, но не менее 1 кр.</span>
|
||||
</div>
|
||||
|
14
cave.php
14
cave.php
@ -5,7 +5,7 @@ use Battles\Template;
|
||||
session_start();
|
||||
require_once 'functions.php';
|
||||
//require_once 'cave/cave_bots.php';
|
||||
|
||||
$userslots = ['sergi', 'kulon', 'perchi', 'weap', 'bron', 'r1', 'r2', 'r3', 'helm', 'shit', 'boots', 'rybax', 'plaw', 'm1', 'm2', 'm3', 'm4', 'm5', 'm6', 'm7', 'm8', 'm9', 'm10'];
|
||||
function cancarry($m, $u)
|
||||
{
|
||||
global $user;
|
||||
@ -204,7 +204,7 @@ function gotoroom($r, $redir = 1)
|
||||
|
||||
function redirectbyroom($r)
|
||||
{
|
||||
if (in_array($r, Config::$canalenters)) {
|
||||
if (in_array($r, CANAL_ENTERS)) {
|
||||
header("location: enter_cave.php");
|
||||
exit;
|
||||
}
|
||||
@ -286,7 +286,7 @@ function takeusage($x, $y)
|
||||
function makedeath()
|
||||
{
|
||||
global $user, $floor, $loses, $x, $y, $dir;
|
||||
$cavedata = Config::$cavedata ?? [];
|
||||
$cavedata = CAVE_DATA ?? [];
|
||||
if (!isset($cavedata[$user->getRoom()]['x' . $floor])) {
|
||||
$floor = 1;
|
||||
loadmap();
|
||||
@ -430,11 +430,11 @@ function loadmap()
|
||||
|
||||
function getslot($i, $user1 = 0)
|
||||
{
|
||||
global $user;
|
||||
global $user, $userslots;
|
||||
if (!$user1) {
|
||||
$user1 = $user;
|
||||
}
|
||||
foreach (Config::$userslots as $k => $v) {
|
||||
foreach ($userslots as $k => $v) {
|
||||
if ($user1[$v] == $i) {
|
||||
return $v;
|
||||
}
|
||||
@ -482,7 +482,7 @@ if (@$_GET['kill'] && $user['id'] == $user['caveleader'] && $_GET['kill'] != $us
|
||||
mysql_query("UPDATE `users` SET `room` = (`room`-1), `caveleader` = 0 WHERE `id` = '$v[user]' LIMIT 1");
|
||||
$r = mysql_query("SELECT `id`, `dressed` FROM `inventory` WHERE `owner` = '$v[user]' AND `dressed` = 1 AND `foronetrip` = 1");
|
||||
if (mysql_num_rows($r) > 0) {
|
||||
$usr = mysql_fetch_array(mysql_query("SELECT " . implode(",", Config::$userslots) . " FROM `users` WHERE `id` = '$v[user]'"));
|
||||
$usr = mysql_fetch_array(mysql_query("SELECT " . implode(",", $userslots) . " FROM `users` WHERE `id` = '$v[user]'"));
|
||||
}
|
||||
while ($rec = mysql_fetch_assoc($r)) {
|
||||
$slot = getslot($rec['id'], $usr);
|
||||
@ -737,7 +737,7 @@ if ($ambushes[$y * 2][$x * 2 - 2] && $map[$y * 2][$x * 2 - 1] == 0) {
|
||||
}
|
||||
|
||||
if ($ax && $ay && $user['hp'] > 0) {
|
||||
$cavedata = Config::$cavedata ?? [];
|
||||
$cavedata = CAVE_DATA ?? [];
|
||||
if (!($cavedata[$user->getRoom()]['x' . $floor] == $x && $cavedata[$user->getRoom()]['y' . $floor] == $y)) {
|
||||
if ($ax < $x) {
|
||||
$dir1 = 0;
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Battles\Bank;
|
||||
use Battles\GameConfigs;
|
||||
use Battles\Rooms;
|
||||
use Battles\Template;
|
||||
use Battles\User;
|
||||
@ -18,7 +19,7 @@ if ($clanFullName && $clanShortName && $clanInfo && !$userClan) {
|
||||
$eff = db::c()->query('SELECT 1 FROM users_effects WHERE type = 20 AND owner_id = ?i', $user->getId());
|
||||
$name_check = db::c()->query('SELECT owner_id FROM clans WHERE full_name = "?s" OR short_name = "?s"', $clanFullName, $clanShortName);
|
||||
$errorMessage = [];
|
||||
if (Config::$clan_register_lock) {
|
||||
if (GameConfigs::CLAN_REGISTER_LOCK) {
|
||||
$errorMessage[10] = 'Регистрация кланов закрыта! <BR>';
|
||||
}
|
||||
if ($user->getAlign()) {
|
||||
@ -27,7 +28,7 @@ if ($clanFullName && $clanShortName && $clanInfo && !$userClan) {
|
||||
if ($user->getClan()) {
|
||||
$errorMessage[1] = 'Вы уже состоите в клане!. <BR>';
|
||||
}
|
||||
if (Config::$clan_register_cost >= $userBank->getMoney()) {
|
||||
if (GameConfigs::CLAN_REGISTER_COST >= $userBank->getMoney()) {
|
||||
$errorMessage[2] = 'Не хватает денег на регистрацию клана. <BR>';
|
||||
}
|
||||
if (!$eff) {
|
||||
@ -39,7 +40,7 @@ if ($clanFullName && $clanShortName && $clanInfo && !$userClan) {
|
||||
if (!$errorMessage || $user->getAdmin()) {
|
||||
try {
|
||||
db::c()->query('INSERT INTO clans (owner_id, full_name, short_name, info) VALUES (?i,"?s","?s","?s")', $user->getId(), $clanFullName, $clanShortName, $clanInfo);
|
||||
$userBank->setMoney($userBank->getMoney() - Config::$clan_register_cost);
|
||||
$userBank->setMoney($userBank->getMoney() - GameConfigs::CLAN_REGISTER_COST);
|
||||
Battles\Bank::setBankMoney($userBank->getMoney(), $user->getId(), 'clanRegister');
|
||||
// Заглушка для отображения данных по только что зарегистрированному клану, когда запрос в базу в начале файла ещё не проходит.
|
||||
$userClan = new stdClass();
|
||||
|
@ -52,7 +52,7 @@ class Bank
|
||||
*/
|
||||
private function bankCommission(int $amount): int
|
||||
{
|
||||
$bankCommission = round($amount * Config::$bank_commission);
|
||||
$bankCommission = round($amount * GameConfigs::BANK_COMISSION);
|
||||
if ($bankCommission < 1) {
|
||||
return 1;
|
||||
} else {
|
||||
|
@ -2,11 +2,7 @@
|
||||
|
||||
|
||||
namespace Battles\Database;
|
||||
const DATABASE_HOST = '192.168.20.5';
|
||||
const DATABASE_NAME = 'battles';
|
||||
const DATABASE_USER = 'battles';
|
||||
const DATABASE_PASS = 'bottle-neck-horse';
|
||||
const DATABASE_PORT = '32101';
|
||||
use Battles\GameConfigs;
|
||||
use PDO, PDOException;
|
||||
class DBPDO
|
||||
{
|
||||
@ -37,9 +33,9 @@ class DBPDO
|
||||
{
|
||||
if (!$this->pdo) {
|
||||
|
||||
$dsn = 'mysql:dbname=' . DATABASE_NAME . ';host=' . DATABASE_HOST . ';port=' . DATABASE_PORT . ';charset=utf8;';
|
||||
$user = DATABASE_USER;
|
||||
$password = DATABASE_PASS;
|
||||
$dsn = 'mysql:dbname=' . GameConfigs::DATABASE_NAME . ';host=' . GameConfigs::DATABASE_HOST . ';port=' . GameConfigs::DATABASE_PORT . ';charset=utf8;';
|
||||
$user = GameConfigs::DATABASE_USER;
|
||||
$password = GameConfigs::DATABASE_PASS;
|
||||
|
||||
try {
|
||||
$this->pdo = new PDO($dsn, $user, $password, array(PDO::ATTR_PERSISTENT => true));
|
||||
@ -144,5 +140,4 @@ class DBPDO
|
||||
{
|
||||
return $this->pdo->lastInsertId();
|
||||
}
|
||||
|
||||
}
|
21
classes/Battles/GameConfigs.php
Normal file
21
classes/Battles/GameConfigs.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
# Date: 15.02.2021 (02:33)
|
||||
|
||||
namespace Battles;
|
||||
|
||||
|
||||
class GameConfigs
|
||||
{
|
||||
const DATABASE_HOST = '192.168.20.5';
|
||||
const DATABASE_NAME = 'battles';
|
||||
const DATABASE_USER = 'battles';
|
||||
const DATABASE_PASS = 'bottle-neck-horse';
|
||||
const DATABASE_PORT = '32101';
|
||||
const DATABASE_CHARSET = 'utf8';
|
||||
|
||||
const CLAN_REGISTER_COST = 10000;
|
||||
const CLAN_REGISTER_LOCK = true; // Запрет на регистрацию кланов.
|
||||
const BANK_COMISSION = 0.05; // 5%
|
||||
|
||||
const DB_SQLITE = '/volume2/web/battles/databases/logs.sqlite';
|
||||
}
|
@ -19,7 +19,7 @@ class GameLogs
|
||||
*/
|
||||
public static function addBankLog(int $senderId, int $receiverId, int $amount, string $type, string $text)
|
||||
{
|
||||
$db = new SQLite3(Config::$db_sqlite);
|
||||
$db = new SQLite3(GameConfigs::DB_SQLITE);
|
||||
$row = $db->prepare("INSERT INTO bank_logs (sender_id, receiver_id, amount, type, text) VALUES (?, ?, ?, ?, ?)");
|
||||
$row->bindParam(1, $senderId, SQLITE3_INTEGER);
|
||||
$row->bindParam(2, $receiverId, SQLITE3_INTEGER);
|
||||
@ -45,7 +45,7 @@ class GameLogs
|
||||
if (empty($type)) {
|
||||
$type = "system";
|
||||
}
|
||||
$db = new SQLite3(Config::$db_sqlite);
|
||||
$db = new SQLite3(GameConfigs::DB_SQLITE);
|
||||
$row = $db->prepare("INSERT INTO users_logs (user_id, author_id, type, text) VALUES (?,?,?,?)");
|
||||
$row->bindParam(1, $userId, SQLITE3_INTEGER);
|
||||
$row->bindParam(2, $authorId, SQLITE3_INTEGER);
|
||||
@ -57,7 +57,7 @@ class GameLogs
|
||||
|
||||
public static function getUserLogs($userId = null, $type = null): SQLite3Result
|
||||
{
|
||||
$db = new SQLite3(Config::$db_sqlite);
|
||||
$db = new SQLite3(GameConfigs::DB_SQLITE);
|
||||
|
||||
if ($userId && $type) {
|
||||
$query = "SELECT * FROM users_logs WHERE user_id = ? AND type = ?";
|
||||
|
@ -55,7 +55,9 @@ class User
|
||||
protected $maxMana = 5;
|
||||
protected static $db;
|
||||
|
||||
public function __construct(int $user)
|
||||
public const INFO_CHAR_LIMIT = 1500;
|
||||
|
||||
public function __construct($user)
|
||||
{
|
||||
self::$db = DBPDO::INIT();
|
||||
$user_query = self::$db->fetch('SELECT * FROM users WHERE id = ? OR login = ?', [$user, $user]);
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
if (in_array($user->getRoom(), Config::$caverooms)) {
|
||||
$cavedata = Config::$cavedata ?? [];
|
||||
if (in_array($user->getRoom(), CAVE_ROOMS)) {
|
||||
$cavedata = CAVE_DATA ?? [];
|
||||
$floor = mysql_fetch_row(mysql_query("SELECT `floor` FROM `caveparties` WHERE `user` = '$user[id]' LIMIT 1"));
|
||||
if (!isset($cavedata[$user->getRoom()]['x' . $floor])) {
|
||||
$floor = 1;
|
||||
@ -11,7 +11,7 @@ $lomka1 = $lomka;
|
||||
|
||||
foreach ($lomka1 as $k => $v) {
|
||||
if ($v < _BOTSEPARATOR_) {
|
||||
if (in_array($user->getRoom(), Config::$caverooms)) {
|
||||
if (in_array($user->getRoom(), CAVE_ROOMS)) {
|
||||
mysql_query("UPDATE `caveparties` SET `floor` = $floor, `x` = '" . $cavedata[$user->getRoom()]['x' . $floor] . "', `y` = '" . $cavedata[$user->getRoom()]['y' . $floor] . "', `dir` = '" . $cavedata[$user->getRoom()]['dir' . $floor] . "', `loses` = (`loses`+1) WHERE `user` = '$v' LIMIT 1");
|
||||
}
|
||||
if ($user['laba'] > 0) {
|
||||
|
@ -21,7 +21,7 @@ function cavesys($text)
|
||||
}
|
||||
}
|
||||
|
||||
if (in_array($user->getRoom(), Config::$caverooms)) {
|
||||
if (in_array($user->getRoom(), CAVE_ROOMS)) {
|
||||
include("CaveItems.php");
|
||||
mysql_query('LOCK TABLES `cavebots` WRITE, `caveitems` WRITE, `shop` WRITE, `caveparties` WRITE');
|
||||
$location = mysql_fetch_array(mysql_query("SELECT `x`, `y`, `dir`, `floor` FROM `caveparties` WHERE `user` = '$user[id]' LIMIT 1"));
|
||||
|
@ -1,4 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Battles\GameConfigs;
|
||||
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: lopiu
|
||||
@ -20,11 +23,16 @@ class db
|
||||
{
|
||||
if (!self::$_instance)
|
||||
{
|
||||
self::$_instance = Krugozor\Database\Mysql\Mysql::create("192.168.20.5", "battles", "bottle-neck-horse", 32101)
|
||||
self::$_instance = Krugozor\Database\Mysql\Mysql::create(
|
||||
GameConfigs::DATABASE_HOST,
|
||||
GameConfigs::DATABASE_USER,
|
||||
GameConfigs::DATABASE_PASS,
|
||||
GameConfigs::DATABASE_PORT
|
||||
)
|
||||
// Выбор базы данных
|
||||
->setDatabaseName("battles")
|
||||
->setDatabaseName(GameConfigs::DATABASE_NAME)
|
||||
// Выбор кодировки
|
||||
->setCharset("utf8");
|
||||
->setCharset(GameConfigs::DATABASE_CHARSET);
|
||||
}
|
||||
return self::$_instance;
|
||||
}
|
||||
|
@ -1700,7 +1700,7 @@ class fbattle
|
||||
}
|
||||
|
||||
|
||||
if (in_array($user->getRoom(), Config::$caverooms)) {
|
||||
if (in_array($user->getRoom(), CAVE_ROOMS)) {
|
||||
$location = mysql_fetch_array(mysql_query("SELECT `x`, `y`, `dir` FROM `caveparties` WHERE `user` = '" . $this->user['id'] . "' LIMIT 1"));
|
||||
|
||||
if ($location['dir'] == 0) {
|
||||
@ -1805,7 +1805,7 @@ class fbattle
|
||||
|
||||
function addAction($time, $vars, $vls, $uid)
|
||||
{
|
||||
$ins = mysql_query('INSERT INTO `actions` (`uid`, `time`, `city`, `room`, `vars`, `ip`, `vals`) VALUES ("' . $uid . '", "' . $time . '", "capitalcity", "0", "' . mysql_real_escape_string($vars) . '", "' . mysql_real_escape_string($_SERVER['HTTP_X_REAL_IP']) . '", "' . mysql_real_escape_string($vls) . '")');
|
||||
$ins = mysql_query('INSERT INTO `actions` (`uid`, `time`, `city`, `room`, `vars`, `ip`, `vals`) VALUES ("' . $uid . '", "' . $time . '", "capitalcity", "0", "' . mysql_real_escape_string($vars) . '", "' . $_SERVER['REMOTE_ADDR'] . '", "' . mysql_real_escape_string($vls) . '")');
|
||||
if ($ins) {
|
||||
return true;
|
||||
} else {
|
||||
|
177
config.php
177
config.php
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* Конфиг системных настроек.
|
||||
* Copyright (c) 2018.
|
||||
* Author: Igor Barkov <lopar.4ever@gmail.com>
|
||||
* Project name: Battles-Game
|
||||
@ -35,38 +36,36 @@ spl_autoload_register(function ($className) {
|
||||
}
|
||||
});
|
||||
|
||||
trait Config
|
||||
{
|
||||
public static $db_sqlite = '/volume2/web/battles/databases/logs.sqlite';
|
||||
// Для нападалок. Сперва комнаты в которых нельзя напасть, потом персонажи на которых нельзя напасть.
|
||||
public static $unkilable = [
|
||||
// Для нападалок. Сперва комнаты в которых нельзя напасть, потом персонажи на которых нельзя напасть.
|
||||
const UNKILABLE = [
|
||||
'rooms' => [620, 621, 1051, 1052],
|
||||
'users' => [10962, 10964, 10965],
|
||||
];
|
||||
// Неизвестная херня.
|
||||
public static $canalenters = [620];
|
||||
public static $caverooms = [621];
|
||||
public static $userslots = ['sergi', 'kulon', 'perchi', 'weap', 'bron', 'r1', 'r2', 'r3', 'helm', 'shit', 'boots', 'rybax', 'plaw', 'm1', 'm2', 'm3', 'm4', 'm5', 'm6', 'm7', 'm8', 'm9', 'm10'];
|
||||
// Что-то связанное с магией.
|
||||
public static $elem_align = [
|
||||
"a" => ["a" => "1", "e" => "0", "f" => "0.5", "w" => "0.5"],
|
||||
"e" => ["a" => "0", "e" => "1", "f" => "0.5", "w" => "0.5"],
|
||||
"f" => ["a" => "0.5", "e" => "0.5", "f" => "1", "w" => "0"],
|
||||
"w" => ["a" => "0.5", "e" => "0.5", "f" => "0", "w" => "1"],
|
||||
];
|
||||
public static $elem_bonus = [
|
||||
"a" => ["a" => "1", "e" => "0.75", "f" => "1.25", "w" => "1"],
|
||||
"e" => ["a" => "1.25", "e" => "1", "f" => "1", "w" => "0.75"],
|
||||
"f" => ["a" => "0.75", "e" => "1", "f" => "1", "w" => "1.25"],
|
||||
"w" => ["a" => "1", "e" => "1.25", "f" => "0.75", "w" => "1"],
|
||||
];
|
||||
//Для кланов
|
||||
public static $clan_register_cost = 10000; //стоимость
|
||||
public static $clan_register_lock = 1; //запрет на регистрацию
|
||||
//Банк
|
||||
public static $bank_commission = 0.05; //5%
|
||||
// Старая таблица опыта
|
||||
public static $exptable = [
|
||||
];
|
||||
|
||||
// Кажется, для пещер.
|
||||
const CANAL_ENTERS = [620];
|
||||
const CAVE_ROOMS = [621];
|
||||
const CAVE_DATA = [
|
||||
621 => [
|
||||
'x1' => 6,
|
||||
'y1' => 11,
|
||||
'dir1' => 1,
|
||||
'x2' => 10,
|
||||
'y2' => 8,
|
||||
'dir2' => 1,
|
||||
'x3' => 20,
|
||||
'y3' => 4,
|
||||
'dir3' => 1,
|
||||
'x4' => 10,
|
||||
'y4' => 10,
|
||||
'dir4' => 1,
|
||||
'delay' => 360,
|
||||
'name1' => 'Проклятый Рудник',
|
||||
'name2' => 'Проклятого Рудника'
|
||||
],
|
||||
];
|
||||
|
||||
const EXPTABLE = [
|
||||
0 => [0, 0, 0, 0, 0, 20],
|
||||
20 => [1, 0, 0, 0, 0, 45],
|
||||
45 => [1, 0, 0, 2, 0, 75],
|
||||
@ -99,120 +98,4 @@ trait Config
|
||||
4200 => [1, 0, 0, 40, 0, 4600],
|
||||
4600 => [1, 0, 0, 50, 0, 5000],
|
||||
5000 => [3, 1, 1, 80, 1, 6000], # Это пятый уровень
|
||||
|
||||
6000 => [1, 0, 0, 15, 0, 7000],
|
||||
7000 => [1, 0, 0, 30, 0, 8000],
|
||||
8000 => [1, 0, 0, 40, 0, 9000],
|
||||
9000 => [1, 0, 0, 50, 0, 10000],
|
||||
10000 => [1, 0, 0, 40, 0, 11000],
|
||||
11000 => [1, 0, 0, 50, 0, 12000],
|
||||
12000 => [1, 0, 0, 60, 0, 12500],
|
||||
12500 => [3, 1, 1, 90, 1, 14000], # Это шестой уровень
|
||||
|
||||
14000 => [1, 0, 0, 20, 0, 15500],
|
||||
15500 => [1, 0, 0, 30, 0, 17000],
|
||||
17000 => [1, 0, 0, 50, 0, 19000],
|
||||
19000 => [1, 0, 0, 55, 0, 21000],
|
||||
21000 => [1, 0, 0, 50, 0, 23000],
|
||||
23000 => [1, 0, 0, 55, 0, 27000],
|
||||
27000 => [1, 0, 0, 50, 0, 30000],
|
||||
30000 => [5, 1, 1, 100, 1, 60000], # Это седьмой уровень
|
||||
|
||||
60000 => [1, 0, 0, 100, 0, 75000],
|
||||
75000 => [1, 0, 0, 100, 0, 150000],
|
||||
150000 => [1, 0, 0, 150, 0, 175000],
|
||||
175000 => [1, 0, 0, 50, 0, 200000],
|
||||
200000 => [1, 0, 0, 100, 0, 225000],
|
||||
225000 => [1, 0, 0, 50, 0, 250000],
|
||||
250000 => [1, 0, 0, 100, 0, 260000],
|
||||
260000 => [1, 0, 0, 50, 0, 280000],
|
||||
280000 => [1, 0, 0, 100, 0, 300000],
|
||||
300000 => [5, 1, 1, 700, 1, 1500000], # Это восьмой уровень
|
||||
|
||||
1500000 => [1, 0, 0, 500, 0, 1750000],
|
||||
1750000 => [1, 0, 0, 200, 0, 2000000],
|
||||
2000000 => [1, 0, 0, 300, 0, 2175000],
|
||||
2175000 => [1, 0, 0, 100, 0, 2300000],
|
||||
2300000 => [1, 0, 0, 100, 0, 2400000],
|
||||
2400000 => [1, 0, 0, 100, 0, 2500000],
|
||||
2500000 => [1, 0, 0, 200, 0, 2600000],
|
||||
2600000 => [1, 0, 0, 100, 0, 2800000],
|
||||
2800000 => [1, 0, 0, 200, 0, 3000000],
|
||||
3000000 => [5, 1, 2, 1000, 1, 6000000], # Это девятый уровень
|
||||
|
||||
6000000 => [1, 0, 0, 200, 0, 6500000],
|
||||
6500000 => [1, 0, 0, 250, 0, 7500000],
|
||||
7500000 => [1, 0, 0, 200, 0, 8500000],
|
||||
8500000 => [1, 0, 0, 250, 0, 9000000],
|
||||
9000000 => [1, 0, 0, 400, 0, 9250000],
|
||||
9250000 => [1, 0, 0, 250, 0, 9500000],
|
||||
9500000 => [1, 0, 0, 400, 0, 9750000],
|
||||
9750000 => [1, 0, 0, 350, 0, 9900000],
|
||||
9900000 => [1, 0, 0, 500, 0, 10000000],
|
||||
10000000 => [9, 1, 3, 2000, 1, 13000000], # Это десятый уровень
|
||||
|
||||
13000000 => [2, 0, 0, 200, 0, 14000000],
|
||||
14000000 => [2, 0, 0, 200, 0, 15000000],
|
||||
15000000 => [2, 0, 0, 200, 0, 16000000],
|
||||
16000000 => [2, 0, 0, 200, 0, 17000000],
|
||||
17000000 => [2, 0, 0, 200, 0, 17500000],
|
||||
17500000 => [2, 0, 0, 200, 0, 18000000],
|
||||
18000000 => [2, 0, 0, 200, 0, 19000000],
|
||||
19000000 => [2, 0, 0, 200, 0, 19500000],
|
||||
19500000 => [2, 0, 0, 200, 0, 20000000],
|
||||
20000000 => [2, 0, 0, 250, 0, 30000000],
|
||||
30000000 => [2, 0, 0, 200, 0, 32000000],
|
||||
32000000 => [2, 0, 0, 250, 0, 34000000],
|
||||
34000000 => [2, 0, 0, 200, 0, 35000000],
|
||||
35000000 => [2, 0, 0, 250, 0, 36000000],
|
||||
36000000 => [2, 0, 0, 200, 0, 38000000],
|
||||
38000000 => [2, 0, 0, 250, 0, 40000000],
|
||||
40000000 => [2, 0, 0, 200, 0, 42000000],
|
||||
42000000 => [2, 0, 0, 250, 0, 44000000],
|
||||
44000000 => [2, 0, 0, 350, 0, 47000000],
|
||||
47000000 => [2, 0, 0, 300, 0, 50000000],
|
||||
50000000 => [2, 0, 0, 350, 0, 52000000],
|
||||
52000000 => [10, 1, 3, 3000, 1, 58000000], # Это одиннадцатый уровень
|
||||
|
||||
58000000 => [1, 0, 0, 350, 0, 65000000],
|
||||
65000000 => [1, 0, 0, 300, 0, 72000000],
|
||||
72000000 => [1, 0, 0, 350, 0, 77000000],
|
||||
77000000 => [1, 0, 0, 350, 0, 82000000],
|
||||
82000000 => [1, 0, 0, 300, 0, 87000000],
|
||||
87000000 => [1, 0, 0, 350, 0, 92000000],
|
||||
92000000 => [1, 0, 0, 350, 0, 100000000],
|
||||
100000000 => [1, 0, 0, 350, 0, 120000000],
|
||||
120000000 => [2, 0, 0, 400, 0, 140000000],
|
||||
140000000 => [2, 0, 0, 400, 0, 160000000],
|
||||
160000000 => [2, 0, 0, 600, 0, 180000000],
|
||||
180000000 => [2, 0, 0, 400, 0, 210000000],
|
||||
210000000 => [2, 0, 0, 400, 0, 240000000],
|
||||
240000000 => [10, 2, 4, 5000, 1, 260000000], # Это двеннадцатый уровень
|
||||
|
||||
260000000 => [2, 0, 0, 400, 0, 320000000],
|
||||
320000000 => [2, 0, 0, 400, 0, 400000000],
|
||||
400000000 => [3, 0, 0, 600, 0, 455000000],
|
||||
455000000 => [2, 0, 0, 150, 0, 510000000],
|
||||
510000000 => [2, 0, 0, 100, 0, 600000000],
|
||||
600000000 => [2, 0, 0, 300, 0, 750000000],
|
||||
750000000 => [5, 0, 0, 700, 0, 770000000],
|
||||
770000000 => [1, 0, 0, 400, 0, 815000000],
|
||||
815000000 => [1, 0, 0, 200, 0, 860000000],
|
||||
860000000 => [1, 0, 0, 600, 0, 1000000000],
|
||||
1000000000 => [1, 0, 0, 300, 0, 1100000000],
|
||||
1100000000 => [1, 0, 0, 450, 0, 1250000000],
|
||||
1250000000 => [1, 0, 0, 450, 0, 1500000000],
|
||||
1500000000 => [10, 1, 5, 8000, 1, 9999999999], # Это тринадцатый уровень
|
||||
];
|
||||
public static $cavedata = [621 => ['x1' => 6, 'y1' => 11, 'dir1' => 1, 'x2' => 10, 'y2' => 8, 'dir2' => 1, 'x3' => 20, 'y3' => 4, 'dir3' => 1, 'x4' => 10, 'y4' => 10, 'dir4' => 1, 'delay' => 360, 'name1' => 'Проклятый Рудник', 'name2' => 'Проклятого Рудника']];
|
||||
|
||||
//DB
|
||||
protected static $db = [
|
||||
'host' => '192.168.20.5',
|
||||
'name' => 'battles',
|
||||
'user' => 'battles',
|
||||
'password' => 'bottle-neck-horse',
|
||||
'port' => 32101,
|
||||
'charset' => 'utf8',
|
||||
];
|
||||
}
|
||||
];
|
@ -421,7 +421,7 @@ class fbattle
|
||||
addActions(time(), 'win_fiz', 0, $this->user['id']);
|
||||
}
|
||||
|
||||
if (in_array($user->getRoom(), Config::$caverooms)) {
|
||||
if (in_array($user->getRoom(), CAVE_ROOMS)) {
|
||||
$location = mysql_fetch_array(mysql_query("SELECT `x`, `y`, `dir` FROM `caveparties` WHERE `user` = '" . $this->user['id'] . "' LIMIT 1"));
|
||||
if ($location['dir'] == 0) {
|
||||
$y = $location['y'] * 2;
|
||||
@ -451,7 +451,7 @@ class fbattle
|
||||
$winers .= implode("</B>, <B>", $this->t2);
|
||||
$lomka = $this->t1;
|
||||
} else {
|
||||
if (in_array($user->getRoom(), Config::$caverooms)) {
|
||||
if (in_array($user->getRoom(), CAVE_ROOMS)) {
|
||||
$location = mysql_fetch_array(mysql_query("SELECT `x`, `y`, `dir` FROM `caveparties` WHERE `user` = '" . $this->user['id'] . "' LIMIT 1"));
|
||||
if ($location['dir'] == 0) {
|
||||
$y = $location['y'] * 2;
|
||||
@ -1063,7 +1063,7 @@ class fbattle
|
||||
if ($uid == NULL) {
|
||||
$uid = $this->user['id'];
|
||||
}
|
||||
$ins = mysql_query('INSERT INTO `actions` (`uid`, `time`, `city`, `room`, `vars`, `ip`, `vals`) VALUES ("' . $uid . '", "' . $time . '", "capitalcity", "0", "' . mysql_real_escape_string($vars) . '", "' . mysql_real_escape_string($_SERVER['HTTP_X_REAL_IP']) . '", "' . mysql_real_escape_string($vls) . '")');
|
||||
$ins = mysql_query('INSERT INTO `actions` (`uid`, `time`, `city`, `room`, `vars`, `ip`, `vals`) VALUES ("' . $uid . '", "' . $time . '", "capitalcity", "0", "' . mysql_real_escape_string($vars) . '", "' . $_SERVER['REMOTE_ADDR'] . '", "' . mysql_real_escape_string($vls) . '")');
|
||||
return $ins;
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ if ($_GET['ext'] == 1) {
|
||||
}
|
||||
|
||||
|
||||
if (in_array($user->getRoom(), Config::$canalenters)) {
|
||||
if (in_array($user->getRoom(), CANAL_ENTERS)) {
|
||||
$podzemroom = $user->getRoom() + 1;
|
||||
$cavedata = [620 => ['x1' => 3, 'y1' => 2, 'dir1' => 2]];
|
||||
$podzemdata = [621 => ['name1' => 'Проклятый Рудник', 'name2' => 'Проклятого Рудника']];
|
||||
@ -308,7 +308,7 @@ if (in_array($user->getRoom(), Config::$canalenters)) {
|
||||
}
|
||||
|
||||
$den = mysql_query("SELECT `id` FROM `vxodd` WHERE `glav_id` = '" . $_GET['naw_id'] . "'");
|
||||
if (mysql_num_rows($den) >= (in_array($user->getRoom() + 1, Config::$caverooms) ? 5 : 4)) {
|
||||
if (mysql_num_rows($den) >= (in_array($user->getRoom() + 1, CAVE_ROOMS) ? 5 : 4)) {
|
||||
echo "<script>location.href='?warning=5'</script>";
|
||||
exit();
|
||||
}
|
||||
@ -356,7 +356,7 @@ if (in_array($user->getRoom(), Config::$canalenters)) {
|
||||
}
|
||||
|
||||
if ($_GET['start']) {
|
||||
if (in_array($user->getRoom() + 1, Config::$caverooms)) {
|
||||
if (in_array($user->getRoom() + 1, CAVE_ROOMS)) {
|
||||
$nc = 1;
|
||||
$locs = [];
|
||||
}
|
||||
@ -391,7 +391,7 @@ if (in_array($user->getRoom(), Config::$canalenters)) {
|
||||
mysql_query('INSERT INTO `visit_podzem` (`login`, `time`, `room`) VALUES ("' . $n_login . '", "' . $vremya . '", \'' . $podzemroom . '\')');
|
||||
$vrem = 30 * 60 + time();
|
||||
|
||||
$cavedata = Config::$cavedata ?? [];
|
||||
$cavedata = CAVE_DATA ?? [];
|
||||
mysql_query("INSERT INTO `caveparties` SET `user` = '$esth[id]', `leader` = '$user[id]', `login` = '$esth[login]', `shadow` = '0.png', `x` = '" . $cavedata[$user->getRoom() + 1]['x1'] . "', `y` = '" . $cavedata[$user->getRoom() + 1]['y1'] . "', `dir` = '" . $cavedata[$user->getRoom() + 1]['dir1'] . "', `floor` = 1");
|
||||
mysql_query("UPDATE `users`, `online` SET " . ($nc ? "`users`.`caveleader` = '$user[id]', " : "") . " `users`.`room` = '" . ($user->getRoom() + 1) . "', `online`.`room` = '" . ($user->getRoom() + 1) . "' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '" . $esth['id'] . "'");
|
||||
}
|
||||
|
@ -16,11 +16,11 @@ if (empty($_SESSION['uid'])) {
|
||||
} else {
|
||||
$user = new User($_SESSION['uid']);
|
||||
}
|
||||
|
||||
if ($user->getId() && $user->getBlock()) {
|
||||
exit('user blocked!');
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Проверки на соответствие скрипта и комнаты, которые были натыканы по всем файлам.
|
||||
*/
|
||||
@ -209,13 +209,13 @@ 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 (Config::$exptable[$us['nextup']][4] == 1) {
|
||||
if (EXPTABLE[$us['nextup']][4] == 1) {
|
||||
addch("Персонаж <b>{$us['login']}</b> перешел на " . ($us['level'] + 1) . " уровень.");
|
||||
addchp('<span class=\'success\'>Внимание!</span> Вы перешли на новый уровень. За это Вы получаете: ' . Config::$exptable[$us['nextup']][3] . ' кр.', '{[]}' . $us['login'] . '{[]}');
|
||||
addchp('<span class=\'success\'>Внимание!</span> Вы перешли на новый уровень. За это Вы получаете: ' . EXPTABLE[$us['nextup']][3] . ' кр.', '{[]}' . $us['login'] . '{[]}');
|
||||
}
|
||||
$us['nextup'] = Config::$exptable[$us['nextup']][5];
|
||||
$us['stats'] += Config::$exptable[$us['nextup']][0];
|
||||
$us['master'] += Config::$exptable[$us['nextup']][1];
|
||||
$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']);
|
||||
}
|
||||
|
@ -234,7 +234,13 @@ if ($_GET['lib_room'] == 'hall' || !$_GET['lib_room']) {
|
||||
break;
|
||||
}
|
||||
echo "<br/>Эффективность магии:";
|
||||
foreach (Config::$elem_align as $k => $ea) {
|
||||
$elem_align = [
|
||||
'a' => ['a' => '1', 'e' => '0', 'f' => '0.5', 'w' => '0.5'],
|
||||
'e' => ['a' => '0', 'e' => '1', 'f' => '0.5', 'w' => '0.5'],
|
||||
'f' => ['a' => '0.5', 'e' => '0.5', 'f' => '1', 'w' => '0'],
|
||||
'w' => ['a' => '0.5', 'e' => '0.5', 'f' => '0', 'w' => '1'],
|
||||
];
|
||||
foreach ($elem_align as $k => $ea) {
|
||||
switch ($k) {
|
||||
case 'a':
|
||||
echo "<br/><font color=#0198ef>Воздух</font>";
|
||||
|
@ -24,9 +24,9 @@ if ($user['battle'] > 0) {
|
||||
echo "Бой закрыт для вмешательства!";
|
||||
} elseif (!$us['online']) {
|
||||
echo "Персонаж не в игре!";
|
||||
} elseif(in_array($us['room'], Config::$unkilable['rooms'])) {
|
||||
} elseif(in_array($us['room'], UNKILABLE['rooms'])) {
|
||||
echo "В данной комнате запрещены нападения ...";
|
||||
} elseif(in_array($us['id'], Config::$unkilable['users'])) {
|
||||
} elseif(in_array($us['id'], UNKILABLE['users'])) {
|
||||
echo "Персонаж под защитой от нападений ...";
|
||||
} elseif(isset($effect['id'])) {
|
||||
echo "Персонаж под защитой от нападений ...";
|
||||
|
@ -16,9 +16,9 @@ if($vip['bloodattack'] <= 0) {
|
||||
echo "Запрещено входить в хаотический бой!";
|
||||
} elseif($us['battle'] > 0 && $us_b['open'] == 0) {
|
||||
echo "Бой закрыт для вмешательства!";
|
||||
} elseif(in_array($us['room'], Config::$unkilable['rooms'])) {
|
||||
} elseif(in_array($us['room'], UNKILABLE['rooms'])) {
|
||||
echo "В данной комнате запрещены нападения ...";
|
||||
} elseif(in_array($us['id'], Config::$unkilable['users'])) {
|
||||
} elseif(in_array($us['id'], UNKILABLE['users'])) {
|
||||
echo "Персонаж под защитой от нападений ...";
|
||||
} elseif(isset($effect['id'])) {
|
||||
echo "Персонаж под защитой от нападений ...";
|
||||
|
@ -21,9 +21,9 @@ elseif (!$us['online']) {
|
||||
echo "Запрещено входить в хаотический бой!";
|
||||
} elseif ($us['battle']>0 && $us_b['open']==0) {
|
||||
echo "Бой закрыт для вмешательства!";
|
||||
} elseif(in_array($us['room'], Config::$unkilable['rooms'])) {
|
||||
} elseif(in_array($us['room'], UNKILABLE['rooms'])) {
|
||||
echo "В данной комнате запрещены нападения ...";
|
||||
} elseif(in_array($us['id'], Config::$unkilable['users'])) {
|
||||
} elseif(in_array($us['id'], UNKILABLE['users'])) {
|
||||
echo "Персонаж под защитой от нападений ...";
|
||||
} elseif(isset($effect['id'])) {
|
||||
echo "Персонаж под защитой от нападений ...";
|
||||
|
@ -17,9 +17,9 @@ if ($user['battle'] > 0) {
|
||||
echo "Бой закрыт для вмешательства!";
|
||||
} elseif ($user['zayavka'] > 0) {
|
||||
echo "Вы ожидаете поединка...";
|
||||
} elseif(in_array($jert['room'], Config::$unkilable['rooms'])) {
|
||||
} elseif(in_array($jert['room'], UNKILABLE['rooms'])) {
|
||||
echo "В данной комнате запрещены нападения ...";
|
||||
} elseif(in_array($jert['id'], Config::$unkilable['users'])) {
|
||||
} elseif(in_array($jert['id'], UNKILABLE['users'])) {
|
||||
echo "Персонаж под защитой от нападений ...";
|
||||
} elseif(isset($effect['id'])) {
|
||||
echo "Персонаж под защитой от нападений ...";
|
||||
|
@ -24,9 +24,9 @@ if ($user['battle'] > 0) {
|
||||
echo "Бой закрыт для вмешательства!";
|
||||
} elseif ($user['zayavka'] > 0) {
|
||||
echo "Вы ожидаете поединка...";
|
||||
} elseif (in_array($us['room'], Config::$unkilable['rooms'])) {
|
||||
} elseif (in_array($us['room'], UNKILABLE['rooms'])) {
|
||||
echo "В данной комнате запрещены нападения ...";
|
||||
} elseif (in_array($us['id'], Config::$unkilable['users'])) {
|
||||
} elseif (in_array($us['id'], UNKILABLE['users'])) {
|
||||
echo "Персонаж под защитой от нападений ...";
|
||||
} elseif (isset($effect['id'])) {
|
||||
echo "Персонаж под защитой от нападений ...";
|
||||
|
@ -31,9 +31,9 @@ elseif (!$us['online']) {
|
||||
echo "Не атакуйте Администратора!";
|
||||
} elseif ($user['zayavka'] > 0) {
|
||||
echo "Вы ожидаете поединка...";
|
||||
} elseif(in_array($us['room'], Config::$unkilable['rooms'])) {
|
||||
} elseif(in_array($us['room'], UNKILABLE['rooms'])) {
|
||||
echo "В данной комнате запрещены нападения ...";
|
||||
} elseif(in_array($us['id'], Config::$unkilable['users'])) {
|
||||
} elseif(in_array($us['id'], UNKILABLE['users'])) {
|
||||
echo "Персонаж под защитой от нападений ...";
|
||||
} elseif(isset($effect['id'])) {
|
||||
echo "Персонаж под защитой от нападений ...";
|
||||
|
@ -29,9 +29,9 @@ if ($user['battle'] > 0) {
|
||||
echo "Персонаж защищен от кулачного нападения!";
|
||||
} elseif ($us['align']==2.99) {
|
||||
echo "Не атакуйте Администратора!";
|
||||
} elseif(in_array($us['room'], Config::$unkilable['rooms'])) {
|
||||
} elseif(in_array($us['room'], UNKILABLE['rooms'])) {
|
||||
echo "В данной комнате запрещены нападения ...";
|
||||
} elseif(in_array($us['id'], Config::$unkilable['users'])) {
|
||||
} elseif(in_array($us['id'], UNKILABLE['users'])) {
|
||||
echo "Персонаж под защитой от нападений ...";
|
||||
} elseif(isset($effect['id'])) {
|
||||
echo "Персонаж под защитой от нападений ...";
|
||||
|
@ -31,9 +31,9 @@ elseif (!$us['online']) {
|
||||
echo "Бой закрыт для вмешательства!";
|
||||
} elseif ($us['align']==2.99) {
|
||||
echo "Не атакуйте Администратора!";
|
||||
} elseif(in_array($us['room'], Config::$unkilable['rooms'])) {
|
||||
} elseif(in_array($us['room'], UNKILABLE['rooms'])) {
|
||||
echo "В данной комнате запрещены нападения ...";
|
||||
} elseif(in_array($us['id'], Config::$unkilable['users'])) {
|
||||
} elseif(in_array($us['id'], UNKILABLE['users'])) {
|
||||
echo "Персонаж под защитой от нападений ...";
|
||||
} elseif(isset($effect['id'])) {
|
||||
echo "Персонаж под защитой от нападений ...";
|
||||
|
@ -36,9 +36,9 @@ elseif ($user['zayavka'] > 0) {
|
||||
echo "Вы ожидаете поединка...";
|
||||
} elseif ($owntravma['id'] && !$us['battle']) {
|
||||
echo "Персонаж тяжело травмирован...";
|
||||
} elseif(in_array($us['room'], Config::$unkilable['rooms'])) {
|
||||
} elseif(in_array($us['room'], UNKILABLE['rooms'])) {
|
||||
echo "В данной комнате запрещены нападения ...";
|
||||
} elseif(in_array($us['id'], Config::$unkilable['users'])) {
|
||||
} elseif(in_array($us['id'], UNKILABLE['users'])) {
|
||||
echo "Персонаж под защитой от нападений ...";
|
||||
} elseif(isset($effect['id'])) {
|
||||
echo "Персонаж под защитой от нападений ...";
|
||||
|
@ -36,9 +36,9 @@ elseif ($user['zayavka'] > 0) {
|
||||
echo "Вы ожидаете поединка...";
|
||||
} elseif ($owntravma['id'] && !$us['battle']) {
|
||||
echo "Персонаж тяжело травмирован...";
|
||||
} elseif(in_array($us['room'], Config::$unkilable['rooms'])) {
|
||||
} elseif(in_array($us['room'], UNKILABLE['rooms'])) {
|
||||
echo "В данной комнате запрещены нападения ...";
|
||||
} elseif(in_array($us['id'], Config::$unkilable['users'])) {
|
||||
} elseif(in_array($us['id'], UNKILABLE['users'])) {
|
||||
echo "Персонаж под защитой от нападений ...";
|
||||
} elseif(isset($effect['id'])) {
|
||||
echo "Персонаж под защитой от нападений ...";
|
||||
|
@ -16,9 +16,9 @@ if($vip['attack'] <= 0) {
|
||||
echo "Запрещено входить в хаотический бой!";
|
||||
} elseif($us['battle'] > 0 && $us_b['open'] == 0) {
|
||||
echo "Бой закрыт для вмешательства!";
|
||||
} elseif(in_array($us['room'], Config::$unkilable['rooms'])) {
|
||||
} elseif(in_array($us['room'], UNKILABLE['rooms'])) {
|
||||
echo "В данной комнате запрещены нападения ...";
|
||||
} elseif(in_array($us['id'], Config::$unkilable['users'])) {
|
||||
} elseif(in_array($us['id'], UNKILABLE['users'])) {
|
||||
echo "Персонаж под защитой от нападений ...";
|
||||
} elseif(isset($effect['id'])) {
|
||||
echo "Персонаж под защитой от нападений ...";
|
||||
|
@ -16,9 +16,9 @@ if($vip['bloodattack'] <= 0) {
|
||||
echo "Запрещено входить в хаотический бой!";
|
||||
} elseif($us['battle'] > 0 && $us_b['open'] == 0) {
|
||||
echo "Бой закрыт для вмешательства!";
|
||||
} elseif(in_array($us['room'], Config::$unkilable['rooms'])) {
|
||||
} elseif(in_array($us['room'], UNKILABLE['rooms'])) {
|
||||
echo "В данной комнате запрещены нападения ...";
|
||||
} elseif(in_array($us['id'], Config::$unkilable['users'])) {
|
||||
} elseif(in_array($us['id'], UNKILABLE['users'])) {
|
||||
echo "Персонаж под защитой от нападений ...";
|
||||
} elseif(isset($effect['id'])) {
|
||||
echo "Персонаж под защитой от нападений ...";
|
||||
|
@ -14,9 +14,9 @@ if($vip['attack'] <= 0) {
|
||||
echo "Не в бою...";
|
||||
} elseif($us_b['type'] == 3 || $us_b['type'] == 5) {
|
||||
echo "Запрещено входить в хаотический бой!";
|
||||
} elseif(in_array($us['room'], Config::$unkilable['rooms'])) {
|
||||
} elseif(in_array($us['room'], UNKILABLE['rooms'])) {
|
||||
echo "В данной комнате запрещены нападения ...";
|
||||
} elseif(in_array($us['id'], Config::$unkilable['users'])) {
|
||||
} elseif(in_array($us['id'], UNKILABLE['users'])) {
|
||||
echo "Персонаж под защитой от нападений ...";
|
||||
} elseif(isset($effect['id'])) {
|
||||
echo "Персонаж под защитой от нападений ...";
|
||||
|
@ -16,9 +16,9 @@ if($vip['bloodattack'] <= 0) {
|
||||
echo "Запрещено входить в хаотический бой!";
|
||||
} elseif($us['battle'] > 0 && $us_b['open'] == 0) {
|
||||
echo "Бой закрыт для вмешательства!";
|
||||
} elseif(in_array($us['room'], Config::$unkilable['rooms'])) {
|
||||
} elseif(in_array($us['room'], UNKILABLE['rooms'])) {
|
||||
echo "В данной комнате запрещены нападения ...";
|
||||
} elseif(in_array($us['id'], Config::$unkilable['users'])) {
|
||||
} elseif(in_array($us['id'], UNKILABLE['users'])) {
|
||||
echo "Персонаж под защитой от нападений ...";
|
||||
} elseif(isset($effect['id'])) {
|
||||
echo "Персонаж под защитой от нападений ...";
|
||||
|
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
use Battles\Template;
|
||||
use Battles\User;
|
||||
|
||||
session_start();
|
||||
require_once 'functions.php';
|
||||
define('INFO_CHAR_LIMIT', 1500);
|
||||
$name = filter_input(INPUT_POST, 'name', FILTER_SANITIZE_STRING);
|
||||
$oldpsw = filter_input(INPUT_POST, 'oldpsw', FILTER_SANITIZE_SPECIAL_CHARS);
|
||||
$newpsw = filter_input(INPUT_POST, 'newpsw', FILTER_SANITIZE_SPECIAL_CHARS);
|
||||
@ -14,21 +14,9 @@ $hobbie = str_replace("\\n", "<br />", $hobbie);
|
||||
$hobbie = str_replace("\\r", "", $hobbie);
|
||||
$hobbie = str_replace("<br />", "<br />", $hobbie);
|
||||
|
||||
if ($name || $color || $hobbie) {
|
||||
switch ($color) {
|
||||
case 1:
|
||||
$color = 'blue';
|
||||
break;
|
||||
case 2:
|
||||
$color = 'green';
|
||||
break;
|
||||
default:
|
||||
$color = 'black';
|
||||
break;
|
||||
}
|
||||
|
||||
if (strlen($hobbie) > INFO_CHAR_LIMIT) {
|
||||
err('Максимальная длинна поля Хобби: ' . INFO_CHAR_LIMIT . ' символов!');
|
||||
if ($name || $hobbie) {
|
||||
if (strlen($hobbie) > User::INFO_CHAR_LIMIT) {
|
||||
err('Максимальная длинна поля Хобби: ' . User::INFO_CHAR_LIMIT . ' символов!');
|
||||
} else {
|
||||
$values = ['realname' => $name, 'color' => $color, 'info' => $hobbie];
|
||||
db::c()->query('UPDATE users SET ?As WHERE id = ?i', $values, $user->getId());
|
||||
|
Loading…
Reference in New Issue
Block a user