use of dedicatedserver api

This commit is contained in:
kremsy
2014-01-16 16:56:24 +01:00
committed by Steffen Schröder
parent a404edf280
commit 13fe48e4ce
28 changed files with 5988 additions and 0 deletions

View File

@ -0,0 +1,47 @@
<?php
/**
* ManiaPlanet dedicated server Xml-RPC client
*
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
*/
// TODO XMLRPCLib: remettre les credits
namespace Maniaplanet\DedicatedServer\Xmlrpc;
if (!defined('LF')) define('LF', "\n");
class ClientMulticall extends Client
{
public $calls = array();
function addCall($methodName, $args)
{
$struct = array('methodName' => $methodName, 'params' => $args);
$this->calls[] = $struct;
return (count($this->calls) - 1);
}
function multiquery()
{
$result = array();
if(count($this->calls))
{
$result = parent::query('system.multicall', $this->calls);
$this->calls = array(); // reset for next calls
}
return $result;
}
function multiqueryIgnoreResult()
{
if(count($this->calls))
{
parent::queryIgnoreResult('system.multicall', $this->calls);
$this->calls = array(); // reset for next calls
}
}
}
?>