public function actionTest()
 {
     $serverList = $this->_getGlobalData('gameser_list');
     $server = $serverList[$_REQUEST['server_id']]['server_url'] . 'rpc/user';
     $phprpcPath = LIB_PATH . '/phprpc/phprpc_client.php';
     if (!file_exists($phprpcPath)) {
         throw new Error('phprpc libs not exist');
     }
     include_once $phprpcPath;
     $phpRpc = new PHPRPC_Client();
     $phpRpc->useService($server);
     $phpRpc->setProxy(null);
     //设置代理
     $phpRpc->setEncryptMode(0);
     $phpRpc->setCharset('UTF-8');
     $phpRpc->setTimeout(10);
     $phpRpc->setPrivateKey('test');
     $dataList = $phpRpc->getInfo('wcj');
     print_r($dataList);
 }
Exemple #2
0
 public function setPrivateKey($Key)
 {
     $this->_phpRpc->setPrivateKey($Key);
 }