This commit is contained in:
2023-07-31 20:06:51 +03:00
109 changed files with 15204 additions and 33584 deletions
+46 -76
View File
@@ -200,8 +200,7 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
//Молчанка за флуд на 5 минут
$u->info['molch1'] = time() + 1200;
$r['js'] .= 'chat.sendMsg(["new","' . time(
) . '","6","","' . $u->info['login'] . '","<small>Вы наказаны за спам на 20 минут </small>","Black","1","1","0"]);';
$r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>Вы наказаны за спам на 20 минут </small>","Black","1","1","0"]);';
Db::sql('update users set molch1 = ? where id = ?', [$u->info['molch1'], $u->info['id']]);
Db::sql('update chat set `delete` = 1 where login = ?', [$u->info['login']]);
@@ -211,11 +210,11 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
$training_manager = TrainingManager::getInstance();
$training_manager->addPoint('chat_first_quest');
if(preg_match("/to\[(.*?)\]/", $_POST['msg'])) {
if (preg_match("/to\[(.*?)\]/", $_POST['msg'])) {
$training_manager->addPoint('chat_second_quest');
}
if(preg_match("/private\[(.*?)\]/", $_POST['msg'])) {
if (preg_match("/private\[(.*?)\]/", $_POST['msg'])) {
$training_manager->addPoint('chat_third_quest');
}
@@ -235,13 +234,11 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
$chat->sendMsg($cmsg);
}
} elseif ($lmg > 0) {
$r['js'] .= 'chat.sendMsg(["new","' . time(
) . '","6","","' . $u->info['login'] . '","<small>Вы не можете отправлять так часто сообщения... </small>","Black","1","1","0"]);';
$r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>Вы не можете отправлять так часто сообщения... </small>","Black","1","1","0"]);';
if ($u->info['molch1'] < time()) {
if ($u->info['molch1'] < -5) {
$u->info['molch1'] = time() + 300;
$r['js'] .= 'chat.sendMsg(["new","' . time(
) . '","6","","' . $u->info['login'] . '","<small>Вы наказаны за флуд на 5 минут </small>","Black","1","1","0"]);';
$r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>Вы наказаны за флуд на 5 минут </small>","Black","1","1","0"]);';
} elseif ($u->info['molch1'] < 0) {
$u->info['molch1']--;
} else {
@@ -254,8 +251,7 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
} elseif ((preg_match("/private\[(.*?)\]/", $_POST['msg'], $msg['to']) || preg_match(
"/private \[(.*?)\]/", $_POST['msg'], $msg['to']
)) && $u->info['exp'] < 150000) {
$r['js'] .= 'chat.sendMsg(["new","' . time(
) . '","6","","' . $u->info['login'] . '","<small>Вы не можете отправлять приват до достижения 150000 опыта.</small>","Black","1","1","0"]);';
$r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>Вы не можете отправлять приват до достижения 150000 опыта.</small>","Black","1","1","0"]);';
} else {
//Записываем данные
@@ -297,8 +293,7 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
if ($msg['fspam'] != '0') {
$msg['spam'] = 1;
$msg['delete'] = 1;
$r['js'] .= 'chat.sendMsg(["new","' . time(
) . '","6","","' . $u->info['login'] . '","<small>В нашем чате запрещается сообщать ссылки на атльтернативные проекты. Повторные попытки могут привести к блокировке персонажа.</small>","Black","1","1","0"]);';
$r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>В нашем чате запрещается сообщать ссылки на атльтернативные проекты. Повторные попытки могут привести к блокировке персонажа.</small>","Black","1","1","0"]);';
}
if ($msg['spam'] == 1 && $u->info['molch1'] < time() && $u->info['admin'] == 0) {
@@ -320,11 +315,9 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
if ($mban['vals'] + 1 < 2) {
$msg['fspam'] = str_replace('%', '</b>,<b>', $msg['fspam']);
$msg['fspam'] = '<b>' . ltrim($msg['fspam'], '0</b>,<b>') . '</b>';
$r['js'] .= 'chat.sendMsg(["new","' . time(
) . '","6","","' . $u->info['login'] . '","<small>В нашем чате запрещается сообщать ссылки на атльтернативные проекты. Запрещенные слова: ' . $msg['fspam'] . '. Предупреждения [' . ($mban['vals'] + 1) . '/1]</small>","Black","1","1","0"]);';
$r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>В нашем чате запрещается сообщать ссылки на атльтернативные проекты. Запрещенные слова: ' . $msg['fspam'] . '. Предупреждения [' . ($mban['vals'] + 1) . '/1]</small>","Black","1","1","0"]);';
} else {
$r['js'] .= 'chat.sendMsg(["new","' . time(
) . '","6","","' . $u->info['login'] . '","<small>В нашем чате запрещается сообщать ссылки на атльтернативные проекты. Вы наказаны за нарушение правил общения.</small>","Black","1","1","0"]);';
$r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>В нашем чате запрещается сообщать ссылки на атльтернативные проекты. Вы наказаны за нарушение правил общения.</small>","Black","1","1","0"]);';
$cmsg = new ChatMessage();
$cmsg->setCity($u->info['city']);
@@ -342,8 +335,7 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
WHERE `id` = ' . $u->info['id']);
$rtxt = $rang . ' &quot;' . $u->info['login'] . '&quot; <small><font color=red>Автоинформатор</font></small>: ' . $msg['text'] . ' [' . $msg['fspam'] . '].';
mysql_query(
"INSERT INTO `users_delo` (`uid`,`ip`,`city`,`time`,`text`,`login`,`type`) VALUES ('" . $u->info['id'] . "','" . $_SERVER['REMOTE_ADDR'] . "','" . $u->info['city'] . "','" . time(
) . "','" . $rtxt . "','" . $u->info['login'] . "',0)"
"INSERT INTO `users_delo` (`uid`,`ip`,`city`,`time`,`text`,`login`,`type`) VALUES ('" . $u->info['id'] . "','" . $_SERVER['REMOTE_ADDR'] . "','" . $u->info['city'] . "','" . time() . "','" . $rtxt . "','" . $u->info['login'] . "',0)"
);
}
}
@@ -359,16 +351,14 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
)
);
if (isset($qix['id'])) {
$r['js'] .= 'chat.sendMsg(["new","' . time(
) . '","6","","' . $u->info['login'] . '","<b>Вас добавили в игнор</b>: Вы не можете отправлять сообщения персонажу &quot;' . htmlspecialchars(
$r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<b>Вас добавили в игнор</b>: Вы не можете отправлять сообщения персонажу &quot;' . htmlspecialchars(
$msg['to']
) . '&quot;.","Black","1","1","0"]);';
$msg['cancel']++;
}
if ($msg['type'] == 3 && $msg['to'] == 'klan') {
if ($u->info['clan'] == 0) {
$r['js'] .= 'chat.sendMsg(["new","' . time(
) . '","6","","' . $u->info['login'] . '","<small>Вы не являетесь частью одного из <b>Кланов</b> и не можете общаться по этому каналу.</small>","Black","1","1","0"]);';
$r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>Вы не являетесь частью одного из <b>Кланов</b> и не можете общаться по этому каналу.</small>","Black","1","1","0"]);';
$msg['cancel']++;
} else {
$msg['to'] = 'k' . $u->info['clan'];
@@ -408,8 +398,7 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
$msg['to'] = '';
$msg['type'] = 21;
if ($msw == 'USER IS FALSE') {
$r['js'] .= 'chat.sendMsg(["new","' . time(
) . '","6","","' . $u->info['login'] . '","<small>Персонажа нет в данной комнате.</small>","Black","1","1","0"]);';
$r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>Персонажа нет в данной комнате.</small>","Black","1","1","0"]);';
$nosend = 1;
}
} elseif ($chat->str_count($_POST['msg'], 3) == '/e ') {
@@ -689,62 +678,45 @@ $sp = mysql_query(
'SELECT `nosee`,`frv`,`id`,`dn`,`active`,`invis`,`login`,`to`,`city`,`room`,`time`,`type`,`spam`,`text`,`toChat`,`color`,`typeTime`,`sound`,`global`,`delete`,`molch`,`da` FROM `chat` WHERE
(
(
`delete` > 0
AND
`delete` > 0 AND
`time` > ' . (time() - 360) . '
)
OR
) OR
(
`time` > ' . (time() - 120) . '
OR
(
`time` = -1
AND
(
`to` = "' . $u->info['login'] . '"
OR
`type` = 8
)
)
OR
(
`time` < -1
AND
`time` > -' . time() . '
AND
(
`to` = "' . $u->info['login'] . '"
OR
`type` = 8
OR
`to` = ""
)
)
)
)
AND
`new` = "1"
AND
(
`id` > ' . ((int)$_POST['mid']) . '
OR
`delete` > 0
OR
`spam` > 0
OR
`time` > ' . (time() - 120) . ' OR
(
`time` < 0
AND
`time` > -' . time() . '
AND
`time` = -1 AND
(
`to` = "' . $u->info['login'] . '"
OR
`to` = "' . $u->info['login'] . '" OR
`type` = 8
)
) OR
(
`time` < -1 AND
`time` > -' . time() . ' AND
(
`to` = "' . $u->info['login'] . '" OR
`type` = 8 OR
`to` = ""
)
)
)
ORDER BY `id` ASC'
)
AND
`new` = "1" AND
(
`id` > ' . ((int)$_POST['mid']) . ' OR
`delete` > 0 OR
`spam` > 0 OR
(
`time` < 0 AND
`time` > -' . time() . ' AND
(
`to` = "' . $u->info['login'] . '" OR
`to` = ""
)
)
)
ORDER BY `id`'
);
while ($pl = mysql_fetch_array($sp)) {
@@ -932,8 +904,7 @@ while ($pl = mysql_fetch_array($sp)) {
if (isset($lmsch['id'])) {
$lmsch['id']++;
mysql_query(
'UPDATE `chat` SET `id` = "' . $lmsch['id'] . '",`time` = "' . time(
) . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'
'UPDATE `chat` SET `id` = "' . $lmsch['id'] . '",`time` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'
);
$pl['id'] = $lmsch['id'];
} else {
@@ -1049,8 +1020,7 @@ if ($r['key'] == $_GET['key']) {
$posts = mysql_fetch_array(
mysql_query(
'SELECT COUNT(`id`) FROM `items_users` AS `iu` WHERE `iu`.`uid` = "-51' . $u->info['id'] . '" AND `iu`.`delete` = 0 AND `iu`.`inOdet` = 0 AND `iu`.`inShop` = 0 AND `iu`.`lastUPD` < ' . time(
) . ' LIMIT 1'
'SELECT COUNT(`id`) FROM `items_users` AS `iu` WHERE `iu`.`uid` = "-51' . $u->info['id'] . '" AND `iu`.`delete` = 0 AND `iu`.`inOdet` = 0 AND `iu`.`inShop` = 0 AND `iu`.`lastUPD` < ' . time() . ' LIMIT 1'
)
);
$posts = $posts[0];