From c402e1231a9f85fe7b94712370378318a9ed73e1 Mon Sep 17 00:00:00 2001 From: kremsy Date: Mon, 22 May 2017 17:53:31 +0200 Subject: [PATCH] added some dedimania debugging information --- plugins/MCTeam/Dedimania/DedimaniaWebHandler.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins/MCTeam/Dedimania/DedimaniaWebHandler.php b/plugins/MCTeam/Dedimania/DedimaniaWebHandler.php index 05c9ec5f..2d093b69 100644 --- a/plugins/MCTeam/Dedimania/DedimaniaWebHandler.php +++ b/plugins/MCTeam/Dedimania/DedimaniaWebHandler.php @@ -114,12 +114,21 @@ class DedimaniaWebHandler implements TimerListener { $data = array($this->dedimaniaData->sessionId, $mapInfo, $gameMode, $serverInfo, $playerInfo); $content = $this->encodeRequest(self::DEDIMANIA_GET_RECORDS, $data); + Logger::logInfo("Try to fetch Dedimania Records"); + $asyncHttpRequest = new AsyncHttpRequest($this->maniaControl, self::DEDIMANIA_URL); $asyncHttpRequest->setCallable(function ($data, $error) { + if (!$data || $error) { + Logger::logError("Dedimania Error while fetching records '{$error}'"); + return; + } + $data = $this->decode($data); //Data[0][0] can be false in error case like map has no checkpoints if (!is_array($data) || empty($data) || !isset($data[0]) || !isset($data[0][0]) || $data[0][0] == false) { + Logger::logError("Dedimania Get Records, invalid response or no checkpoints"); + Logger::log(json_encode($data)); return; }