Merge pull request 'dev-lopar-chat-fixes' (#43) from dev-lopar-chat-fixes into dev

Reviewed-on: new-combats.com/game#43
This commit is contained in:
Ivor Barhansky 2023-02-02 15:43:10 +00:00
commit 395153f291
14 changed files with 632 additions and 633 deletions

View File

@ -3728,11 +3728,13 @@ class Battle
);
if (isset($a['id'])) {
if ($a['eda'] < 1) {
$u->send(
'', $this->users[$i]['room'], $this->users[$i]['city'], '',
$this->users[$i]['login'], '<strong>' . $a['name'] . '</strong> нуждается в еде...',
time(), 6, 0, 0, 0, 1
);
$cmsg = new ChatMessage();
$cmsg->setRoom($this->users[$i]['room']);
$cmsg->setCity($this->users[$i]['city']);
$cmsg->setTo($this->users[$i]['login']);
$cmsg->setText('<strong>' . $a['name'] . '</strong> нуждается в еде...');
$cmsg->setType(6);
$chat->sendMsg($cmsg);
}
}
}

View File

@ -108,20 +108,17 @@ class Chat
text,
time,
type,
toChat,
spam,
invis,
da,
`delete`,
global,
molch,
nosee,
typeTime,
dn,
frv
) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)';
$args = [
$chatMessage->getNew(),
1,
$chatMessage->getSound(),
$chatMessage->getColor(),
$chatMessage->getCity(),
@ -131,14 +128,11 @@ class Chat
$chatMessage->getText(),
$chatMessage->getTime(),
$chatMessage->getType(),
$chatMessage->getToChat(),
$chatMessage->getSpam(),
$chatMessage->getInvis(),
$chatMessage->getDa(),
$chatMessage->getDelete(),
$chatMessage->getGlobal(),
$chatMessage->getMolch(),
$chatMessage->getNosee(),
$chatMessage->getTypeTime(),
$chatMessage->getDn(),
$chatMessage->getFireworks(),

View File

@ -1,11 +1,10 @@
<?php
#todo êàæåòñÿ ÷àñòü ïîëåé âðîäå city, room, color, invis íàïðÿìèê çàâèñèò îò login (îòïðàâèòåëü)
#todo åñëè ýòî òàê, ÷àñòüþ ñåòòåðîâ ìîæíî áóäåò ïîæåðòâîâàòü.
#todo кажется часть полей вроде city, room, color, invis напрямик зависит от login (отправитель)
#todo если это так, частью сеттеров можно будет пожертвовать.
class ChatMessage
{
private int $new = 1;
private string $city = 'capitalcity';
private int $room = 0;
private string $login = '';
@ -13,7 +12,6 @@ class ChatMessage
private string $text;
private int $time = 0;
private int $type = 0;
private int $toChat = 0;
private int $typeTime = 0;
private string $color = '#000';
private int $sound = 0;
@ -21,13 +19,11 @@ class ChatMessage
private bool $isAlert = false;
private int $invis = 0;
private int $da = 0;
private int $nosee = 0;
private int $delete = 0;
private int $molch = 0;
private int $global = 0;
private int $dn = 0;
/**
* Ôååðâåðêè, ÷¸ðò ïîäåðè!
* Феерверки, чёрт подери!
* _incl_data\class\magic\feerverks.php
* @var string|null
*/
@ -49,22 +45,6 @@ class ChatMessage
$this->dn = $dn;
}
/**
* @return int
*/
public function getGlobal(): int
{
return $this->global;
}
/**
* @param int $global
*/
public function setGlobal(int $global): void
{
$this->global = $global;
}
/**
* @return int
*/
@ -97,22 +77,6 @@ class ChatMessage
$this->molch = $molch;
}
/**
* @return int
*/
public function getNosee(): int
{
return $this->nosee;
}
/**
* @param int $nosee
*/
public function setNosee(int $nosee): void
{
$this->nosee = $nosee;
}
/**
* @return int
*/
@ -178,14 +142,6 @@ class ChatMessage
$this->sound = $sound;
}
/**
* @return int
*/
public function getNew(): int
{
return $this->new;
}
/**
* @return string
*/
@ -224,7 +180,7 @@ class ChatMessage
public function getText(): string
{
if ($this->isAlert) {
return '<span style="color: red">Âíèìàíèå!</span>&nbsp;' . $this->text;
return '<span style="color: red">Внимание!</span>&nbsp;' . $this->text;
}
return $this->text;
}
@ -248,14 +204,6 @@ class ChatMessage
return $this->type;
}
/**
* @return int
*/
public function getToChat(): int
{
return $this->toChat;
}
/**
* @return int
*/
@ -271,16 +219,6 @@ class ChatMessage
return $this->color;
}
/**
* @param int $new
*/
public function setNew(int $new): void
{
if ($new !== 1) {
$this->new = $new;
}
}
/**
* @param string $city
*/
@ -337,14 +275,6 @@ class ChatMessage
$this->type = $type;
}
/**
* @param int $toChat
*/
public function setToChat(int $toChat): void
{
$this->toChat = $toChat;
}
/**
* @param int $typeTime
*/
@ -362,7 +292,7 @@ class ChatMessage
}
/**
* Äîáàâëÿåò ê ñîîáùåíèþ êðàñíûé ïðåôèêñ "Âíèìàíèå!".
* Добавляет к сообщению красный префикс "Внимание!".
* @param bool $isAlert
*/
public function setIsAlert(bool $isAlert): void
@ -387,7 +317,7 @@ class ChatMessage
}
/**
* Çàãëóøêà äëÿ îïöèîíàëüíîé ïåðåäà÷è ïàðàìåòðîâ.
* Заглушка для опциональной передачи параметров.
* @param string $json
* @return void
*/
@ -395,8 +325,9 @@ class ChatMessage
{
$params = json_decode($json, true);
foreach ($params as $param => $value) {
if (property_exists($this, $param)) {
$this->$param = $value;
$method = 'set' . ucfirst($param);
if (method_exists(self::class, $method)) {
$this->$method($value);
}
}
}

View File

@ -211,7 +211,6 @@ class GameDealer
$chatDto->setTo($user['login']);
$chatDto->setText($r);
$chatDto->setType(5);
$chatDto->setTime(-1);
(new Chat())->sendMsg($chatDto);
} else {
$this->BACK = [['gdanswer', [['status', '-1'], ['desc', 'У пользователя отсутствует банк'], ['id', $this->c['id']]]]];

View File

@ -2506,10 +2506,13 @@ class Magic
}
} else {
$u->send(
'', $u->info['room'], $u->info['city'], '', $u->info['login'],
'<b>' . $a['name'] . '</b> нуждается в еде...', time(), 6, 0, 0, 0, 1
);
$cmsg = new ChatMessage();
$cmsg->setRoom($u->info['room']);
$cmsg->setCity($u->info['city']);
$cmsg->setTo($u->info['login']);
$cmsg->setText('<strong>' . $a['name'] . '</strong> нуждается в еде...');
$cmsg->setType(6);
(new Chat())->sendMsg($cmsg);
}
}
}

View File

@ -880,7 +880,6 @@ class Quests
$chatDto->setTo($u->info['login']);
$chatDto->setText($r);
$chatDto->setType(5);
$chatDto->setTime(-1);
(new Chat())->sendMsg($chatDto);
return $r;
@ -1003,7 +1002,6 @@ class Quests
$chatDto->setTo($u->info['login']);
$chatDto->setText($r);
$chatDto->setType(5);
$chatDto->setTime(-1);
(new Chat())->sendMsg($chatDto);
}
}

View File

