public static function create()
 {
     $url = 'http://' . ACCOUNT_API_SERVER . ':' . ACCOUNT_API_PORT;
     $version = 8;
     $serverVer = new \ServerVersion($url, 'AccountAPI');
     $path = $serverVer->getVersionPath($version);
     if (is_null($path)) {
         throw new \BadFunctionCallException("api version {$version} not supported");
     }
     $proxy = new \HessianClient($url . $path);
     registerAccountMethods($url . $path);
     return $proxy;
 }
function connect()
{
    $url = 'http://192.168.10.1:9337';
    $version = 9;
    $serverVer = new ServerVersion($url, 'AccountAPI');
    $path = $serverVer->getVersionPath($version);
    if (is_null($path)) {
        echo "Supported versions are:\n";
        $versions = $serverVer->getSupportedVersions();
        print_r($versions);
        echo "\n";
        die("api version {$version} not supported");
    }
    $proxy = new HessianClient($url . $path);
    registerAccountMethods($url . $path);
    echo "Working with " . $url . $path . "\n";
    return $proxy;
}
 static function create()
 {
     $url = 'http://' . BILLING_API_SERVER . ':' . BILLING_API_PORT;
     $version = 3;
     $serverVer = new \ServerVersion($url, 'BillingServerAPI');
     $path = $serverVer->getVersionPath($version);
     if (is_null($path)) {
         error_log("Supported versions are:\n");
         $versions = $serverVer->getSupportedVersions();
         error_log(implode("|", $versions));
     }
     if (is_null($path)) {
         throw new \BadFunctionCallException("api version {$version} not supported");
     }
     $proxy = new \HessianClient($url . $path);
     registerBillingMethods($url . $path);
     return $proxy;
 }
<?php

require_once '../hessian/HessianClient.php';
require_once './collectionEditionApi.inc.php';
require_once './ServerVersion.inc.php';
$url = 'http://192.168.10.229:9359';
$version = 1;
echo "URL = {$url}\n";
$serverVer = new ServerVersion($url, 'CollectionEditionAPI');
$path = $serverVer->getVersionPath($version);
if (is_null($path)) {
    echo "Supported versions are:\n";
    $versions = $serverVer->getSupportedVersions();
    print_r($versions);
    echo "\n";
    die("api version {$version} not supported");
}
echo "Path = {$path}\n";
$proxy = new HessianClient($url . $path);
registerEditionMethods($url . $path);
$result = $proxy->getCollectionEditions();
echo "\n\n=== Editions:\n\n";
var_export($result);
echo "\n\n=== Add Edition:\n\n";
$result = $proxy->addEdition(1, "Example collection edition");
echo "\n\n=== Remove Edition:\n\n";
$result = $proxy->removeEdition(1);
echo "\n\n=== Editions:\n\n";
var_export($result);
$result = $proxy->getCollectionEditions();
echo "\n\n=== Editions:\n\n";
Exemplo n.º 5
0
<?php

require_once '../hessian/HessianClient.php';
require_once './gametool.inc.php';
require_once './ServerVersion.inc.php';
$url = 'http://localhost:8088/gametool';
// gametool is protected by username/pwd
$options = array('username' => 'admin', 'password' => '1');
$version = 5;
$serverVer = new ServerVersion($url, 'hessian/account.api', $options);
$path = $serverVer->getVersionPath($version);
if (empty($path)) {
    die("Failed to determine path to account api version {$version}");
}
$proxy = new HessianClient($url . $path, $options);
registerGametoolMethods($url . $path);
$shard = iconv('Windows-1251', 'UTF-8', "shard_gametool_тест");
$items = array();
$items[0] = new ItemToSend();
$items[0]->shard = $shard;
$items[0]->avatarId = 1;
$items[0]->itemResourceId = 2;
$items[0]->runeResourceId = 3;
$items[0]->stackCount = 4;
$items[0]->counter = 5;
$items[0]->senderName = "kolya";
$items[0]->subject = "Hellou";
$items[0]->body = "HowAreYou";
$items[1] = new ItemToSend();
$items[1]->shard = $shard;
$items[1]->avatarId = 2;