2018-01-28 16:40:49 +00:00
|
|
|
|
<?
|
2021-08-26 14:44:14 +00:00
|
|
|
|
|
|
|
|
|
use Battles\GameLogs;
|
|
|
|
|
use Battles\Nick;
|
|
|
|
|
|
|
|
|
|
if (empty($_SESSION['uid'])) {
|
2020-09-30 12:01:33 +00:00
|
|
|
|
header("Location: index.php");
|
|
|
|
|
exit;
|
|
|
|
|
}
|
2020-09-30 12:30:00 +00:00
|
|
|
|
|
2018-01-28 16:40:49 +00:00
|
|
|
|
$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;"));
|
|
|
|
|
if ($user['battle']==0) {
|
|
|
|
|
echo'Нельзя использовать вне боя';
|
|
|
|
|
}
|
|
|
|
|
$_POST['target']=htmlspecialchars($_POST['target'], NULL, "");
|
|
|
|
|
if(preg_match("/__/",$_POST['target']) || preg_match("/--/",$_POST['target']))
|
|
|
|
|
{
|
|
|
|
|
echo"В тексте не должно присутствовать подряд более 1 символа '_' или '-'.";
|
|
|
|
|
}else{
|
|
|
|
|
$mess = $_POST['target'];
|
|
|
|
|
if ($user['sex'] == 1) {$action="выкрикнул";} else {$action="выкрикнула";}
|
2021-08-26 14:44:14 +00:00
|
|
|
|
GameLogs::addBattleLog($user['battle'],'<span class=sysdate>'.date("H:i").'</span> '.Nick::id($user['id'])->short().' '.$action.': '.$mess.'<BR>');
|
2018-01-28 16:40:49 +00:00
|
|
|
|
}
|