Реализация ChatMessageDTO.
This commit is contained in:
@@ -51,12 +51,21 @@ if (isset($_GET['getq'])) {
|
||||
mysql_query(
|
||||
'INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `ip`, `vals`, `val`) VALUES (' . $u->info['id'] . ',unix_timestamp(),\'capitalcity\',421,\'day_quest\',\'\',' . $zadID . ',' . $u->info['exp'] . ')'
|
||||
);
|
||||
mysql_query(
|
||||
"INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $u->info['city'] . "','" . $u->info['room'] . "','','" . $u->info['login'] . "','" . $txt . "','-1','6','0')"
|
||||
);
|
||||
sendSysChat($txt);
|
||||
}
|
||||
}
|
||||
|
||||
function sendSysChat($message) {
|
||||
global $u;
|
||||
$cmsg = new ChatMessage();
|
||||
$cmsg->setCity($u->info['city']);
|
||||
$cmsg->setRoom($u->info['room']);
|
||||
$cmsg->setTo($u->info['login']);
|
||||
$cmsg->setType(6);
|
||||
$cmsg->setText($message);
|
||||
(new Chat())->sendMsg($cmsg);
|
||||
}
|
||||
|
||||
function giveDailyQuestPrize()
|
||||
{
|
||||
global $u;
|
||||
@@ -182,9 +191,7 @@ if (isset($_GET['putq'])) {
|
||||
} else {
|
||||
$txt .= '<b style="color: red">Эх шустрый малец, получал задание уже сегодня! Завтра приходи накормлю чем нибудь вкусным ну и задание дам!</b>';
|
||||
}
|
||||
mysql_query(
|
||||
"INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $u->info['city'] . "','" . $u->info['room'] . "','','" . $u->info['login'] . "','" . $txt . "','-1','6','0')"
|
||||
);
|
||||
sendSysChat($txt);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user