@ -11198,61 +11198,6 @@ LIMIT 1'
return $rt;
}
/**
* Уродец, дублирующий Chat то тут то там.
* Сидишь, никого не трогаешь, правишь и вдруг класс User тебя с размаху мордой в грязь!
* Привет пачка вызовов буквально отовсюду, потому что класс User это же так удобно, класс User он же везде...
* @param string $color
* @param int $room
* @param string $city
* @param string $from
* @param string $to
* @param string $text
* @param int $time
* @param int $type
* @param int $toChat
* @param int $spam
* @param int $sound
* @param int $new
* @param int $typeTime
* @param int $global
* @deprecated
* @todo убрать нахуй заменив нативными вызовами.
*/
public function send(
string $color,
int $room,
string $city,
string $from,
string $to,
string $text,
int $time,
int $type,
int $toChat,
int $spam,
int $sound,
int $new = 1,
int $typeTime = 0,
int $global = 0
) {
$cmsg = new ChatMessage();
$cmsg->setColor($color);
$cmsg->setCity($city);
$cmsg->setRoom($room);
$cmsg->setLogin($from);
$cmsg->setTo($to);
$cmsg->setText($text);
$cmsg->setTime($time);
$cmsg->setType($type);
$cmsg->setToChat($toChat);
$cmsg->setSpam($spam);
$cmsg->setSound($sound);
$cmsg->setNew($new);
$cmsg->setTypeTime($typeTime);
$cmsg->setGlobal($global);
(new Chat())->sendMsg($cmsg);
}
//получаем уровень
public function testLevel()
{
@ -11322,6 +11267,12 @@ LIMIT 1'
}
$i = 0;
$ult = 0;
$sex1 = '';
if ($this->info['sex'] == 1) {
$sex1 = 'ла';
}
while ($i != 1) {
if (Config::get('nolevel') && $this->info['exp'] >= $lvl['exp'] && isset($lvln['upLevel'])) {
$tlus = mysql_fetch_array(
@ -11338,7 +11289,9 @@ LIMIT 1'
);
}
}
if ($this->info['exp'] >= $lvl['exp'] && isset($lvln['upLevel'])) {
if ($this->info['exp'] < $lvl['exp'] || !isset($lvln['upLevel'])) {
$i = 1;
} else {
if ($lvl['nextLevel'] > $this->info['level']) {
//повышаем выносливость
$a4 = 1;
@ -11353,11 +11306,6 @@ LIMIT 1'
}
$this->stats['s4'] += $a4;
$sex1 = '';
if ($this->info['sex'] == 1) {
$sex1 = 'ла';
}
$ult = 1;
//Рефералы
@ -11404,6 +11352,12 @@ LIMIT 1'
}
}
$cmsg = new ChatMessage();
$cmsg->setRoom($this->info['room']);
$cmsg->setCity($this->info['city']);
$cmsg->setTo($rlog['login']);
$cmsg->setType(6);
if (($rtg || !isset($mtest['id'])) && isset($rlog['id'])) {
$rfs['data'] = explode('|', $rlogs['ref_data']);
$ekr = '0.00';
@ -11420,23 +11374,22 @@ LIMIT 1'
$rlog['id']
) . '" LIMIT 1'
);
if ($up) {
//Реферал 1-го уровня
$krtxt = '';
if ($kr > 0) {
$krtxt .= '' . $kr . ' КР';
if ($ekr > 0) {
$krtxt .= ', ';
}
$krtxt .= "$kr КР";
}
if ($ekr > 0) {
$krtxt .= '' . $ekr . ' ЕКР';
$krtxt .= ", $ekr ЕКР";
}
$this->send(
'', $this->info['room'], $this->info['city'], '', $rlog['login'],
'Ваш реферал <strong>' . $this->info['login'] . '</strong> достиг' . $sex1 . ' уровня ' . $lvl['nextLevel'] . '! Вам зачисленно ' . $krtxt,
-1, 6, 0, 0, 0, 1
$cmsg->setText(
'Ваш реферал <strong>' . $this->info['login'] . '</strong> достиг' . $sex1 . ' уровня ' . $lvl['nextLevel'] . '! Вам зачисленно ' . $krtxt
);
(new Chat())->sendMsg($cmsg);
$rlog['catch'] += $bn['add_bank'];
mysql_query(
'UPDATE `users` SET `catch` = "' . $rlog['catch'] . '" WHERE `id` = "' . $rlog['id'] . '" LIMIT 1'
@ -11455,20 +11408,17 @@ LIMIT 1'
if (isset($rlog['id'])) {
$krtxt = '';
if ($kr > 0) {
$krtxt .= '' . $kr . ' КР';
if ($ekr > 0) {
$krtxt .= ', ';
}
$krtxt .= "$kr КР";
}
if ($ekr > 0) {
$krtxt .= '' . $ekr . ' ЕКР';
$krtxt .= ", $ekr ЕКР";
}
$this->send(
'', $this->info['room'], $this->info['city'], '',
$rlog['login'],
'Ваш реферал <strong>' . $this->info['login'] . '</strong> (2-го уровня от &quot;' . $llogin . '&quot; ) достиг' . $sex1 . ' уровня ' . $lvl['nextLevel'] . '! Вам зачисленно ' . $krtxt,
-1, 6, 0, 0, 0, 1
$cmsg->setText(
'Ваш реферал <strong>' . $this->info['login'] . '</strong> (2-го уровня от &quot;' . $llogin . '&quot; ) достиг' . $sex1 . ' уровня ' . $lvl['nextLevel'] . '! Вам зачисленно ' . $krtxt
);
(new Chat())->sendMsg($cmsg);
$rlog['catch'] += $bn['add_bank'];
mysql_query(
'UPDATE `users` SET `money` = `money` + ' . $kr . ',`money2` = `money2` + ' . $ekr . ' WHERE `id` = "' . $rlog['id'] . '" LIMIT 1'
@ -11487,20 +11437,17 @@ LIMIT 1'
if (isset($rlog['id'])) {
$krtxt = '';
if ($kr > 0) {
$krtxt .= '' . $kr . ' КР';
if ($ekr > 0) {
$krtxt .= ', ';
}
$krtxt .= "$kr КР";
}
if ($ekr > 0) {
$krtxt .= '' . $ekr . ' ЕКР';
$krtxt .= ", $ekr ЕКР";
}
$this->send(
'', $this->info['room'], $this->info['city'], '',
$rlog['login'],
'Ваш реферал <strong>' . $this->info['login'] . '</strong> (3-го уровня от &quot;' . $llogin2 . '&quot; (Реферал ' . $llogin . ') ) достиг' . $sex1 . ' уровня ' . $lvl['nextLevel'] . '! Вам зачисленно ' . $krtxt,
-1, 6, 0, 0, 0, 1
$cmsg->setText(
'Ваш реферал <strong>' . $this->info['login'] . '</strong> (3-го уровня от &quot;' . $llogin2 . '&quot; (Реферал ' . $llogin . ') ) достиг' . $sex1 . ' уровня ' . $lvl['nextLevel'] . '! Вам зачисленно ' . $krtxt
);
(new Chat())->sendMsg($cmsg);
$rlog['catch'] += $bn['add_bank'];
mysql_query(
'UPDATE `users` SET `money` = `money` + ' . $kr . ',`money2` = `money2` + ' . $ekr . ' WHERE `id` = "' . $rlog['id'] . '" LIMIT 1'
@ -11512,11 +11459,10 @@ LIMIT 1'
}
}
} else {
$this->send(
'', $this->info['room'], $this->info['city'], '', $rlog['login'],
'Ваш реферал <strong>' . $this->info['login'] . '</strong> достиг' . $sex1 . ' уровня ' . $lvl['nextLevel'] . '! (Ошибка зачисления, обратитесь с Администрации проекта) На Ваш банковский счет №' . $bnk . ' зачисленно ' . $ekr . ' кр.',
-1, 6, 0, 0, 0, 1
$cmsg->setText(
'Ваш реферал <strong>' . $this->info['login'] . '</strong> достиг' . $sex1 . ' уровня ' . $lvl['nextLevel'] . '! (Ошибка зачисления, обратитесь с Администрации проекта) На Ваш банковский счет №' . $bnk . ' зачисленно ' . $ekr . ' кр.'
);
(new Chat())->sendMsg($cmsg);
}
}
//
@ -11527,11 +11473,10 @@ LIMIT 1'
);
//
} elseif (isset($rlog['id'])) {
$this->send(
'', $this->info['room'], $this->info['city'], '', $rlog['login'],
'Ваш реферал <strong>' . $this->info['login'] . '</strong> достиг' . $sex1 . ' уровня ' . $lvl['nextLevel'] . '! <small><font color=red>(Персонаж не активирован, либо у вас совпадают IP! Разрешено не более 1 такого реферала!)</font></small>',
-1, 6, 0, 0, 0, 1
$cmsg->setText(
'Ваш реферал <strong>' . $this->info['login'] . '</strong> достиг' . $sex1 . ' уровня ' . $lvl['nextLevel'] . '! <small style="color: red">(Персонаж не активирован, либо у вас совпадают IP! Разрешено не более 1 такого реферала!)</small>'
);
(new Chat())->sendMsg($cmsg);
}
}
}
@ -11559,27 +11504,28 @@ LIMIT 1'
);
$this->info['upLevel'] += 1;
$rt++;
} else {
$i = 1;
}
}
if ($ult == 1) {
$chat = new Chat();
$cmsg = new ChatMessage();
$cmsg->setRoom($this->info['room']);
$cmsg->setCity($this->info['city']);
$cmsg->setType(6);
if ($this->info['level'] == 4 || $this->info['level'] == 8) {
//Убрать задержки на пещеры
mysql_query(
'DELETE FROM `actions` WHERE `uid` = "' . $this->info['id'] . '" AND `vars` LIKE "psh%"'
);
$this->send(
'', $this->info['room'], $this->info['city'], '', $this->info['login'],
'Обязательно используйте свитки и эликсиры в своем инвентаре!!!!!!!!!!!!!!!.', -1, 6, 0, 0,
0, 1
);
$cmsg->setTo($this->info['login']);
$cmsg->setText('Обязательно используйте свитки и эликсиры в своем инвентаре!!!!!!!!!!!!!!!.');
$chat->sendMsg($cmsg);
}
$this->send(
'', $this->info['room'], $this->info['city'], '', '',
'<strong>' . $this->info['login'] . '</strong> достиг' . $sex1 . ' уровня ' . $this->info['level'] . '!',
time(), 6, 0, 0, 0, 1, 2
); // Наверно тут
$cmsg->setTypeTime(2);
$cmsg->setText('<strong>' . $this->info['login'] . '</strong> достиг' . $sex1 . ' уровня ' . $this->info['level'] . '!');
$chat->sendMsg($cmsg);
}
if ($rt > 0) {
$this->info['stopexp'] = 0;
@ -11650,11 +11596,13 @@ LIMIT 1'
)
);
$a['stats'] = $a['stats']['stats'];
$this->send(
'', $this->info['room'], $this->info['city'], '', $this->info['login'],
'<strong>' . $a['name'] . '</strong> достиг ' . $a['level'] . ' уровня!', time(), 6, 0,
0, 0, 1
);
$cmsg = new ChatMessage();
$cmsg->setRoom($this->info['room']);
$cmsg->setCity($this->info['city']);
$cmsg->setTo($this->info['login']);
$cmsg->setText('<strong>' . $a['name'] . '</strong> достиг ' . $a['level'] . ' уровня!');
$cmsg->setType(6);
(new Chat())->sendMsg($cmsg);
mysql_query(
'UPDATE `users_animal` SET `stats` = "' . $a['stats'] . '",`level`="' . $a['level'] . '",`max_exp`="' . $a['max_exp'] . '" WHERE `id` = "' . $a['id'] . '" LIMIT 1'
);

