Пример #1
0
 public function carte()
 {
     if (!$this->checkDroit(Droit::LOGGE_PARTIE)) {
         header('Location: ' . Conf::common()['url']['base'] . '/index.php?page=Accueil&action=parties');
         exit;
     }
     $this->getMenu()->setJeu('carte');
     /**
      * Données
      */
     $url = 'http://nj.leparquier.fr:' . SessionBusiness::getCookieSession()->getPartie()->getPort() . '/JsonCarte';
     $idCentre = SessionBusiness::getCookieSession()->getJoueur()->getCapitale()->getId();
     $ch = curl_init();
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
     curl_setopt($ch, CURLOPT_URL, $url);
     curl_setopt($ch, CURLOPT_POST, true);
     curl_setopt($ch, CURLOPT_POSTFIELDS, "idCentre=" . $idCentre . "&largeur=11&hauteur=9&token=" . SessionBusiness::getCookieSession()->getToken());
     $result = curl_exec($ch);
     curl_close($ch);
     $this->data['dataDyn'] = $result;
     $this->data['typesUnites'] = json_encode(Unites::getArrayIndexesId());
     $this->data['typesTerrains'] = json_encode(Terrains::getArrayIndexesId());
     $this->data['typesMissions'] = json_encode(Missions::getArrayIndexesId());
     $this->data['PORT_PARTIE'] = SessionBusiness::getCookieSession()->getPartie()->getPort();
     $this->data['idCentre'] = $idCentre;
     /**
      * Templates
      */
     $this->data['tpl_case'] = $this->getTemplateStr('elements/infosCarte/case.php');
     $this->data['tpl_proprioCase'] = $this->getTemplateStr('elements/infosCarte/proprioCase.php');
     $this->data['tpl_qg'] = $this->getTemplateStr('elements/infosCarte/qg.php');
     $this->data['tpl_unite'] = $this->getTemplateStr('elements/infosCarte/qg_unites.php');
     $this->data['tpl_totalMvtQg'] = $this->getTemplateStr('elements/infosCarte/totalMvtQg.php');
     $this->data['tpl_riviere'] = $this->getTemplateStr('elements/infosCarte/riviere.php');
     $this->data['tpl_infraCase'] = $this->getTemplateStr('elements/infosCarte/infraCase.php');
     $this->data['tpl_loading'] = $this->fetch('elements/cadres/loading.php');
     $this->data['DROIT_ADMIN'] = $this->checkDroit(Droit::ADMIN);
     $this->display('pages/Jeu/Carte.php');
 }