Closes #35
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
<?php
|
||||
namespace Battles;
|
||||
use Battles\Models\EffectsModel;
|
||||
use Exceptions\GameException;
|
||||
|
||||
class UserInfo extends User
|
||||
{
|
||||
use Rooms;
|
||||
@@ -136,10 +139,10 @@ class UserInfo extends User
|
||||
$infoString = '<br><span>ИД Игрока: %s<br> ИД Комнаты: %s<br> Деньги: %s<br> Деньги в банке: %s<br> Опыт: %s<br> Нераспределённые очки: %s<br> Текущая сессия: %s</span>';
|
||||
echo sprintf($infoString, $this->id, $this->room, $this->money, $this->Bank->getMoney(), $this->experience, $this->free_stat_points, $this->session_id);
|
||||
}
|
||||
$this->UserLogs = new \Battles\Models\UserLogModel($this->id);
|
||||
$this->UserLogs = GameLogs::getUserLogs($this->id);
|
||||
echo '<div class="secret-info-user-log"><b>Личное дело</b><br>';
|
||||
while ($userLogRow = $this->UserLogs->getUserLog()->fetch_object()) {
|
||||
echo sprintf('<code>%s</code><br>', date("d.m.Y H:i ", strtotime($userLogRow->date)) . $userLogRow->text);
|
||||
while ($userLogRow = $this->UserLogs->fetchArray(SQLITE3_ASSOC)) {
|
||||
echo sprintf('<code>%s</code><br>', date("d.m.Y H:i ", strtotime($userLogRow['date'])) . $userLogRow['text']);
|
||||
}
|
||||
echo '</div><!-- secret-info-user-log -->';
|
||||
echo '</div><!-- secret-info -->';
|
||||
@@ -149,17 +152,17 @@ class UserInfo extends User
|
||||
public function showUserInfo()
|
||||
{
|
||||
$this->WatcherStatus();
|
||||
$effects = new \Battles\Models\EffectsModel($this->id);
|
||||
$effects = new EffectsModel($this->id);
|
||||
|
||||
if ($this->block && (!$this->watcherIsAdmin || !$this->watcherIsModerator)) {
|
||||
throw new \Exceptions\GameException('<span class="error">Персонаж ' . $this->login . ' заблокирован!</span>');
|
||||
throw new GameException('<span class="error">Персонаж ' . $this->login . ' заблокирован!</span>');
|
||||
} elseif ($effects->getHideUserInfoStatus() && (!$this->watcherIsAdmin || !$this->watcherIsModerator)) {
|
||||
if ($effects->getHideUserInfoStatus() == -1) {
|
||||
$date = 'навсегда';
|
||||
} else {
|
||||
$date = 'до' . date('d.m.Y', strtotime($effects->getHideUserInfoStatus()));
|
||||
}
|
||||
throw new \Exceptions\GameException('<span class="error">Персонаж ' . $this->login . ' обезличен ' . $date . '.</span>');
|
||||
throw new GameException('<span class="error">Персонаж ' . $this->login . ' обезличен ' . $date . '.</span>');
|
||||
} else {
|
||||
$this->Info();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user