\n";
echo "\n
\n";
echo "\tTrackmania methods\n";
echo "\n\n";
echo "Available methods:
\n";
$client = new IXR_Client_Gbx;
if (!$client->Init(5000)) {
die('An error occurred - ' . $client->getErrorCode() . ':' . $client->getErrorMessage());
}
if (!$client->query('system.listMethods')) {
die('An error occurred - ' . $client->getErrorCode() . ':' . $client->getErrorMessage());
}
$methods = $client->getResponse();
print '';
foreach ($methods as $m) {
print '- ' . $m . "
\n";
if ($client->query('system.methodSignature', $m)) {
$signatures = $client->getResponse();
} else {
print "{error in signature}
\n";
$signatures = array();
}
if ($client->query('system.methodHelp', $m)) {
$help = $client->getResponse();
} else {
$help = "{no help}";
}
foreach ($signatures as $sig) {
$is_retval = 1;
$is_firstarg = 1;
foreach ($sig as $argtype) {
if ($is_retval) {
print $argtype . ' ' . $m . '(';
$is_retval = 0;
} else {
if (!$is_firstarg) {
print ', ';
}
print $argtype;
$is_firstarg = 0;
}
}
print ")
\n";
}
print "";
print $help;
print " \n";
}
print '
';
$client->Terminate();
echo "\n\n\n";
flush();
?>