dolejska-daniel / riot-api

Riot League of Legends & DataDragon API wrappers for PHP7 and PHP8.
GNU General Public License v3.0
112 stars 25 forks source link

Error 500 on createTournamentCodes function #38

Closed regiszanandrea closed 5 years ago

regiszanandrea commented 5 years ago

Describe the bug Hi,

I'm getting error 500 - 'LeagueAPI: Internal server error occured.', I get the json from the library and put on developer.riotgames.com and I was able to create a tournament code there.

To Reproduce

$riot = new LeagueAPI([
                LeagueAPI::SET_KEY => config('riot.key'),
                LeagueAPI::SET_TOURNAMENT_KEY => config('riot.key'),
                LeagueAPI::SET_REGION => Region::BRASIL,
                LeagueAPI::SET_CACHE_RATELIMIT => config('riot.rate_limit_control_enabled'),
                LeagueAPI::SET_CACHE_PROVIDER => RiotRedisProvider::class,
                LeagueAPI::SET_CACHE_CALLS => config('riot.cache_enabled')
            ]);

$parameters = new TournamentCodeParameters([
                'allowedSummonerIds' => $participants,
                'mapType' => $map_type,
                'pickType' => $pick_type,
                'spectatorType' => $spectator_type,
                'teamSize' => $team_size,
            ]);

// Create Tournament Codes
$riot->createTournamentCodes($tournament_id, $count, $parameters);

Json

{"spectatorType":"ALL","teamSize":5,"pickType":"ALL_RANDOM","allowedSummonerIds":["auAmS-X5zAMH5k134GQEDEcDm4xS4_FvXQiOsCZqzhBZ","4Zv2cxrEsizFTML7uX8pf2Qrl0K6wJgjm5QtFNWZmUxP","ZASDToK0rkg_vL3sYrbwQfJQRHL1VwR9RUsJtrnBRJV4rw","4s2JJ6AzLcCDNBbKTPIk3q-GsXqlXp3hPBWwx_FS6QCz","4cUcAL4VcNYPuTlfagWTf_FhB79hdG4y4fIJ6AP-pogwCw","vWpDNUD6lNg-0ssn3XPy3noLlzrL6X7FORifn4clRYosXw","t9i22GkvWi0IEdvizq9z5A6A53yceix2WcM8hGBk7Wcsbw","l-gMBkOU12gyyxo_RWF5We6Oa8zlozxhLHSreDO5K7MBesM","bPXvFD_La1BexRzXjDXsbq_lW6jmUyENPnur0TJqrzmtXg","B_v1VzFeKXef-h0ehJLpz4gDokyCTGuwLFgc8EgjMzQZ-Q"],"mapType":"SUMMONERS_RIFT","metadata":null}

Expected behavior Create Tournament codes

Server (please complete the following information):

Additional context I'm using Laravel