Resolved #151 MX Map update check failed
This commit is contained in:
parent
652f46703b
commit
ba67ea6911
@ -367,6 +367,8 @@ class DirectoryBrowser implements ManialinkPageAnswerListener {
|
|||||||
$this->maniaControl->getMapManager()->getMXManager()->fetchManiaExchangeMapInformation($map);
|
$this->maniaControl->getMapManager()->getMXManager()->fetchManiaExchangeMapInformation($map);
|
||||||
|
|
||||||
$map->lastUpdate = time();
|
$map->lastUpdate = time();
|
||||||
|
//Update Map Timestamp in Database
|
||||||
|
$this->maniaControl->getMapManager()->updateMapTimestamp($map->uid);
|
||||||
|
|
||||||
// Message
|
// Message
|
||||||
$message = $player->getEscapedNickname() . ' added ' . $map->getEscapedName() . '!';
|
$message = $player->getEscapedNickname() . ' added ' . $map->getEscapedName() . '!';
|
||||||
|
@ -215,12 +215,13 @@ class MapManager implements CallbackListener, CommunicationListener, UsageInform
|
|||||||
* @param string $uid
|
* @param string $uid
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
private function updateMapTimestamp($uid) {
|
public function updateMapTimestamp($uid) {
|
||||||
$mysqli = $this->maniaControl->getDatabase()->getMysqli();
|
$mysqli = $this->maniaControl->getDatabase()->getMysqli();
|
||||||
|
//TODO mxid was set to 0, verify what for
|
||||||
$mapQuery = "UPDATE `" . self::TABLE_MAPS . "` SET
|
$mapQuery = "UPDATE `" . self::TABLE_MAPS . "` SET
|
||||||
mxid = 0,
|
`changed` = NOW()
|
||||||
changed = NOW()
|
WHERE `uid` LIKE ?";
|
||||||
WHERE 'uid' = ?";
|
|
||||||
$mapStatement = $mysqli->prepare($mapQuery);
|
$mapStatement = $mysqli->prepare($mapQuery);
|
||||||
if ($mysqli->error) {
|
if ($mysqli->error) {
|
||||||
trigger_error($mysqli->error);
|
trigger_error($mysqli->error);
|
||||||
@ -471,7 +472,11 @@ class MapManager implements CallbackListener, CommunicationListener, UsageInform
|
|||||||
$this->maniaControl->getChat()->sendError('Server Error!', $login);
|
$this->maniaControl->getChat()->sendError('Server Error!', $login);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$map->lastUpdate = time();
|
$map->lastUpdate = time();
|
||||||
|
//Update TimeStamp in Database
|
||||||
|
$this->updateMapTimestamp($mapInfo->uid);
|
||||||
|
|
||||||
|
|
||||||
//TODO messages for communication
|
//TODO messages for communication
|
||||||
if ($login) {
|
if ($login) {
|
||||||
|
Loading…
Reference in New Issue
Block a user