【发布时间】:2015-05-21 14:30:28
【问题描述】:
我刚开始使用 Riot API,我一直坚持通过排名来获取召唤师。我使用了getChampion() 函数,但它检索的数据与其他已经在运行的站点不同。
我是这样使用的:
<?php
include('php-riot-api.php');
include('FileSystemCache.php');
//testing classes
//using double quotes seems to make all names work (see issue: https://github.com/kevinohashi/php-riot-api/issues/33)
$summoner_name = "RiotSchmick";
$summoner_id = 585897;
$test = new riotapi('na');
$testCache = new riotapi('na', new FileSystemCache('cache/'));
$r = $test->getChampion(); echo "<pre>"; print_r($r);echo "</pre>";
this fetch array like this
[champions] => Array
(
[0] => Array
(
[id] => 266
[active] => 1
[botEnabled] =>
[freeToPlay] => 1
[botMmEnabled] =>
[rankedPlayEnabled] => 1
)
[1] => Array
(
[id] => 103
[active] => 1
[botEnabled] =>
[freeToPlay] =>
[botMmEnabled] =>
[rankedPlayEnabled] => 1
) ..................
在我使用$r->getSummoner(266); // 103 和我从上面的数组中获得的所有 id 之后。但是我得到的召唤师名字和http://na.op.gg/ranking/ladder/和http://quickfind.kassad.in/rankings/na等其他正在运行的站点不同(这两个站点的数据相同,但我的不同)。
【问题讨论】:
-
请edit 提出您的问题,说明您是如何使用 API 的,以及结果与您的预期有何不同。
-
@Mat!我添加了有问题的代码,请再次查看。谢谢你
标签: riot-games-api