Added extra skip/restart/add commands and added timedifferences to LocalRecords

This commit is contained in:
Max Klaversma
2014-04-19 00:16:19 +02:00
committed by Steffen Schröder
parent 0b9838f0fb
commit 69df3bc84f
2 changed files with 9 additions and 4 deletions

View File

@ -281,12 +281,16 @@ class LocalRecordsPlugin implements CallbackListener, CommandListener, TimerList
$notifyOnlyDriver = $this->maniaControl->settingManager->getSetting($this, self::SETTING_NOTIFY_ONLY_DRIVER);
$notifyOnlyBestRecords = $this->maniaControl->settingManager->getSetting($this, self::SETTING_NOTIFY_BEST_RECORDS);
if ($notifyOnlyDriver || $notifyOnlyBestRecords > 0 && $newRecord->rank > $notifyOnlyBestRecords) {
$improvement = ((!$oldRecord || $newRecord->rank < $oldRecord->rank) ? 'gained the' : 'improved Your');
$improvement = ((!$oldRecord || $newRecord->rank < $oldRecord->rank) ? 'gained the' : 'improved your');
$message = 'You ' . $improvement . ' $<$o' . $newRecord->rank . '.$> Local Record: ' . Formatter::formatTime($newRecord->time);
if($oldRecord) $oldRank = ($improvement == 'improved your') ? '' : $oldRecord->rank.'. ';
if($oldRecord) $message .= ' ('.$oldRank.'-'.Formatter::formatTime(($oldRecord->time-$newRecord->time)).')';
$this->maniaControl->chat->sendInformation($message, $player->login);
} else {
$improvement = ((!$oldRecord || $newRecord->rank < $oldRecord->rank) ? 'gained the' : 'improved the');
$message = '$<' . $player->nickname . '$> ' . $improvement . ' $<$o' . $newRecord->rank . '.$> Local Record: ' . Formatter::formatTime($newRecord->time);
if($oldRecord) $oldRank = ($improvement == 'improved the') ? '' : $oldRecord->rank.'. ';
if($oldRecord) $message .= ' ('.$oldRank.'-'.Formatter::formatTime(($oldRecord->time-$newRecord->time)).')';
$this->maniaControl->chat->sendInformation($message);
}
}