Ejemplo n.º 1
0
 public function postAddHalo5Gamertag(AdminAddHalo5GamertagRequest $request)
 {
     $client = new Halo5Client();
     $account = $client->getAccountByGamertag($request->request->get('gamertag'));
     $this->dispatch(new UpdateHalo5Account($account));
     return \Redirect::action('Halo5\\ProfileController@index', [$account->seo]);
 }
Ejemplo n.º 2
0
 public function validateH5GamertagReal($attribute, $value, $parameters)
 {
     $client = new Halo5Client();
     try {
         $account = $client->getAccountByGamertag($value);
     } catch (PlayerNotFoundException $e) {
         return false;
     }
     return true;
 }
Ejemplo n.º 3
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $client = new Client();
     $this->info('Getting new CSR data from 343');
     $csrs = $client->getCsrs();
     if (is_array($csrs)) {
         $this->info('We found CSR data. Adding to table after purge.');
         DB::table('halo5_csrs')->truncate();
         foreach ($csrs as $csr) {
             $this->info('Adding ' . $csr['name']);
             $c = new CSR();
             $c->designationId = $csr['id'];
             $c->name = $csr['name'];
             $c->bannerUrl = $csr['bannerImageUrl'];
             $c->tiers = $csr['tiers'];
             $c->save();
         }
     }
 }
Ejemplo n.º 4
0
    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        $client = new Client();
        $this->info('Getting new Medal data from 343');
        $medals = $client->getMedals();
        if (is_array($medals)) {
            $this->info('We found a lot of medals. ' . count($medals) . ' to be exact.');
            $this->info('Purging table to make room for new medals');
            DB::table('halo5_medals')->truncate();
            $contents = <<<EOF
.medal {
    display: inline-block;
}

EOF;
            foreach ($medals as $medal) {
                $this->info('Adding: ' . $medal['name']);
                $m = new Medal();
                $m->name = $medal['name'];
                $m->description = $medal['description'];
                $m->classification = $medal['classification'];
                $m->difficulty = $medal['difficulty'];
                $m->contentId = $medal['id'];
                $m->save();
                $contents .= <<<EOF
.medal-{$medal['id']} { /* {$medal['name']} */
    background: url('/css/images/h5-medals.png') no-repeat -{$medal['spriteLocation']['left']}px -{$medal['spriteLocation']['top']}px;
    width: {$medal['spriteLocation']['width']}px;
    height: {$medal['spriteLocation']['height']}px;
}

EOF;
            }
            // Lets do CSS work now
            $m = $medals[0];
            $this->info('Writing new sprite file...');
            $sprite = file_get_contents($m['spriteLocation']['spriteSheetUri']);
            Storage::put('resources/images/h5-medals.png', $sprite);
            Storage::put('resources/css/h5-sprites.css', $contents);
        }
    }
Ejemplo n.º 5
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $client = new Client();
     $this->info('Getting new Playlist data from 343');
     $playlists = $client->getPlaylists();
     if (is_array($playlists)) {
         $this->info('We found CSR data. Adding to table after purge.');
         DB::table('halo5_playlists')->truncate();
         foreach ($playlists as $playlist) {
             $this->info('Adding ' . $playlist['name']);
             $p = new Playlist();
             $p->name = $playlist['name'];
             $p->description = $playlist['description'];
             $p->isRanked = $playlist['isRanked'];
             $p->isActive = $playlist['isActive'];
             $p->gameMode = $playlist['gameMode'];
             $p->contentId = $playlist['id'];
             $p->imageUrl = $playlist['imageUrl'];
             $p->save();
         }
     }
 }
Ejemplo n.º 6
0
 /**
  * Execute the command.
  *
  * @return void
  */
 public function handle()
 {
     $client = new Client();
     $client->updateH5Account($this->account);
 }