Реализация ChatMessageDTO.

This commit is contained in:
2023-01-28 04:24:37 +02:00
parent d9ec810f7f
commit 99b90a198b
105 changed files with 11492 additions and 10578 deletions
+13 -6
View File
@@ -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);
}
}
?>