dolejska-daniel / riot-api-league

GNU General Public License v3.0
15 stars 18 forks source link

Question about match-v5 #1

Open Lucasnl opened 3 years ago

Lucasnl commented 3 years ago

Hey I really enjoy your work and i want to know if you will update the match V4 to V5 ?

https://twitter.com/RiotGamesDevRel/status/1382471243744518145

Thanks !

dolejska-daniel commented 3 years ago

Hello! I'm happy to hear that you enjoy the library. I'll soon take a look at updating the endpoints.

Lucasnl commented 3 years ago

Thanks you're the best !!

dolejska-daniel commented 3 years ago

Let's keep the issue open until I actually update the endpoints 😅

dolejska-daniel commented 3 years ago

I am not yet able to generate the data classes as they are not in the official documentation. I will update the endpoints and generate corresponding data classes once the documentation is up-to-date.

regiszanandrea commented 3 years ago

@dolejska-daniel any news here? Since we are getting close to the depprecation date on July 26th, 2021. I've been use this library by two years on a great website, it's very good.

dolejska-daniel commented 3 years ago

Hey @regiszanandrea! Yeah, I will create the endpoints this week and use old DTOs for now.

regiszanandrea commented 3 years ago

thanks a lot @dolejska-daniel

dolejska-daniel commented 3 years ago

@regiszanandrea soo... I did it now 😅 However be careful! I just now uncovered that my Application API key does not have access to Match v5 endpoints just yet, resulting in endpoint calls throwing Forbidden exceptions.

blood72 commented 3 years ago

Thank you for your hard work. In my opinion, there seems to be no reason to change it hastily because the official document has not been specified yet. It is not yet available for production, and some matching records retrieved from v4 were not available in v5. It will be released sometime in June, so it seems to be enough time.

regiszanandrea commented 3 years ago

hey @dolejska-daniel , can you add type param on endpoint /lol/match/v5/matches/by-puuid/{puuid}/ids to filter tournament matches? It would be very useful. The endpoint only accepts: ranked, normal, tourney or tutorial.

Also, the MatchDto is not setting any data to it's attributes on match-v5 getMatch method, here is a example: image

dolejska-daniel commented 3 years ago

Hey @regiszanandrea, I've added the type and queue parameters to the getMatchIdsByPUUID API method.

Furthermore, the MatchDto is not filled by values because the structure of the object has changed; however, the new structure is not yet published or finalized as it seems from Riot's developer docs. For now, you can use $m->getData()["metadata"]["matchId"] to get information that you need.

regiszanandrea commented 3 years ago

Thank you @dolejska-daniel , yes, I'm already using getData method.

I appreciate it.

Lucasnl commented 2 years ago

Hey , I'm Getting this error after updating to version 5.0 and trying to use $api->getTimeline('BR1_123456'); is there anything i can do to fix it ? image

Obs: if i try this code after the async it does not work , if i try before the async it works fine.

dolejska-daniel commented 2 years ago

Thank you for noticing and reporting this @Lucasnl! It should now be fixed in the latest version!

dolejska-daniel commented 2 years ago

As of 9162ab5c23526026dc8b872d1a4e6e5f07920c50 (v1.1.1) the API object definitions should be up-to-date with the developer docs.

Lucasnl commented 2 years ago

hi , i'm having this problem when i try to use getMatchIdsByPUUID() , Same with getMatch();

image

my code:

`<?php 

require_once __DIR__  . "/vendor/autoload.php";

use RiotAPI\LeagueAPI\LeagueAPI;
use RiotAPI\Base\Definitions\Region;
use RiotAPI\DataDragonAPI\DataDragonAPI;
use RiotAPI\Base\Definitions\Platform;

//  Initialize the library
$api = new LeagueAPI([
    //  Your API key, you can get one at https://developer.riotgames.com

    LeagueAPI::SET_KEY    => 'MyKey',

    //  Target region (you can change it during lifetime of the library instance)
    LeagueAPI::SET_REGION => Region::BRASIL,
    LeagueAPI::SET_CACHE_CALLS => true,
    LeagueAPI::SET_CACHE_CALLS_LENGTH => 860,
    LeagueAPI::SET_CACHE_RATELIMIT => true,

  DataDragonAPI::initByCdn(),

]);

$matches = ($api->getMatchIdsByPUUID("wek5bnQHrtoFiNeRtLDmZPMfIPm-Ym9ZGZFElDfdDUf_X210Apdcz7pux-HA5hAJbT0IPJ0lCTsD-Q",420));

?>`
Witchplume commented 2 years ago

@Lucasnl

$summoner = $api->getSummonerByName("Summoner name");
$matchlist = $api->getMatchIdsByPUUID($summoner->puuid);
Lucasnl commented 2 years ago

Hey , thanks for the reply ! I've tried that but i get the same error. if i change the line 1361 to $content_region = "americas" it works fine

$name = $_REQUEST['name'];
$summoner = $api->getSummonerByName($name);

$matches = $api->getMatchIdsByPUUID($summoner->puuid,420,NULL,NULL,30);

image

Lucasnl commented 2 years ago

Hey , thanks for the reply ! I've tried that but i get the same error. if i change the line 1361 to $content_region = "americas" it works fine

$name = $_REQUEST['name'];
$summoner = $api->getSummonerByName($name);

$matches = $api->getMatchIdsByPUUID($summoner->puuid,420,NULL,NULL,30);

image

Just figured out , the method name is not getCorrespondingContinentRegion() , the method name is getContinentRegion() so i change the code to

$continent_region = $this->platforms->getContinentRegion($this->getSetting(self::SET_PLATFORM)); and it worked !

image

PaXyL commented 2 years ago

Hey @dolejska-daniel ! Thanks for your work, i use this Issue for asking you if you can add startTime and endTime param to /lol/match/v5/matches/by-puuid/{puuid}/ids ? That could help to filter match list for a user :)

dolejska-daniel commented 2 years ago

Sorry for the awful delay, everyone. All this should be available in #12. Maybe by the end of the week?