restored external formatting

This commit is contained in:
kremsy 2015-01-12 13:39:49 +01:00
parent f9c47377ac
commit 5c6f2252c2

View File

@ -7,9 +7,12 @@
namespace Maniaplanet\DedicatedServer\Xmlrpc; namespace Maniaplanet\DedicatedServer\Xmlrpc;
class FaultException extends Exception { class FaultException extends Exception
static function create($faultString, $faultCode) { {
switch ($faultString) { static function create($faultString, $faultCode)
{
switch($faultString)
{
case 'Password incorrect.': case 'Password incorrect.':
case 'Permission denied.': case 'Permission denied.':
return new AuthenticationException($faultString, $faultCode); return new AuthenticationException($faultString, $faultCode);
@ -87,55 +90,26 @@ class FaultException extends Exception {
case 'Invalid url.': case 'Invalid url.':
return new FileException($faultString, $faultCode); return new FileException($faultString, $faultCode);
} }
if (preg_match('~^Unknown setting \'.*\'\.$~iu', $faultString)) { if(preg_match('~^Unknown setting \'.*\'\.$~iu', $faultString))
return new GameModeException($faultString, $faultCode); return new GameModeException($faultString, $faultCode);
} if(preg_match('~^Couldn\'t load \'.*\'\.$~iu', $faultString))
if (preg_match('~^Couldn\'t load \'.*\'\.$~iu', $faultString)) {
return new FileException($faultString, $faultCode); return new FileException($faultString, $faultCode);
}
return new self($faultString, $faultCode); return new self($faultString, $faultCode);
} }
} }
class AuthenticationException extends FaultException { class AuthenticationException extends FaultException {}
} class UnavailableFeatureException extends FaultException {}
class LockedFeatureException extends FaultException {}
class UnavailableFeatureException extends FaultException { class UnknownPlayerException extends FaultException {}
} class PlayerStateException extends FaultException {}
class AlreadyInListException extends FaultException {}
class LockedFeatureException extends FaultException { class NotInListException extends FaultException {}
} class IndexOutOfBoundException extends FaultException {}
class NextMapException extends FaultException{}
class UnknownPlayerException extends FaultException { class ChangeInProgressException extends FaultException {}
} class InvalidMapException extends FaultException{}
class GameModeException extends FaultException {}
class PlayerStateException extends FaultException { class ServerOptionsException extends FaultException {}
} class FileException extends FaultException {}
class AlreadyInListException extends FaultException {
}
class NotInListException extends FaultException {
}
class IndexOutOfBoundException extends FaultException {
}
class NextMapException extends FaultException {
}
class ChangeInProgressException extends FaultException {
}
class InvalidMapException extends FaultException {
}
class GameModeException extends FaultException {
}
class ServerOptionsException extends FaultException {
}
class FileException extends FaultException {
}