From d0bd5b40c30014b77902cab9994141983791cdcd Mon Sep 17 00:00:00 2001 From: kremsy Date: Sun, 9 Feb 2014 13:05:59 +0100 Subject: [PATCH] usage reporter update --- application/core/Server/UsageReporter.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/application/core/Server/UsageReporter.php b/application/core/Server/UsageReporter.php index 71c05bec..4a7df9e7 100644 --- a/application/core/Server/UsageReporter.php +++ b/application/core/Server/UsageReporter.php @@ -56,11 +56,17 @@ class UsageReporter implements TimerListener { $properties['PlayerCount'] = $this->maniaControl->playerManager->getPlayerCount(); try { - $maxPlayers = $this->maniaControl->client->getMaxPlayers(); - $properties['MaxPlayers'] = $maxPlayers["CurrentValue"]; - $properties['ScriptName'] = $this->maniaControl->client->getScriptName(); + $maxPlayers = $this->maniaControl->client->getMaxPlayers(); + $properties['MaxPlayers'] = $maxPlayers["CurrentValue"]; } catch(\Exception $e) { - //do nothing + $properties['MaxPlayers'] = -1; + } + + try { + $scriptName = $this->maniaControl->client->getScriptName(); + $properties['ScriptName'] = $scriptName["CurrentValue"]; + } catch(\Exception $e) { + $properties['ScriptName'] = ''; } $json = json_encode($properties);