From 2d18062bee36bdc37f73f9cc2049511faacdeed6 Mon Sep 17 00:00:00 2001 From: kremsy Date: Sun, 9 Feb 2014 12:53:21 +0100 Subject: [PATCH] added scripttitle to usage reporter --- application/core/Server/UsageReporter.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/application/core/Server/UsageReporter.php b/application/core/Server/UsageReporter.php index 2a3c167b..15f5d997 100644 --- a/application/core/Server/UsageReporter.php +++ b/application/core/Server/UsageReporter.php @@ -54,9 +54,11 @@ class UsageReporter implements TimerListener { $properties['TitleId'] = $this->maniaControl->server->titleId; $properties['ServerName'] = $this->maniaControl->server->getName(); $properties['PlayerCount'] = $this->maniaControl->playerManager->getPlayerCount(); + try { - $maxPlayers = $this->maniaControl->client->getMaxPlayers(); - $properties['MaxPlayers'] = $maxPlayers["CurrentValue"]; + $maxPlayers = $this->maniaControl->client->getMaxPlayers(); + $properties['MaxPlayers'] = $maxPlayers["CurrentValue"]; + $properties['ScriptTitle'] = $this->maniaControl->client->getScriptName(); } catch(\Exception $e) { //do nothing } @@ -65,10 +67,10 @@ class UsageReporter implements TimerListener { $info = base64_encode($json); $this->maniaControl->fileReader->loadFile(UpdateManager::URL_WEBSERVICE . "/usagereport?info=" . $info, function ($response, $error) { - $response = json_decode($response); - if ($error || !$response) { - $this->maniaControl->log("Error while Sending data: " . $error); - } - }); + $response = json_decode($response); + if ($error || !$response) { + $this->maniaControl->log("Error while Sending data: " . $error); + } + }); } } \ No newline at end of file