From c076a46078cd593ff85a98d2a51139e12ecd0909 Mon Sep 17 00:00:00 2001 From: Keir Nellyer Date: Wed, 29 Jun 2016 22:13:13 -0400 Subject: [PATCH] Show all involved users correctly --- Plugins/Mineplex.ReportServer/web/view.php | 28 ++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/Plugins/Mineplex.ReportServer/web/view.php b/Plugins/Mineplex.ReportServer/web/view.php index 7891fd4f3..8458bf8a7 100644 --- a/Plugins/Mineplex.ReportServer/web/view.php +++ b/Plugins/Mineplex.ReportServer/web/view.php @@ -262,6 +262,24 @@ function getReporters($reportId) return $reportReasons; } +/** + * @param Snapshot $snapshot + * @param Report $report + * @return User[] + */ +function getInvolvedUsers($snapshot, $report) +{ + $involvedUsers = $snapshot->getPlayers(); + $involvedUsers[$report->getSuspect()->getId()] = $report->getSuspect(); + + /** @var User $reporter */ + foreach ($report->getReporters() as $reporter) { + $involvedUsers[$reporter->getId()] = $reporter; + } + + return $involvedUsers; +} + /** * @param Message $messageA * @param Message $messageB @@ -422,6 +440,8 @@ if ($validId) $reporterUsernames[count($reporterUsernames)] = $reporter->getUsername(); } + $involvedUsers = getInvolvedUsers($snapshot, $report); + // TODO Calculate time since last report // TODO actually calculate time $lastReportTime = new DateTime('1999-01-12'); @@ -487,10 +507,10 @@ if ($validId)

   Users


- getPlayers() as $player): ?> - -   getUsername() ?> getRank() ?>
  - getUUID() ?> + + +   getUsername() ?> getRank() ?>
  + getUUID() ?>