master
elf 3 years ago
parent 3f5d16f0a5
commit 996b035844

@ -47,19 +47,19 @@ class GameResource
public function __construct($game) public function __construct($game)
{ {
$this->game = $game; $this->game = $game;
$this->client = $this->createClient(); $this->client = $this->createClient($game);
} }
private function createClient() private function createClient($game)
{ {
$clientClass = ''; $clientClass = '';
$gameId = intval($this->game['id']); $gameId = intval($game['id']);
if (isset($this->clientMap[$gameId])) { if (isset($this->clientMap[$gameId])) {
$clientClass = $this->clientMap[$gameId]; $clientClass = $this->clientMap[$gameId];
} else { } else {
throw new \Exception('游戏资源客户端未配置'); throw new \Exception('游戏资源客户端未配置');
} }
return new $clientClass(); return new $clientClass($game);
} }
public function getResourceTypes() public function getResourceTypes()

@ -23,7 +23,7 @@ class LeyouClient
'provide' => ['uri' => '/api/game/sendGold/zhuimeng/jxlm/57972', 'method' => 'post'], 'provide' => ['uri' => '/api/game/sendGold/zhuimeng/jxlm/57972', 'method' => 'post'],
]; ];
public function __construct() public function __construct($game = null)
{ {
$this->client = new Client([ $this->client = new Client([
'base_uri' => 'http://chat.leniu.com', 'base_uri' => 'http://chat.leniu.com',

@ -21,7 +21,7 @@ class LsxxClient
'provide' => ['uri' => '/wanmeng/prop.php?action=prop', 'method' => 'post'], 'provide' => ['uri' => '/wanmeng/prop.php?action=prop', 'method' => 'post'],
]; ];
public function __construct() public function __construct($game = null)
{ {
$this->client = new Client([ $this->client = new Client([
'base_uri' => 'http://47.114.91.166:1096', 'base_uri' => 'http://47.114.91.166:1096',

@ -23,7 +23,7 @@ class SbcqClient
'send-email' => ['uri' => 'sendemail', 'method' => 'post'], 'send-email' => ['uri' => 'sendemail', 'method' => 'post'],
]; ];
public function __construct() public function __construct($game = null)
{ {
$this->client = new Client([ $this->client = new Client([
'base_uri' => 'http://api.tlcq.90wqiji.com/wan/game/', 'base_uri' => 'http://api.tlcq.90wqiji.com/wan/game/',

@ -29,7 +29,7 @@ class XlqyClient
'send-props' => ['uri' => '/apip/payWM450S00/buyProp', 'method' => 'post'], 'send-props' => ['uri' => '/apip/payWM450S00/buyProp', 'method' => 'post'],
]; ];
public function __construct() public function __construct($game = null)
{ {
$this->client = new Client([ $this->client = new Client([
'base_uri' => 'http://xx2api.hnputihd.com', 'base_uri' => 'http://xx2api.hnputihd.com',

@ -16,13 +16,19 @@ class XyyClient
const SIGN_KEY = '51a447dc409b785af03e41a2d5014879'; const SIGN_KEY = '51a447dc409b785af03e41a2d5014879';
protected $client; protected $client;
private $platformId = 600;
private $apis = [ private $apis = [
'provide' => ['uri' => '/Api/Statis/sendgold', 'method' => 'post'], 'provide' => ['uri' => '/Api/Statis/sendgold', 'method' => 'post'],
]; ];
public function __construct() public function __construct($game = null)
{ {
if ($game && ($game['id'] == 293 || $game['id'] == 294)) {
$this->platformId = 602;
} else {
$this->platformId = 600;
}
$this->client = new Client([ $this->client = new Client([
'base_uri' => 'http://x3wm.dgcgame.com:82', 'base_uri' => 'http://x3wm.dgcgame.com:82',
'timeout' => 10.0, 'timeout' => 10.0,
@ -112,7 +118,7 @@ class XyyClient
public function apply($order, $role) public function apply($order, $role)
{ {
$data = [ $data = [
'pfrom_id' => 600, 'pfrom_id' => $this->platformId,
'server_id' => $role['server_id'], 'server_id' => $role['server_id'],
'actors' => $role['role_id'], 'actors' => $role['role_id'],
'sendnum_yb' => intval($order['ref_amount']) * 10, 'sendnum_yb' => intval($order['ref_amount']) * 10,

@ -24,7 +24,7 @@ class XyyXmjsClient
'self-apply-foster' => ['uri' => '', 'method' => 'get'], 'self-apply-foster' => ['uri' => '', 'method' => 'get'],
]; ];
public function __construct() public function __construct($game = null)
{ {
$this->client = new Client([ $this->client = new Client([
'base_uri' => 'http://rebate.99you.cn/xyy_apply.php/23400/', 'base_uri' => 'http://rebate.99you.cn/xyy_apply.php/23400/',

@ -31,7 +31,7 @@ class YzchzbClient
'ios' => 11596, 'ios' => 11596,
]; ];
public function __construct() public function __construct($game = null)
{ {
$this->client = new Client([ $this->client = new Client([
'base_uri' => C('GAME_CAT_URL'), 'base_uri' => C('GAME_CAT_URL'),

Loading…
Cancel
Save