From 88dd18428bafa834eca96d2c3ed70e8db6ad07d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20Schro=CC=88der?= Date: Wed, 30 Apr 2014 05:42:27 +0200 Subject: [PATCH] fixed and resolved todos --- .../core/ManiaExchange/ManiaExchangeManager.php | 12 ++++++++---- application/core/Update/UpdateManager.php | 2 ++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/application/core/ManiaExchange/ManiaExchangeManager.php b/application/core/ManiaExchange/ManiaExchangeManager.php index 9b3e0170..f2cbe9d8 100644 --- a/application/core/ManiaExchange/ManiaExchangeManager.php +++ b/application/core/ManiaExchange/ManiaExchangeManager.php @@ -74,9 +74,11 @@ class ManiaExchangeManager { trigger_error($mysqli->error); return; } + $saveMapStatement->bind_param('is', $mapMxId, $mapUId); foreach($mxMapInfos as $mxMapInfo) { /** @var MXMapInfo $mxMapInfo */ - $saveMapStatement->bind_param('is', $mxMapInfo->id, $mxMapInfo->uid); + $mapMxId = $mxMapInfo->id; + $mapUId = $mxMapInfo->uid; $saveMapStatement->execute(); if ($saveMapStatement->error) { trigger_error($saveMapStatement->error); @@ -89,9 +91,11 @@ class ManiaExchangeManager { $uid = $mxMapInfo->uid; } $map = $this->maniaControl->mapManager->getMapByUid($uid); - - /** @var Map $map */ - $map->mx = $mxMapInfo; + if ($map) { + // TODO: how does it come that $map can be empty here? we got an error report for that + /** @var Map $map */ + $map->mx = $mxMapInfo; + } } $saveMapStatement->close(); } diff --git a/application/core/Update/UpdateManager.php b/application/core/Update/UpdateManager.php index 52cd8e10..a3d638ad 100644 --- a/application/core/Update/UpdateManager.php +++ b/application/core/Update/UpdateManager.php @@ -537,6 +537,8 @@ class UpdateManager implements CallbackListener, CommandListener, TimerListener $self->maniaControl->log('[UPDATE] Successfully updated ' . $pluginData->name . '!'); if ($player) { $self->maniaControl->chat->sendSuccess('Successfully updated ' . $pluginData->name . '!', $player->login); + // FIXME: the property $pluginData->pluginClass doesn't exist + // TODO: to update a plugin you need to restart maniacontrol, otherwise the new file isn't loaded by php $self->maniaControl->pluginManager->deactivatePlugin($pluginData->pluginClass); $self->maniaControl->pluginManager->activatePlugin($pluginData->pluginClass);