added validation replay exception

This commit is contained in:
kremsy 2017-05-12 21:28:26 +02:00
parent 602cae563f
commit 8a3184c224
2 changed files with 11 additions and 3 deletions

View File

@ -22,6 +22,7 @@ class FaultException extends Exception {
case 'No map currently loaded.':
case 'No replay to save':
case 'Internal error.':
case 'Unable to retrieve validation data. ':
return new UnavailableFeatureException($faultString, $faultCode);
case 'You must enable the callbacks to be able to do chat routing.':
case 'Chat routing not enabled.':

View File

@ -22,6 +22,7 @@ use ManiaControl\Players\Player;
use ManiaControl\Players\PlayerManager;
use ManiaControl\Plugins\Plugin;
use ManiaControl\Utils\Formatter;
use Maniaplanet\DedicatedServer\Xmlrpc\UnavailableFeatureException;
/**
* ManiaControl Dedimania Plugin
@ -1096,11 +1097,17 @@ class DedimaniaPlugin implements CallbackListener, CommandListener, TimerListene
*/
private function setRecordReplays(RecordData &$record) {
// Set validation replay
try{
$validationReplay = $this->maniaControl->getServer()->getValidationReplay($record->login);
if ($validationReplay) {
$record->vReplay = $validationReplay;
}
}catch (UnavailableFeatureException $e){
Logger::logError("Unable to get Validation Replay from the Server");
}
// Set ghost replay
if ($record->rank <= 1) {
$dataDirectory = $this->maniaControl->getServer()->getDirectory()->getGameDataFolder();