Resolved #151 MX Map update check failed

This commit is contained in:
kremsy 2017-06-21 19:06:26 +02:00
parent 652f46703b
commit ba67ea6911
2 changed files with 11 additions and 4 deletions

View File

@ -367,6 +367,8 @@ class DirectoryBrowser implements ManialinkPageAnswerListener {
$this->maniaControl->getMapManager()->getMXManager()->fetchManiaExchangeMapInformation($map);
$map->lastUpdate = time();
//Update Map Timestamp in Database
$this->maniaControl->getMapManager()->updateMapTimestamp($map->uid);
// Message
$message = $player->getEscapedNickname() . ' added ' . $map->getEscapedName() . '!';

View File

@ -215,12 +215,13 @@ class MapManager implements CallbackListener, CommunicationListener, UsageInform
* @param string $uid
* @return bool
*/
private function updateMapTimestamp($uid) {
public function updateMapTimestamp($uid) {
$mysqli = $this->maniaControl->getDatabase()->getMysqli();
//TODO mxid was set to 0, verify what for
$mapQuery = "UPDATE `" . self::TABLE_MAPS . "` SET
mxid = 0,
changed = NOW()
WHERE 'uid' = ?";
`changed` = NOW()
WHERE `uid` LIKE ?";
$mapStatement = $mysqli->prepare($mapQuery);
if ($mysqli->error) {
trigger_error($mysqli->error);
@ -471,7 +472,11 @@ class MapManager implements CallbackListener, CommunicationListener, UsageInform
$this->maniaControl->getChat()->sendError('Server Error!', $login);
return;
}
$map->lastUpdate = time();
//Update TimeStamp in Database
$this->updateMapTimestamp($mapInfo->uid);
//TODO messages for communication
if ($login) {