fixed and resolved todos

This commit is contained in:
Steffen Schröder 2014-04-30 05:42:27 +02:00
parent 4b2e96a992
commit 88dd18428b
2 changed files with 10 additions and 4 deletions

View File

@ -74,9 +74,11 @@ class ManiaExchangeManager {
trigger_error($mysqli->error); trigger_error($mysqli->error);
return; return;
} }
$saveMapStatement->bind_param('is', $mapMxId, $mapUId);
foreach($mxMapInfos as $mxMapInfo) { foreach($mxMapInfos as $mxMapInfo) {
/** @var MXMapInfo $mxMapInfo */ /** @var MXMapInfo $mxMapInfo */
$saveMapStatement->bind_param('is', $mxMapInfo->id, $mxMapInfo->uid); $mapMxId = $mxMapInfo->id;
$mapUId = $mxMapInfo->uid;
$saveMapStatement->execute(); $saveMapStatement->execute();
if ($saveMapStatement->error) { if ($saveMapStatement->error) {
trigger_error($saveMapStatement->error); trigger_error($saveMapStatement->error);
@ -89,9 +91,11 @@ class ManiaExchangeManager {
$uid = $mxMapInfo->uid; $uid = $mxMapInfo->uid;
} }
$map = $this->maniaControl->mapManager->getMapByUid($uid); $map = $this->maniaControl->mapManager->getMapByUid($uid);
if ($map) {
/** @var Map $map */ // TODO: how does it come that $map can be empty here? we got an error report for that
$map->mx = $mxMapInfo; /** @var Map $map */
$map->mx = $mxMapInfo;
}
} }
$saveMapStatement->close(); $saveMapStatement->close();
} }

View File

@ -537,6 +537,8 @@ class UpdateManager implements CallbackListener, CommandListener, TimerListener
$self->maniaControl->log('[UPDATE] Successfully updated ' . $pluginData->name . '!'); $self->maniaControl->log('[UPDATE] Successfully updated ' . $pluginData->name . '!');
if ($player) { if ($player) {
$self->maniaControl->chat->sendSuccess('Successfully updated ' . $pluginData->name . '!', $player->login); $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->deactivatePlugin($pluginData->pluginClass);
$self->maniaControl->pluginManager->activatePlugin($pluginData->pluginClass); $self->maniaControl->pluginManager->activatePlugin($pluginData->pluginClass);