From d701bb17e6d66e8891e852cf3fc1f60e07616fd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20Schro=CC=88der?= Date: Mon, 16 Dec 2013 08:38:35 +0100 Subject: [PATCH] map class nbCheckpoints improved --- application/core/Maps/Map.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/application/core/Maps/Map.php b/application/core/Maps/Map.php index 3f2c56e1..f211f15f 100644 --- a/application/core/Maps/Map.php +++ b/application/core/Maps/Map.php @@ -61,10 +61,12 @@ class Map { $this->copperPrice = $rpc_infos['CopperPrice']; $this->mapType = $rpc_infos['MapType']; $this->mapStyle = $rpc_infos['MapStyle']; - //$this->nbCheckpoints = $rpc_infos['NbCheckpoints']; //TODO check if key exists, only for trackmania - - $this->authorNick = $this->authorLogin; //initialize (if nick from map cant get readen) - + if (isset($rpc_infos['NbCheckpoints'])) { + $this->nbCheckpoints = $rpc_infos['NbCheckpoints']; + } + + $this->authorNick = $this->authorLogin; + $mapsDirectory = $this->maniaControl->server->getMapsDirectory(); if ($this->maniaControl->server->checkAccess($mapsDirectory)) { $this->mapFetcher = new \GBXChallMapFetcher(true); @@ -74,13 +76,13 @@ class Map { catch (\Exception $e) { trigger_error($e->getMessage(), E_USER_WARNING); } - + $this->authorNick = $this->mapFetcher->authorNick; $this->authorEInfo = $this->mapFetcher->authorEInfo; $this->authorZone = $this->mapFetcher->authorZone; $this->comment = $this->mapFetcher->comment; } - + // TODO: define timeout if mx is down $serverInfo = $this->maniaControl->server->getSystemInfo(); $title = strtoupper(substr($serverInfo['TitleId'], 0, 2));