dev-lopar-chat-fixes #43

Merged
lopar merged 3 commits from dev-lopar-chat-fixes into dev 2023-02-02 15:43:15 +00:00
5 changed files with 3 additions and 8 deletions
Showing only changes of commit 00c76de9d5 - Show all commits

View File

@ -395,8 +395,9 @@ class ChatMessage
{ {
$params = json_decode($json, true); $params = json_decode($json, true);
foreach ($params as $param => $value) { foreach ($params as $param => $value) {
if (property_exists($this, $param)) { $method = 'set' . ucfirst($param);
$this->$param = $value; if (method_exists(self::class, $method)) {
$this->$method($value);
} }
} }
} }

View File

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

View File

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

View File

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

View File

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