View File

@ -1,51 +1,65 @@
<?
if( isset($s[1]) && $s[1] == '106/door3' ) {
<?php
if (isset($s[1]) && $s[1] == '106/door3') {
/*
Сундук: Кровавый подземник (4561)
*/
//Все переменные сохранять в массиве $vad !
$vad = array(
'go' => true
$vad = [
'go' => true,
];
mysql_query(
'INSERT INTO `dungeon_actions` (`dn`,`time`,`x`,`y`,`uid`,`vars`,`vals`) VALUES (
"' . $u->info['dnow'] . '","' . time(
) . '","' . $obj['x'] . '","' . $obj['y'] . '","' . $u->info['id'] . '","obj_act' . $obj['id'] . '","' . $vad['bad'] . '"
)'
);
if( $vad['go'] == true ) {
mysql_query('INSERT INTO `dungeon_actions` (`dn`,`time`,`x`,`y`,`uid`,`vars`,`vals`) VALUES (
"'.$u->info['dnow'].'","'.time().'","'.$obj['x'].'","'.$obj['y'].'","'.$u->info['id'].'","obj_act'.$obj['id'].'","'.$vad['bad'].'"
)');
$vad['qst'] = mysql_fetch_array(mysql_query('SELECT * FROM `dialog_act` WHERE `uid` = "'.$u->info['id'].'" AND `var` = "noobqst1" AND `val` = 1 LIMIT 1'));
$vad['itm'] = mysql_fetch_array(mysql_query('SELECT * FROM `items_users` WHERE `uid` = "'.$u->info['id'].'" AND (`item_id` = 724 OR `item_id` = 4704) LIMIT 1'));
if(!isset($vad['qst']['id']) || !isset($vad['itm']['id'])) {
$r = 'Дверь закрыта. Сначала выполните задания Учителя и купите Футболку с Эликсиром.';
}else{
//Начало обучения
$humor = array(
0 => array(
':maniac: Сильно не бейте ;)',':beggar: Будет попрошайничать - бейте!',':pal: Возможно светлый!',
':vamp: Возможно темный!',':susel: Судя по здоровенному бицепсу - это мужик!',':duel: И сразу же кинулся в бой!',
':friday: Не долго думав он начал искать собутыльника!',':doc: Лекарь: Новичок! Да, да! Ты! Если тебя сломают - у знахаря тебя соберут обратно!'
),
1 => array(
':maniac: Помните! Девочек не бьем ;)',':nail: Она красит ногти, не отвлекайте все сразу ;)',':pal: Возможно светлая!',
':vamp: Возможно темная!',':rev: Судя по красивой одежде - это женщина!',':hug: И сразу же кинулась всех целовать!',
':angel2: Ангел сошел с небес...'
$vad['qst'] = mysql_fetch_array(
mysql_query(
'SELECT * FROM `dialog_act` WHERE `uid` = "' . $u->info['id'] . '" AND `var` = "noobqst1" AND `val` = 1 LIMIT 1'
)
);
$vad['itm'] = mysql_fetch_array(
mysql_query(
'SELECT * FROM `items_users` WHERE `uid` = "' . $u->info['id'] . '" AND (`item_id` = 724 OR `item_id` = 4704) LIMIT 1'
)
);
if (!isset($vad['qst']['id']) || !isset($vad['itm']['id'])) {
$r = 'Дверь закрыта. Сначала выполните задания Учителя и купите Футболку с Эликсиром.';
} else {
//Начало обучения
$humor = [
0 => [
':maniac: Сильно не бейте ;)', ':beggar: Будет попрошайничать - бейте!', ':pal: Возможно светлый!',
':vamp: Возможно темный!', ':susel: Судя по здоровенному бицепсу - это мужик!', ':duel: И сразу же кинулся в бой!',
':friday: Не долго думав он начал искать собутыльника!', ':doc: Лекарь: Новичок! Да, да! Ты! Если тебя сломают - у знахаря тебя соберут обратно!',
],
1 => [
':maniac: Помните! Девочек не бьем ;)', ':nail: Она красит ногти, не отвлекайте все сразу ;)', ':pal: Возможно светлая!',
':vamp: Возможно темная!', ':rev: Судя по красивой одежде - это женщина!', ':hug: И сразу же кинулась всех целовать!',
':angel2: Ангел сошел с небес...',
],
];
$humor = $humor[$u->info['sex']];
//$u->info['fnq'] = 1;
//mysql_query('UPDATE `users` SET `fnq` = "'.$u->info['fnq'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
//Отправляем сообщение в чат о новичке
mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$u->info['id'].'" AND `delete` = 0 AND `item_id` = 4703');
mysql_query('UPDATE `users` SET `room` = 4 WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
mysql_query('UPDATE `stats` SET `hpNow` = 1000,`mpNow` = 1000,`dn` = 0 , `dnow` = 0 , `x` = 0 , `y` = 0 , `s` = 0 WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
$u->send('','','','','','В нашем мире появился новый игрок &quot;<b>' . $u->info['login'] . '</b>&quot;! '.$humor[rand(0,count($humor)-1)].'',time(),6,0,0,0,1,0);
//mysql_query('UPDATE `stats` SET `x` = 0,`y` = 5 WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
mysql_query(
'UPDATE `items_users` SET `delete` = "' . time(
) . '" WHERE `uid` = "' . $u->info['id'] . '" AND `delete` = 0 AND `item_id` = 4703'
);
mysql_query('UPDATE `users` SET `room` = 4 WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
mysql_query(
'UPDATE `stats` SET `hpNow` = 1000,`mpNow` = 1000,`dn` = 0 , `dnow` = 0 , `x` = 0 , `y` = 0 , `s` = 0 WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'
);
array_shift($humor);
$cmsg = new ChatMessage();
$cmsg->setText('В нашем мире появился новый игрок &quot;<b>' . $u->info['login'] . '</b>&quot;! ' . $humor[0]);
$cmsg->setType(6);
(new Chat())->sendMsg($cmsg);
header('location: main.php');
die();
}
}
unset($vad);
}
?>

View File

@ -41,7 +41,6 @@ if ($u->info['login'] == $usr['login']) {
$chatDto->setTo($usr['login']);
$chatDto->setText("Персонаж <b>{$u->info['login']}</b> украл у вас эффект {$eff['name']}.");
$chatDto->setType(6);
$chatDto->setTime(-1);
(new Chat())->sendMsg($chatDto);
$chatDto = new ChatMessage();

View File

@ -76,7 +76,6 @@ if ($needle == $sign) {
$chatDto->setRoom($user['room']);
$chatDto->setTo($user['login']);
$chatDto->setText($r);
$chatDto->setTime(-1);
$chatDto->setType(5);
(new Chat())->sendMsg($chatDto);
@ -103,7 +102,6 @@ if ($needle == $sign) {
$chatDto->setRoom($referal['room']);
$chatDto->setTo($referal['login']);
$chatDto->setText($r);
$chatDto->setTime(-1);
$chatDto->setType(5);
(new Chat())->sendMsg($chatDto);
}

View File

@ -347,11 +347,13 @@ if (isset($_GET['usemod'])) {
}
}
if (isset($_POST['tologin'], $_POST['message'])) {
$u->send(
'', 1, $infcity, '', htmlspecialchars($_POST['tologin'], null),
'<font color=darkblue>Сообщение телеграфом от </font> <b>' . $u->info['login'] . '</b>: ' . $_POST['message'] . '',
-1, 6, 0, 0, 0, 1
);
$cmsg = new ChatMessage();
$cmsg->setRoom(1);
$cmsg->setCity($infcity);
$cmsg->setTo($_POST['tologin']);
$cmsg->setText('<span style="color: darkblue; ">Сообщение телеграфом от </span> <b>' . $u->info['login'] . '</b>: ' . $_POST['message']);
$cmsg->setType(6);
(new Chat())->sendMsg($cmsg);
}
?>
<table>

View File

@ -1,71 +1,84 @@
<?
if(!defined('GAME')){
<?php
if (!defined('GAME')) {
die();
}
if($u->room['file']=='an/bk'){
if ($u->room['file'] == 'an/bk') {
$tst = mysql_fetch_array(mysql_query('SELECT * FROM `dialog_act` WHERE `uid` = "'.$u->info['id'].'" AND `var` = "noobqst1" LIMIT 1'));
if(!isset($tst['id'])) {
if(isset($_GET['noobgo'])) {
if($_GET['noobgo'] == 1) {
$tst = mysql_fetch_array(
mysql_query('SELECT * FROM `dialog_act` WHERE `uid` = "' . $u->info['id'] . '" AND `var` = "noobqst1" LIMIT 1')
);
if (!isset($tst['id'])) {
if (isset($_GET['noobgo'])) {
if ($_GET['noobgo'] == 1) {
//Согласился (создаем пещеру и телепортируем туда
$ins = mysql_query('INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`)
VALUES ("'.$u->info['city'].'","'.$u->info['id'].'","106","Академия Новичков","'.time().'")');
if($ins){
$ins = mysql_query(
'INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`)
VALUES ("' . $u->info['city'] . '","' . $u->info['id'] . '","106","Академия Новичков","' . time() . '")'
);
if ($ins) {
$zid = mysql_insert_id();
//обновляем пользователей
$su = mysql_query('SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`id`="'.$u->info['id'].'"');
$su = mysql_query(
'SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`id`="' . $u->info['id'] . '"'
);
$ids = '';
$map_locs = array();
$map_locs = [];
$spm2 = mysql_query('SELECT `id`,`x`,`y` FROM `dungeon_map` WHERE `id_dng` = "106"');
while( $plm2 = mysql_fetch_array( $spm2 ) ) {
$map_locs[] = array($plm2['x'],$plm2['y']);
while ($plm2 = mysql_fetch_array($spm2)) {
$map_locs[] = [$plm2['x'], $plm2['y']];
}
unset( $spm2 , $plm2 );
unset($spm2, $plm2);
$pxd = 0;
while( $pu = mysql_fetch_array($su) ) {
while ($pu = mysql_fetch_array($su)) {
$pxd++;
$ids .= ' `id` = "'.$pu['id'].'" OR';
$ids .= ' `id` = "' . $pu['id'] . '" OR';
}
$ids = rtrim($ids,'OR');
$ids = rtrim($ids, 'OR');
$snew = 0;
$upd1 = mysql_query('UPDATE `stats` SET `s`="4",`res_s`="1",`x`="0",`y`="0",`res_x`="0",`res_y`="0",`dn` = "0",`dnow` = "'.$zid.'" WHERE '.$ids.'');
if( $upd1 ){
$upd2 = mysql_query('UPDATE `users` SET `room` = "391" WHERE '.$ids.'');
$upd1 = mysql_query(
'UPDATE `stats` SET `s`="4",`res_s`="1",`x`="0",`y`="0",`res_x`="0",`res_y`="0",`dn` = "0",`dnow` = "' . $zid . '" WHERE ' . $ids . ''
);
if ($upd1) {
$upd2 = mysql_query('UPDATE `users` SET `room` = "391" WHERE ' . $ids . '');
//Добавляем ботов и обьекты в пещеру $zid с for_dn = $dungeon['id']
//Добавляем ботов
$vls = '';
$sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "106"');
while( $pl = mysql_fetch_array( $sp ) ) {
if( $pl['id_bot'] == 0 && $pl['bot_group'] !=''){
$bots = explode( ',', $pl['bot_group'] );
$pl['id_bot'] = (int)$bots[rand(0, count($bots)-1 )];
while ($pl = mysql_fetch_array($sp)) {
if ($pl['id_bot'] == 0 && $pl['bot_group'] != '') {
$bots = explode(',', $pl['bot_group']);
$pl['id_bot'] = (int)$bots[rand(0, count($bots) - 1)];
}
if ($pl['id_bot'] > 0) {
$vls .= '("' . $zid . '","' . $pl['id_bot'] . '","' . $pl['colvo'] . '","' . $pl['items'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['dialog'] . '","' . $pl['items'] . '","' . $pl['go_bot'] . '","' . $pl['noatack'] . '"),';
}
if( $pl['id_bot'] > 0 )$vls .= '("'.$zid.'","'.$pl['id_bot'].'","'.$pl['colvo'].'","'.$pl['items'].'","'.$pl['x'].'","'.$pl['y'].'","'.$pl['dialog'].'","'.$pl['items'].'","'.$pl['go_bot'].'","'.$pl['noatack'].'"),';
unset($bots);
}
$vls = rtrim($vls,',');
$ins1 = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`,`go_bot`,`noatack`) VALUES '.$vls.'');
$vls = rtrim($vls, ',');
$ins1 = mysql_query(
'INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`,`go_bot`,`noatack`) VALUES ' . $vls . ''
);
//Добавляем обьекты
$vls = '';
$sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "106"');
while($pl = mysql_fetch_array($sp))
{
$vls .= '("'.$zid.'","'.$pl['name'].'","'.$pl['img'].'","'.$pl['x'].'","'.$pl['y'].'","'.$pl['action'].'","'.$pl['type'].'","'.$pl['w'].'","'.$pl['h'].'","'.$pl['s'].'","'.$pl['s2'].'","'.$pl['os1'].'","'.$pl['os2'].'","'.$pl['os3'].'","'.$pl['os4'].'","'.$pl['type2'].'","'.$pl['top'].'","'.$pl['left'].'","'.$pl['date'].'"),';
while ($pl = mysql_fetch_array($sp)) {
$vls .= '("' . $zid . '","' . $pl['name'] . '","' . $pl['img'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['action'] . '","' . $pl['type'] . '","' . $pl['w'] . '","' . $pl['h'] . '","' . $pl['s'] . '","' . $pl['s2'] . '","' . $pl['os1'] . '","' . $pl['os2'] . '","' . $pl['os3'] . '","' . $pl['os4'] . '","' . $pl['type2'] . '","' . $pl['top'] . '","' . $pl['left'] . '","' . $pl['date'] . '"),';
}
//
$vls = rtrim($vls,',');
if( $vls != '' ) {
$ins2 = mysql_query('INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES '.$vls.'');
$vls = rtrim($vls, ',');
if ($vls != '') {
$ins2 = mysql_query(
'INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES ' . $vls . ''
);
} else {
$ins2 = true;
}
if( $upd2 && $ins1 && $ins2 ){
die('<script>location="main.php?rnd='.$code.'";</script>');
if ($upd2 && $ins1 && $ins2) {
die('<script>location="main.php?rnd=' . $code . '";</script>');
} else {
$error = 'Ошибка перехода в подземелье...';
}
@ -78,39 +91,38 @@ if($u->room['file']=='an/bk'){
//
//header('location: main.php');
die();
}else{
} else {
//Отказался (добавляем квест, системку и пошел нах)
mysql_query('INSERT INTO `dialog_act` (
mysql_query(
'INSERT INTO `dialog_act` (
`uid`,`var`,`time`
) VALUES (
"'.$u->info['id'].'","noobqst1","'.time().'"
)');
"' . $u->info['id'] . '","noobqst1","' . time() . '"
)'
);
//Начало обучения
$humor = array(
0 => array(
':maniac: Сильно не бейте ;)',':beggar: Будет попрошайничать - бейте!',':pal: Возможно светлый!',
':vamp: Возможно темный!',':susel: Судя по здоровенному бицепсу - это мужик!',':duel: И сразу же кинулся в бой!',
':friday: Не долго думав он начал искать собутыльника!',':doc: Лекарь: Новичок! Да, да! Ты! Если тебя сломают - у знахаря тебя соберут обратно!'
),
1 => array(
':maniac: Помните! Девочек не бьем ;)',':nail: Она красит ногти, не отвлекайте все сразу ;)',':pal: Возможно светлая!',
':vamp: Возможно темная!',':rev: Судя по красивой одежде - это женщина!',':hug: И сразу же кинулась всех целовать!',
':angel2: Ангел сошел с небес...'
)
);
$humor = [
0 => [
':maniac: Сильно не бейте ;)', ':beggar: Будет попрошайничать - бейте!', ':pal: Возможно светлый!',
':vamp: Возможно темный!', ':susel: Судя по здоровенному бицепсу - это мужик!', ':duel: И сразу же кинулся в бой!',
':friday: Не долго думав он начал искать собутыльника!', ':doc: Лекарь: Новичок! Да, да! Ты! Если тебя сломают - у знахаря тебя соберут обратно!',
],
1 => [
':maniac: Помните! Девочек не бьем ;)', ':nail: Она красит ногти, не отвлекайте все сразу ;)', ':pal: Возможно светлая!',
':vamp: Возможно темная!', ':rev: Судя по красивой одежде - это женщина!', ':hug: И сразу же кинулась всех целовать!',
':angel2: Ангел сошел с небес...',
],
];
$humor = $humor[$u->info['sex']];
//$u->info['fnq'] = 1;
//mysql_query('UPDATE `users` SET `fnq` = "'.$u->info['fnq'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
//Отправляем сообщение в чат о новичке
//mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$u->info['id'].'" AND `delete` = 0 AND `item_id` = 4703');
//mysql_query('UPDATE `users` SET `room` = 4 WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
//mysql_query('UPDATE `stats` SET `hpNow` = 1000,`mpNow` = 1000,`dn` = 0 , `dnow` = 0 , `x` = 0 , `y` = 0 , `s` = 0 WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
$u->send('','','','','','В нашем мире появился новый игрок &quot;<b>' . $u->info['login'] . '</b>&quot;! '.$humor[rand(0,count($humor)-1)].'',time(),6,0,0,0,1,0);
echo '<div><font color=red><b>Вы отказались от обучения, второй попытки больше не будет!</b></font></div>';
array_shift($humor);
$cmsg = new ChatMessage();
$cmsg->setText('В нашем мире появился новый игрок &quot;<b>' . $u->info['login'] . '</b>&quot;! ' . $humor[0]);
$cmsg->setType(6);
(new Chat())->sendMsg($cmsg);
echo '<div style="color: red; font-weight: bold;">Вы отказались от обучения, второй попытки больше не будет!</div>';
}
}else{
} else {
echo '<script>
function qstnoobsstart() {
top.win.add(\'qstnoobsstart\',\'Вы хотите пройти обучение?\',\'\',{\'a1\':\'top.frames[\\\'main\\\'].location.href=\\\'main.php?noobgo=1\\\';\',\'a2\':\'top.frames[\\\'main\\\'].location.href=\\\'main.php?noobgo=2\\\';\',\'n\':\'<center><small>Отказавшись вы не получите награду!</small></center>\'},2,1,\'width:300px;\');
@ -121,87 +133,152 @@ if($u->room['file']=='an/bk'){
}
?><script type="text/javascript" src="/js/jquery.locations.js"></script>
<link href="/css/fightclub.css" rel="stylesheet" type="text/css">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
?>
<script type="text/javascript" src="/js/jquery.locations.js"></script>
<link href="/css/fightclub.css" rel="stylesheet" type="text/css">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="250" valign="top">
<? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
<?php $usee = $u->getInfoPers($u->info['id'], 0);
if ($usee != false) {
echo $usee[0];
} else {
echo 'information is lost.';
} ?>
</td>
<td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
<td valign="top"><div align="right">
<? if($u->error!=''){ echo '<font color="red"><b>'.$u->error.'</b></font>'; } ?>
<td width="230" valign="top"
style="padding-top:19px;"><?php require_once('modules_data/stats_loc.php'); ?></td>
<td valign="top">
<div align="right">
<?php if ($u->error != '') {
echo '<font color="red"><b>' . $u->error . '</b></font>';
} ?>
<table border="0" cellpadding="0" cellspacing="0">
<tr align="right" valign="top">
<td>
<? if($re!=''){ echo '<font color="red"><b>'.$re.'</b></font>'; } ?>
<?php if ($re != '') {
echo '<font color="red"><b>' . $re . '</b></font>';
} ?>
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td id="ViewLocation"><?php
if(true == false){
?><script><?php
if (true == false) {
?>
<script><?php
require_once('modules_data/location/fight-club.database.php');
?>
var json = <?php echo json_encode($Response); ?>;
var tgo = <?php echo ($tmGo*10); ?>;
var tgol = <?php echo ($tmGol*10); ?>;
var tgo = <?php echo($tmGo * 10); ?>;
var tgol = <?php echo($tmGol * 10); ?>;
ViewLocation(json);
</script><?php
}else{
?>
<div style="position:relative; cursor: pointer; width: 500;" id="ione"><img src="https://img.new-combats.com/i/images/300x225/club/navig.jpg" id="img_ione" width="500" height="240" border="1"/>
<div style="position:relative; cursor: pointer; width: 500;" id="ione">
<img src="https://img.new-combats.com/i/images/300x225/club/navig.jpg"
id="img_ione" width="500" height="240" border="1"/>
<div style="position:absolute; left:241px; top:128px; width:16px; height:18px; z-index:90;"><img src="https://img.new-combats.com/i/images/300x225/fl1.gif" width="16" height="18" title="Вы находитесь в '<? echo $u->room['name']; ?>'" /></div>
<div style="position: absolute; left: 30px; top: 140px; width: 28px; height: 31px; z-index: 90;"><img onClick="alert('Проход через Зал воинов 1');" src="https://img.new-combats.com/i/images/300x225/zk_entrance.gif" width="28" height="63" title="" /></div>
<div style="position:absolute; left:241px; top:128px; width:16px; height:18px; z-index:90;">
<img src="https://img.new-combats.com/i/images/300x225/fl1.gif"
width="16" height="18"
title="Вы находитесь в '<?php echo $u->room['name']; ?>'"/>
</div>
<div style="position: absolute; left: 30px; top: 140px; width: 28px; height: 31px; z-index: 90;">
<img onClick="alert('Проход через Зал воинов 1');"
src="https://img.new-combats.com/i/images/300x225/zk_entrance.gif"
width="28" height="63" title=""/></div>
<div style="position: absolute; left: 327px; top: 136px; width: 63px; height: 28px; z-index: 90;"><img onClick="alert('Проход через Зал воинов 2');" src="https://img.new-combats.com/city/zk_entrance2.gif" width="63" height="28" title="" /></div>
<div style="position: absolute; left: 327px; top: 136px; width: 63px; height: 28px; z-index: 90;">
<img onClick="alert('Проход через Зал воинов 2');"
src="https://img.new-combats.com/city/zk_entrance2.gif"
width="63" height="28" title=""/></div>
<div style="position:absolute; left:184px; top:94px; width:120px; height:35px; z-index:90;"><img src="https://img.new-combats.com/i/images/300x225/map_bk.gif" width="120" height="35" title="" class="aFilter" /></div>
<div style="position:absolute; left:66px; top:114px; width:56px; height:13px; z-index:90;"><img <? thisInfRm('2.180.0.240'); ?> onClick="location='main.php?loc=2.180.0.240';" src="https://img.new-combats.com/i/images/300x225/map_klub1.gif" width="56" height="13" class="aFilter" /></div>
<div style="position:absolute; left:216px; top:41px; width:58px; height:49px; z-index:90;"><img <? thisInfRm('2.180.0.259'); ?> onClick="location='main.php?loc=2.180.0.259';" src="https://img.new-combats.com/i/images/300x225/map_klub2.gif" width="58" height="49" class="aFilter" /></div>
<div style="position:absolute; left:312px; top:168px; width:123px; height:31px; z-index:90;"><img <? thisInfRm('2.180.0.229'); ?> onClick="location='main.php?loc=2.180.0.229';" src="https://img.new-combats.com/i/images/300x225/map_klub3.gif" width="123" height="31" title="" class="aFilter" /></div>
<div style="position:absolute; left:59px; top:169px; width:123px; height:31px; z-index:90;"><img <? thisInfRm('2.180.0.231'); ?> onClick="location='main.php?loc=2.180.0.231';" src="https://img.new-combats.com/i/images/300x225/map_klub4.gif" width="123" height="31" class="aFilter" /></div>
<div style="position:absolute; left:312px; top:48px; width:123px; height:30px; z-index:90;"><img <? thisInfRm('2.180.0.232'); ?> onClick="location='main.php?loc=2.180.0.232';" src="https://img.new-combats.com/i/images/300x225/map_klub5.gif" width="123" height="30" class="aFilter" /></div>
<div style="position:absolute; left:52px; top:47px; width:123px; height:30px; z-index:90;"><img <? thisInfRm('2.180.0.233'); ?> onClick="location='main.php?loc=2.180.0.233';" src="https://img.new-combats.com/i/images/300x225/map_klub6.gif" width="123" height="30" class="aFilter" /></div>
<div style="position:absolute; left:196px; top:148px; width:103px; height:47px; z-index:90;"><img <? thisInfRm('2.180.0.234'); ?> onClick="location='main.php?loc=2.180.0.234';" src="https://img.new-combats.com/i/images/300x225/map_klub7.gif" width="103" height="47" class="aFilter" /></div>
<div style="position:absolute; left:184px; top:94px; width:120px; height:35px; z-index:90;">
<img src="https://img.new-combats.com/i/images/300x225/map_bk.gif"
width="120" height="35" title="" class="aFilter"/></div>
<div style="position:absolute; left:66px; top:114px; width:56px; height:13px; z-index:90;">
<img <?php thisInfRm('2.180.0.240'); ?>
onClick="location='main.php?loc=2.180.0.240';"
src="https://img.new-combats.com/i/images/300x225/map_klub1.gif"
width="56" height="13" class="aFilter"/></div>
<div style="position:absolute; left:216px; top:41px; width:58px; height:49px; z-index:90;">
<img <?php thisInfRm('2.180.0.259'); ?>
onClick="location='main.php?loc=2.180.0.259';"
src="https://img.new-combats.com/i/images/300x225/map_klub2.gif"
width="58" height="49" class="aFilter"/></div>
<div style="position:absolute; left:312px; top:168px; width:123px; height:31px; z-index:90;">
<img <?php thisInfRm('2.180.0.229'); ?>
onClick="location='main.php?loc=2.180.0.229';"
src="https://img.new-combats.com/i/images/300x225/map_klub3.gif"
width="123" height="31" title="" class="aFilter"/></div>
<div style="position:absolute; left:59px; top:169px; width:123px; height:31px; z-index:90;">
<img <?php thisInfRm('2.180.0.231'); ?>
onClick="location='main.php?loc=2.180.0.231';"
src="https://img.new-combats.com/i/images/300x225/map_klub4.gif"
width="123" height="31" class="aFilter"/></div>
<div style="position:absolute; left:312px; top:48px; width:123px; height:30px; z-index:90;">
<img <?php thisInfRm('2.180.0.232'); ?>
onClick="location='main.php?loc=2.180.0.232';"
src="https://img.new-combats.com/i/images/300x225/map_klub5.gif"
width="123" height="30" class="aFilter"/></div>
<div style="position:absolute; left:52px; top:47px; width:123px; height:30px; z-index:90;">
<img <?php thisInfRm('2.180.0.233'); ?>
onClick="location='main.php?loc=2.180.0.233';"
src="https://img.new-combats.com/i/images/300x225/map_klub6.gif"
width="123" height="30" class="aFilter"/></div>
<div style="position:absolute; left:196px; top:148px; width:103px; height:47px; z-index:90;">
<img <?php thisInfRm('2.180.0.234'); ?>
onClick="location='main.php?loc=2.180.0.234';"
src="https://img.new-combats.com/i/images/300x225/map_klub7.gif"
width="103" height="47" class="aFilter"/></div>
<div id="snow"></div>
<? echo $goline; ?>
<?php echo $goline; ?>
</div>
<?php } ?>
</td>
</tr>
</table>
<div style="display:none; height:0px " id="moveto"></div>
<div align="right" style="padding: 3px;"><small>&laquo;<? echo $c['title3']; ?>&raquo; приветствует Вас, <b><? echo $u->info['login']; ?></b>.<br />
<div align="right" style="padding: 3px;">
<small>&laquo;<?php echo $c['title3']; ?>&raquo; приветствует Вас,
<b><?php echo $u->info['login']; ?></b>.<br/>
<?php
if($u->info['level']<6)
{
if ($u->info['level'] < 6) {
echo '
Вам все время кажется что за вами следят? Чудится, что случайный попутчик мечтает всадить вам топор в спину? При совершении очередной покупки в гос. магазине мучает ощущение, что вас обманули? Кажется, что симпатичная девушка напротив смотрит на вас как на пищу? Успокойтесь, это не паранойя. Это реалии Capital city. Города Тьмы.
';
}else{
} else {
echo 'Возможно, вы ошиблись этажом - настоящие сражения проходят этажом выше.';
} ?>
</small></div></td>
<td>
<!-- <br /><span class="menutop"><nobr>Комната для новичков</nobr></span>-->
</small></div>
</td>
<td></td>
</tr>
</table>
<small>
<HR>
<? $hgo = $u->testHome(); if(!isset($hgo['id'])){ ?><INPUT onclick="location.href='main.php?homeworld=<? echo $code; ?>';" class="btn" value="Возврат" type="button" name="combats2"><? } unset($hgo); ?>
<INPUT id="forum" class="btn" onclick="window.open('https://new-combats.com/forum/', 'forum', 'location=yes,menubar=yes,status=yes,resizable=yes,toolbar=yes,scrollbars=yes,scrollbars=yes')" value="Форум" type="button" name="forum">
<INPUT onclick="location.href='main.php?clubmap=<? echo $code; ?>';" class="btn" value="Карта клуба" type="button" name="combats2">
<br />
<strong>Внимание!</strong> Никогда и никому не говорите пароль от своего персонажа. Не вводите пароль на других сайтах, типа "новый город", "лотерея", "там, где все дают на халяву". Пароль не нужен ни паладинам, ни кланам, ни администрации, <U>только взломщикам</U> для кражи вашего героя.<BR>
<?php $hgo = $u->testHome();
if (!isset($hgo['id'])) { ?><INPUT
onclick="location.href='main.php?homeworld=<?php echo $code; ?>';"class="btn"value="Возврат"
type="button"name="combats2"><?php }
unset($hgo); ?>
<INPUT id="forum" class="btn"
onclick="window.open('https://new-combats.com/forum/', 'forum', 'location=yes,menubar=yes,status=yes,resizable=yes,toolbar=yes,scrollbars=yes,scrollbars=yes')"
value="Форум" type="button" name="forum">
<INPUT onclick="location.href='main.php?clubmap=<?php echo $code; ?>';" class="btn"
value="Карта клуба" type="button" name="combats2">
<br/>
<strong>Внимание!</strong> Никогда и никому не говорите пароль от своего персонажа. Не вводите
пароль на других сайтах, типа "новый город", "лотерея", "там, где все дают на халяву". Пароль не
нужен ни паладинам, ни кланам, ни администрации, <U>только взломщикам</U> для кражи вашего
героя.<BR>
<em>Администрация.</em></small> <BR>
<? echo $rowonmax; ?><BR>
<?php echo $rowonmax; ?><BR>
</div></td>
</div>
</td>
</tr>
</table>
<?php
</table>
<?php
}

View File

@ -1,73 +1,109 @@
<?php
if(!defined('GAME'))die();
if (!defined('GAME')) {
die();
}
// dungeons/building.php
// name:"Строительство портала"|resource:898x1000,891x500,877x250,900x400,899x400,890x200,876x100,889x100,1035x100
if(isset($file) && $file[0]=='dungeons/building.php' /* && $u->info['admin'] > 0 */ ) {
if (isset($file) && $file[0] == 'dungeons/building.php' /* && $u->info['admin'] > 0 */) {
$need_count = 0;
$actions = array();
$resource = array();
$action = explode('|',$file[1]);
foreach( $action as $value ) {
$temp = explode(':',$value);
$actions[$temp[0]]= $temp[1];
$actions = [];
$resource = [];
$action = explode('|', $file[1]);
foreach ($action as $value) {
$temp = explode(':', $value);
$actions[$temp[0]] = $temp[1];
}
if( isset($actions['resource']) ){
$action = explode( ',',$actions['resource'] );
foreach( $action as $value ) {
$temp = explode( 'x', $value );
$resource[] = array(
if (isset($actions['resource'])) {
$action = explode(',', $actions['resource']);
foreach ($action as $value) {
$temp = explode('x', $value);
$resource[] = [
'item' => (int)$temp[0],
'count' => (int)$temp[1]
);
$need_count = $need_count+(int)$temp[1];
'count' => (int)$temp[1],
];
$need_count = $need_count + (int)$temp[1];
}
}
$actions['resource'] = $resource;
unset($action, $temp, $value, $resource);
# Обьекты для строительства
if(isset($_GET['buildend'])) {
if (isset($_GET['buildend'])) {
//identid
$obj = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_obj` WHERE `id` = "'.mysql_real_escape_string($actions['identid']).'" LIMIT 1'));
$obj = mysql_fetch_array(
mysql_query(
'SELECT * FROM `dungeon_obj` WHERE `id` = "' . mysql_real_escape_string(
$actions['identid']
) . '" LIMIT 1'
)
);
$txt = '';
if( !isset($obj['id']) ) {
if (!isset($obj['id'])) {
$txt = 'Объект строительства был поврежден темной магией...';
}else{
if( $obj['x'] == $u->info['x'] && $obj['y'] == $u->info['y'] ) {
} else {
if ($obj['x'] == $u->info['x'] && $obj['y'] == $u->info['y']) {
$txt = 'Объект уже был построен ранее! Вернитесь на клетку назад для использования объекта!';
}else{
mysql_query('UPDATE `dungeon_obj` SET `x` = "'.$u->info['x'].'", `y` = "'.$u->info['y'].'" WHERE `id` = "'.$obj['id'].'" LIMIT 1');
mysql_query('UPDATE `dungeon_obj` SET `x` = "'.$u->info['x'].'", `y` = "'.$u->info['y'].'" WHERE `dn` > 0 AND `name` = "'.$obj['name'].'" AND `img` = "'.$obj['img'].'" AND `action` = "'.$obj['action'].'" AND `x` = "'.$obj['x'].'" AND `y` = "'.$obj['y'].'"');
$txt = 'Строительство &quot;'.$obj['name'].'&quot; завершилось, вернитесь на клетку назад...';
$u->send('','','','','','Игрок &quot;<b>' . $u->info['login'] . '</b>&quot; завершил строительство объекта &quot;'.mysql_real_escape_string($actions['name']).'&quot;.',time(),6,0,0,0,1,0);
} else {
mysql_query(
'UPDATE `dungeon_obj` SET `x` = "' . $u->info['x'] . '", `y` = "' . $u->info['y'] . '" WHERE `id` = "' . $obj['id'] . '" LIMIT 1'
);
mysql_query(
'UPDATE `dungeon_obj` SET `x` = "' . $u->info['x'] . '", `y` = "' . $u->info['y'] . '" WHERE `dn` > 0 AND `name` = "' . $obj['name'] . '" AND `img` = "' . $obj['img'] . '" AND `action` = "' . $obj['action'] . '" AND `x` = "' . $obj['x'] . '" AND `y` = "' . $obj['y'] . '"'
);
$txt = 'Строительство &quot;' . $obj['name'] . '&quot; завершилось, вернитесь на клетку назад...';
$cmsg = new ChatMessage();
$cmsg->setText('Игрок &quot;<b>' . $u->info['login'] . '</b>&quot; завершил строительство объекта &quot;' . mysql_real_escape_string($actions['name']) . '&quot;.');
$cmsg->setType(6);
(new Chat())->sendMsg($cmsg);
}
}
echo '<div align="left"><font color="red"><b>'.$txt.'</b></font></div>';
echo '<div style="font-weight: bold; color: red">' . $txt . '</div>';
}
# пожертвование
if( isset($_POST['itemid'],$_POST['action']) ){
$help = mysql_fetch_assoc(mysql_query('SELECT COUNT(`id`) as count, item_id FROM `items_users` WHERE `item_id` = '.$_POST['itemid'].' AND `uid` = '.$u->info['id'].' AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = "0" AND `inShop` = "0" LIMIT 1'));
if($help){
$item = mysql_fetch_assoc(mysql_query('SELECT im.`name`, im.`img` FROM `items_main` as im WHERE im.`id` = '.$help['item_id'].' LIMIT 1'));
if( isset($item) && $item['name'] != '' ) {
foreach( $actions['resource'] as $key=>$val) {
if($_POST['itemid'] == $val['item']){
$current = mysql_fetch_assoc(mysql_query('SELECT SUM(b.`count`) as count, im.`name`, im.`img` FROM `items_main` as im LEFT JOIN `building` as `b` ON b.item_id = im.id WHERE b.`building` = "'.$actions['ident'].'" AND im.`id` = '.$val['item'].' LIMIT 1'));
if($current['count']==NULL) $current['count']=0; else $current['count']=(int)$current['count'];
if($current['count']+(int)$help['count'] <= $val['count']) {
if (isset($_POST['itemid'], $_POST['action'])) {
$help = mysql_fetch_assoc(
mysql_query(
'SELECT COUNT(`id`) as count, item_id FROM `items_users` WHERE `item_id` = ' . $_POST['itemid'] . ' AND `uid` = ' . $u->info['id'] . ' AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = "0" AND `inShop` = "0" LIMIT 1'
)
);
if ($help) {
$item = mysql_fetch_assoc(
mysql_query(
'SELECT im.`name`, im.`img` FROM `items_main` as im WHERE im.`id` = ' . $help['item_id'] . ' LIMIT 1'
)
);
if (isset($item) && $item['name'] != '') {
foreach ($actions['resource'] as $key => $val) {
if ($_POST['itemid'] == $val['item']) {
$current = mysql_fetch_assoc(
mysql_query(
'SELECT SUM(b.`count`) as count, im.`name`, im.`img` FROM `items_main` as im LEFT JOIN `building` as `b` ON b.item_id = im.id WHERE b.`building` = "' . $actions['ident'] . '" AND im.`id` = ' . $val['item'] . ' LIMIT 1'
)
);
if ($current['count'] == null) {
$current['count'] = 0;
} else {
$current['count'] = (int)$current['count'];
}
if ($current['count'] + (int)$help['count'] <= $val['count']) {
# Если ваших ресурсов меньше чем требуется.
} else {
# Если ваших ресурсов больше чем требуется.
$help['count'] = +($val['count']-$current['count']);
$help['count'] = +($val['count'] - $current['count']);
}
if($help['count'] > 0) {
mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `item_id` = '.$help['item_id'].' AND `uid` = '.$u->info['id'].' AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = "0" AND `inShop` = "0" ORDER BY `delete` DESC LIMIT '.$help['count'].'');
mysql_query('INSERT INTO building (id, building, uid, clan_id, item_id, count) VALUES (NULL, "'.$actions['ident'].'", '.$u->info['id'].', '.$u->info['clan'].', '.$help['item_id'].', '.$help['count'] .')');
$d->error = 'Вы пожертвовали на строительство ['.$item['name'].'] в количестве '.$help['count'].'шт.';
if ($help['count'] > 0) {
mysql_query(
'UPDATE `items_users` SET `delete` = "' . time(
) . '" WHERE `item_id` = ' . $help['item_id'] . ' AND `uid` = ' . $u->info['id'] . ' AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = "0" AND `inShop` = "0" ORDER BY `delete` DESC LIMIT ' . $help['count'] . ''
);
mysql_query(
'INSERT INTO building (id, building, uid, clan_id, item_id, count) VALUES (NULL, "' . $actions['ident'] . '", ' . $u->info['id'] . ', ' . $u->info['clan'] . ', ' . $help['item_id'] . ', ' . $help['count'] . ')'
);
$d->error = 'Вы пожертвовали на строительство [' . $item['name'] . '] в количестве ' . $help['count'] . 'шт.';
}
}
}
@ -78,26 +114,44 @@ if(isset($file) && $file[0]=='dungeons/building.php' /* && $u->info['admin'] >
}
}
}
unset($_POST,$help, $item);
unset($_POST, $help, $item);
# отображение
$count = mysql_fetch_array(mysql_query('SELECT SUM(count) as count FROM `building` WHERE `building` = "'.$actions['ident'].'" LIMIT 1'));
if( isset($count[0]) and $count[0]!=NULL ) $count = $count[0]; else $count = 0;
$count = mysql_fetch_array(
mysql_query('SELECT SUM(count) as count FROM `building` WHERE `building` = "' . $actions['ident'] . '" LIMIT 1')
);
if (isset($count[0]) and $count[0] != null) {
$count = $count[0];
} else {
$count = 0;
}
$r = '<table width="520" style="border:1px solid gray;padding:4px 4px;" cellpadding="0" cellspacing="0"><tr>
<td colspan="2" style="border:1px solid gray;padding:3px 6px;border-right:0px;"><strong>Прогресс строительства %</strong></td>
<td align="right" style="border:1px solid gray;padding:3px 6px;border-left:0px;"><table style="display:inline-block;" border="0" cellspacing="0" cellpadding="0" height="10"><tr><td valign="middle" width="120" style="padding-top:12px"><div style="position:relative;"><div id="vhp-1234500000" title="Выполнение строительства" align="left" class="seehp" style="position:absolute; top:-10px; width:120px; height:10px; z-index:12;"> '.round($count/($need_count/100)).'/'.(100).'</div><div title="Выполнение строительства" class="hpborder" style="position:absolute; top:-10px; width:120px; height:9px; z-index:13;"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div><div class="hp_3 senohp" style="height:9px; width:120px; position:absolute; top:-10px; z-index:11;" id="lhp-1234500000"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div><div title="Выполнение строительства" class="hp_none" style="position:absolute; top:-10px; width:120px; height:10px; z-index:10;"><img src="https://img.new-combats.com/1x1.gif" height="10"></div></div></td></tr></table><br><script>top.startHpRegen("main",-1234500000,'.round($count/($need_count/100)).','.( 100 ).',0,0,0,0,0,0,1);</script>';
<td align="right" style="border:1px solid gray;padding:3px 6px;border-left:0px;"><table style="display:inline-block;" border="0" cellspacing="0" cellpadding="0" height="10"><tr><td valign="middle" width="120" style="padding-top:12px"><div style="position:relative;"><div id="vhp-1234500000" title="Выполнение строительства" align="left" class="seehp" style="position:absolute; top:-10px; width:120px; height:10px; z-index:12;"> ' . round(
$count / ($need_count / 100)
) . '/' . (100) . '</div><div title="Выполнение строительства" class="hpborder" style="position:absolute; top:-10px; width:120px; height:9px; z-index:13;"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div><div class="hp_3 senohp" style="height:9px; width:120px; position:absolute; top:-10px; z-index:11;" id="lhp-1234500000"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div><div title="Выполнение строительства" class="hp_none" style="position:absolute; top:-10px; width:120px; height:10px; z-index:10;"><img src="https://img.new-combats.com/1x1.gif" height="10"></div></div></td></tr></table><br><script>top.startHpRegen("main",-1234500000,' . round(
$count / ($need_count / 100)
) . ',' . (100) . ',0,0,0,0,0,0,1);</script>';
$r .= '</td></tr>';
# Текущее состояние строительства.
foreach( $actions['resource'] as $key=>$val) {
if($count==0){
$current = mysql_fetch_assoc(mysql_query('SELECT im.`name`, im.`img` FROM `items_main` as im WHERE im.`id` = '.$val['item'].' LIMIT 1'));
foreach ($actions['resource'] as $key => $val) {
if ($count == 0) {
$current = mysql_fetch_assoc(
mysql_query(
'SELECT im.`name`, im.`img` FROM `items_main` as im WHERE im.`id` = ' . $val['item'] . ' LIMIT 1'
)
);
$current['count'] = 0;
} else {
$current = mysql_fetch_assoc(mysql_query('SELECT SUM(b.`count`) as count, im.`name`, im.`img` FROM `items_main` as im LEFT JOIN `building` as `b` ON b.item_id = im.id
WHERE b.`building` = "'.$actions['ident'].'" AND im.`id` = '.$val['item'].' LIMIT 1'));
$current = mysql_fetch_assoc(
mysql_query(
'SELECT SUM(b.`count`) as count, im.`name`, im.`img` FROM `items_main` as im LEFT JOIN `building` as `b` ON b.item_id = im.id
WHERE b.`building` = "' . $actions['ident'] . '" AND im.`id` = ' . $val['item'] . ' LIMIT 1'
)
);
}
if( isset($current) && $current['name'] != '' ) {
if (isset($current) && $current['name'] != '') {
$actions['resource'][$key]['current'] = (int)$current['count'];
$actions['resource'][$key]['name'] = $current['name'];
$actions['resource'][$key]['img'] = $current['img'];
@ -108,25 +162,35 @@ if(isset($file) && $file[0]=='dungeons/building.php' /* && $u->info['admin'] >
}
}
unset($key,$val,$current);
unset($key, $val, $current);
foreach( $actions['resource'] as $row) {
$current_uid = mysql_fetch_assoc(mysql_query('SELECT COUNT(`id`) as count FROM `items_users` WHERE `item_id` = '.$row['item'].' AND `uid` = '.$u->info['id'].' AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = "0" AND `inShop` = "0" LIMIT 1'));
if(isset($current_uid) && $current_uid['count'] == NULL) $current_uid['count'] = 0; // Сколько можем внести
foreach ($actions['resource'] as $row) {
$current_uid = mysql_fetch_assoc(
mysql_query(
'SELECT COUNT(`id`) as count FROM `items_users` WHERE `item_id` = ' . $row['item'] . ' AND `uid` = ' . $u->info['id'] . ' AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = "0" AND `inShop` = "0" LIMIT 1'
)
);
if (isset($current_uid) && $current_uid['count'] == null) {
$current_uid['count'] = 0;
} // Сколько можем внести
$r .= '<tr><td style="padding:1px 2px 1px 6px;">['.$row['name'].']</td>';
if($row['current'] >= $row['count']){
$r .= '<tr><td style="padding:1px 2px 1px 6px;">[' . $row['name'] . ']</td>';
if ($row['current'] >= $row['count']) {
$input = '';
} else{
$input = '<form method="post" id="te'.$row['item'].'"><input style="min-width:24px; border:0px; font-weight:bold; cursor:pointer;cursor:hand; text-align:center;" type="hidden" name="itemid" value="'.$row['item'].'"> <input style="min-width:90px; border:0px; font-weight:bold; cursor:pointer;cursor:hand; text-align:left;" type="SUBMIT" name="action" title="У вас есть '.$current_uid['count'].'шт" value="Пожертвовать"></form>';
} else {
$input = '<form method="post" id="te' . $row['item'] . '"><input style="min-width:24px; border:0px; font-weight:bold; cursor:pointer;cursor:hand; text-align:center;" type="hidden" name="itemid" value="' . $row['item'] . '"> <input style="min-width:90px; border:0px; font-weight:bold; cursor:pointer;cursor:hand; text-align:left;" type="SUBMIT" name="action" title="У вас есть ' . $current_uid['count'] . 'шт" value="Пожертвовать"></form>';
}
$r .= '<td style="padding:1px 3px 1px 3px; text-align:right;">'.$input.'</td><td width="125" style="padding:1px 6px 1px 2px; text-align:right;">';
$r .='<table style="display:inline-block;" border="0" cellspacing="0" cellpadding="0" height="10"><tr><td valign="middle" width="120" style="padding-top:12px"><div style="position:relative;"><div id="vhp-123450'.$row['item'].'" title="'.$row['name'].'" align="left" class="seehp" style="position:absolute; top:-10px; width:120px; height:10px; z-index:12;"> '.round($row['current']/($row['count']/100)).'/'.(100).'</div><div title="'.$row['name'].'" class="hpborder" style="position:absolute; top:-10px; width:120px; height:9px; z-index:13;"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div><div class="hp_3 senohp" style="height:9px; width:120px; position:absolute; top:-10px; z-index:11;" id="lhp-123450'.$row['item'].'"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div><div title="'.$row['name'].'" class="hp_none" style="position:absolute; top:-10px; width:120px; height:10px; z-index:10;"><img src="https://img.new-combats.com/1x1.gif" height="10"></div></div></td></tr></table><br><script>top.startHpRegen("main",-123450'.$row['item'].','.round($row['current']/($row['count']/100)).','.(100).',0,0,0,0,0,0,1);</script>';
$r .= '<td style="padding:1px 3px 1px 3px; text-align:right;">' . $input . '</td><td width="125" style="padding:1px 6px 1px 2px; text-align:right;">';
$r .= '<table style="display:inline-block;" border="0" cellspacing="0" cellpadding="0" height="10"><tr><td valign="middle" width="120" style="padding-top:12px"><div style="position:relative;"><div id="vhp-123450' . $row['item'] . '" title="' . $row['name'] . '" align="left" class="seehp" style="position:absolute; top:-10px; width:120px; height:10px; z-index:12;"> ' . round(
$row['current'] / ($row['count'] / 100)
) . '/' . (100) . '</div><div title="' . $row['name'] . '" class="hpborder" style="position:absolute; top:-10px; width:120px; height:9px; z-index:13;"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div><div class="hp_3 senohp" style="height:9px; width:120px; position:absolute; top:-10px; z-index:11;" id="lhp-123450' . $row['item'] . '"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div><div title="' . $row['name'] . '" class="hp_none" style="position:absolute; top:-10px; width:120px; height:10px; z-index:10;"><img src="https://img.new-combats.com/1x1.gif" height="10"></div></div></td></tr></table><br><script>top.startHpRegen("main",-123450' . $row['item'] . ',' . round(
$row['current'] / ($row['count'] / 100)
) . ',' . (100) . ',0,0,0,0,0,0,1);</script>';
$r .= '</td></tr>';
unset($input,$current_uid);
unset($input, $current_uid);
}
if( round($count/($need_count/100)) >= 100 ) {
if (round($count / ($need_count / 100)) >= 100) {
$r .= '<tr><td style="padding:1px 3px 1px 3px; text-align:center;"><br><input style="margin-left:120px;" class="btnnew2" onclick="location.href=\'/main.php?buildend\';" value="Завершить строительство" type="button"></td></tr>';
}
@ -134,13 +198,12 @@ if(isset($file) && $file[0]=='dungeons/building.php' /* && $u->info['admin'] >
unset($row);
/*
/*
* <table width="480" style="border:1px solid gray;padding:4px 4px;" cellpadding="0" cellspacing="0"><tr>
<td style="border:1px solid gray;padding:3px 6px;border-right:0px;"><strong>Прогресс строительства</strong></td>
<td align="right" style="border:1px solid gray;padding:3px 6px;border-left:0px;">
*/
# Идет строительство "'.$actions['name'].'", но нам нехватает ресурсов, помоги добрый странник.
$d->information = '<br/>'.$r;
$d->information = '<br/>' . $r;
}

View File

@ -317,21 +317,14 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
} else {
//Записываем данные
$msg['time'] = time();
$msg['spam'] = 0;
$msg['type'] = 1;
$msg['toChat'] = 0;
$msg['color'] = 'Black';
$msg['typeTime'] = 0;
$msg['sound'] = 0;
$msg['global'] = 0;
$msg['molch'] = 0;
$msg['login'] = $u->info['login'];
$msg['cancel'] = 0;
$msg['delete'] = 0;
$msg['to'] = '';
$msg['da'] = 0;
$msg['color'] = $u->info['chatColor'];
//Нормируем типы сообщений
if (preg_match("/private\[(.*?)\]/", $_POST['msg'], $msg['to'])) {
@ -354,11 +347,8 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
$_POST['msg'] = str_replace('to [' . $msg['to'] . ']', ' ', $_POST['msg']);
}
if ($u->info['admin'] == 0) { //ТУТ SPAM
if ($msg['to'] != '' && !isset($admq['id'])) {
if ($msg['to'] != '' && !isset($admq['id']) && $msg['type'] == 3) {
$admq = Db::getRow('select id, admin from users where login = ? and admin > 0', [$msg['to']]);
if ($msg['type'] != 3) {
unset($admq);
}
}
if (!isset($admq['id'])) {
$msg['fspam'] = $filter->spamFiltr(str_replace('точка', '.', str_replace('ру', 'ru', $_POST['msg'])));
@ -415,10 +405,8 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
);
}
}
unset($admq);
} else {
unset($admq);
}
unset($admq);
}
$qix = mysql_fetch_array(
@ -509,36 +497,19 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
$i++;
}
$msg['nosee'] = 0;
if ($u->info['level'] < 1) {
$msg['nosee'] = round($u->info['host_reg']);
if ($msg['nosee'] == 0) {
$msg['nosee'] = -1;
$r['js'] .= 'chat.sendMsg(["new","' . time(
) . '","6","","' . $u->info['login'] . '","<small><b>В целях борьбы против рекламы, общение в чате доступно с 8-го уровня.</b> </small>","red","1","1","0"]);';
}
}
//todo: внимательно перебрать логику, возможно есть ненужные\дефолтные поля.
$cmsg = new ChatMessage();
$cmsg->setNosee($msg['nosee']);
$cmsg->setInvis($u->info['invis']);
$cmsg->setDa($msg['da']);
$cmsg->setDelete($msg['delete']);
$cmsg->setMolch($msg['molch']);
$cmsg->setLogin($msg['login']);
$cmsg->setLogin($u->info['login']);
$cmsg->setTo($msg['to']);
$cmsg->setCity($u->info['city']);
$cmsg->setRoom($u->info['room']);
$cmsg->setTime($msg['time']);
$cmsg->setType($msg['type']);
$cmsg->setSpam($msg['spam']);
$cmsg->setText($_POST['msg']);
$cmsg->setToChat($msg['toChat']);
$cmsg->setColor($msg['color']);
$cmsg->setTypeTime($msg['typeTime']);
$cmsg->setSound($msg['sound']);
$cmsg->setGlobal($msg['global']);
$cmsg->setColor($u->info['chatColor']);
$chat->sendMsg($cmsg);
}