From c7abd69caac61ee7d8fc4afc71a6f48ed7069256 Mon Sep 17 00:00:00 2001 From: Max Klaversma Date: Sat, 19 Apr 2014 01:59:49 +0200 Subject: [PATCH] Updated DedicatedServer lib with latest changes by NewBoo. --- .../DedicatedServer/Xmlrpc/FaultException.php | 26 +++++++++++++++++++ .../DedicatedServer/Xmlrpc/GbxRemote.php | 16 ------------ .../DedicatedServer/Xmlrpc/Request.php | 8 +++++- 3 files changed, 33 insertions(+), 17 deletions(-) create mode 100644 application/core/Libs/Maniaplanet/DedicatedServer/Xmlrpc/FaultException.php diff --git a/application/core/Libs/Maniaplanet/DedicatedServer/Xmlrpc/FaultException.php b/application/core/Libs/Maniaplanet/DedicatedServer/Xmlrpc/FaultException.php new file mode 100644 index 00000000..2c7e8aa0 --- /dev/null +++ b/application/core/Libs/Maniaplanet/DedicatedServer/Xmlrpc/FaultException.php @@ -0,0 +1,26 @@ + diff --git a/application/core/Libs/Maniaplanet/DedicatedServer/Xmlrpc/GbxRemote.php b/application/core/Libs/Maniaplanet/DedicatedServer/Xmlrpc/GbxRemote.php index 96618744..723cf152 100644 --- a/application/core/Libs/Maniaplanet/DedicatedServer/Xmlrpc/GbxRemote.php +++ b/application/core/Libs/Maniaplanet/DedicatedServer/Xmlrpc/GbxRemote.php @@ -302,20 +302,4 @@ class MessageException extends Exception const RESPONSE_TOO_LARGE = 2; } -class FaultException extends Exception -{ - static function create($faultString, $faultCode) - { - switch($faultString) - { - case 'Login unknown.': - return new LoginUnknownException($faultString, $faultCode); - } - - return new self($faultString, $faultCode); - } -} - -class LoginUnknownException extends FaultException {} - ?> diff --git a/application/core/Libs/Maniaplanet/DedicatedServer/Xmlrpc/Request.php b/application/core/Libs/Maniaplanet/DedicatedServer/Xmlrpc/Request.php index e9de8aa2..a3a69aff 100644 --- a/application/core/Libs/Maniaplanet/DedicatedServer/Xmlrpc/Request.php +++ b/application/core/Libs/Maniaplanet/DedicatedServer/Xmlrpc/Request.php @@ -11,6 +11,12 @@ if(extension_loaded('xmlrpc')) { abstract class Request { + private static $options = array( + 'encoding' => 'utf-8', + 'escaping' => 'markup', + 'verbosity' => 'no_white_space' + ); + /** * @param string $method * @param mixed[] $args @@ -18,7 +24,7 @@ if(extension_loaded('xmlrpc')) */ static function encode($method, $args) { - return xmlrpc_encode_request($method, $args, array('encoding' => 'utf-8', 'verbosity' => 'no_white_space')); + return xmlrpc_encode_request($method, $args, self::$options); } /**