Example #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');
 }
Example #2
0
 public function regles()
 {
     $this->getMenu()->setAccueil('regles');
     $this->data['regles'] = TexteBusiness::getByCode('REGLES')->getTexte();
     $html = $this->fetch('pages/Accueil/Regles.php');
     $this->data['qgsNiveaux'] = QGs::getArrayRulesNiveaux();
     $html = str_replace('||tabQgsNiveaux||', $this->fetch('elements/regles/nivQG.php'), $html);
     $this->data['unites'] = Unites::getArrayRules();
     $html = str_replace('||tabUnites||', $this->fetch('elements/regles/tabUnites.php'), $html);
     $this->data['tabValsUnites'] = Unites::getArrayValsRules();
     $html = str_replace('||tabValsUnites||', $this->fetch('elements/regles/tabValsUnites.php'), $html);
     $html = str_replace('||tabModifTerrain||', $this->fetch('elements/regles/tabModifTerrain.php'), $html);
     $this->data['tabBatimentsDefensifs'] = Infrastructures::$types;
     $html = str_replace('||tabBatimentsDefensifs||', $this->fetch('elements/regles/tabBatimentsDefensifs.php'), $html);
     $html = str_replace('||donneesNiveauxPourRegles||', $this->fetch('elements/regles/donneesNiveauxPourRegles.php'), $html);
     $html = str_replace('||descriptionMissions||', $this->fetch('elements/regles/missions.php'), $html);
     $html = str_replace('||tableCombats||', $this->fetch('elements/regles/tableCombats.php'), $html);
     $html = str_replace('||ordreResolutionMissions||', $this->fetch('elements/regles/ordreResolutionMissions.php'), $html);
     $this->data['tabTraversees'] = Terrains::$traversees;
     $html = str_replace('||tabTraversees||', $this->fetch('elements/regles/tabTraversees.php'), $html);
     echo $html;
 }