예제 #1
0
 public function searchForUser($username)
 {
     $this->username = $username;
     if ($response = @file_get_contents('https://global.api.pvp.net/api/lol/' . strtolower($this->region) . '/v1.4/summoner/by-name/' . htmlspecialchars($username) . '?summonerName=' . $username . '&api_key=' . $this->key)) {
         $response = json_decode($response);
         return json_encode([$response->{strtolower($username)}->id, genString::random8()]);
     } else {
         responder::sendResponse(400);
     }
 }
예제 #2
0
 public function verifyUser($posted)
 {
     $uid = $posted->runepageString[0];
     $runepage = $posted->runepageString[1];
     $summonerName = $posted->id;
     if ($this->login->checkForRunepage($uid, $runepage)) {
         $this->summoner = $this->summoner->loadSummonerByName($summonerName);
         return responder::sendResponse(200, ['summonerID' => $uid, 'profileIconID' => $this->summoner->getProfileIcon(), 'champMasteries' => $this->summoner->getChampMasteries()]);
     } else {
         return responder::sendResponse(400);
     }
 }