Compare commits

..

No commits in common. "master" and "task/upgrade_jpgraph" have entirely different histories.

181 changed files with 252 additions and 1245 deletions

View File

@ -64,7 +64,6 @@ steps:
trigger: trigger:
event: event:
- cron
- push - push
- tag - tag

View File

@ -1,20 +1,16 @@
<?php <?php
define("INDEX", 1); define("INDEX", 1);
define("DEBUG", false);
$chrono_start = microtime(); $chrono_start = microtime();
require_once(trim(file_get_contents('./.onyx'))); $onyx = @file_get_contents('./.onyx') or die("Configuration introuvable.");
require_once("common.php"); //Chargement de tout le nécessaire pour le jeu define("_FCORE", trim($onyx));
require_once("function.php"); require(_FCORE."../game/Class/JSON.php");
require_once("Class/JSON.php"); require_once(_FCORE."common.php");
require_once("Class/flotte.php");
require_once("Class/planete.php");
if (isset($SESS) && isset($SESS->values['connected']) && $SESS->values['connected'] && !empty($SESS->values['id']) && !empty($SESS->values['idPlan'])) { if (isset($sess) && isset($sess->values['connected']) && $sess->values['connected'] && !empty($sess->values['id']) && !empty($sess->level) && !empty($sess->values['idPlan'])) {
$idPrep = gpc("cds_temp", "post");
$json = new Services_JSON(); $json = new Services_JSON();
$nbtrajet = 2; $nbtrajet = 2;
if (empty($VAR['flottes']) && $SESS->level <= 1) { if (empty($config['flottes']) && $sess->level <= 1) {
$datas = array( $datas = array(
'root' => array( 'root' => array(
'destination' => '<input class="dest" type="text" id="amas" name="amas" maxlength="2" value="'.gpc('galaxie', 'post').'" />:<input class="dest" type="text" id="ss" name="ss" maxlength="2" value="'.gpc('ss', 'post').'" />:<input class="dest" type="text" id="plan" name="pos" maxlength="2" value="'.gpc('pos', 'post').'" />', 'destination' => '<input class="dest" type="text" id="amas" name="amas" maxlength="2" value="'.gpc('galaxie', 'post').'" />:<input class="dest" type="text" id="ss" name="ss" maxlength="2" value="'.gpc('ss', 'post').'" />:<input class="dest" type="text" id="plan" name="pos" maxlength="2" value="'.gpc('pos', 'post').'" />',
@ -32,7 +28,8 @@ if (isset($SESS) && isset($SESS->values['connected']) && $SESS->values['connecte
$destin = gpc('fav_dest', 'post'); $destin = gpc('fav_dest', 'post');
$chapeau = new bdd(); $chapeau = new bdd();
$idPlan = $SESS->values['idPlan']; $chapeau->connexion();
$idPlan = $sess->values['idPlan'];
$queryPlanete = $chapeau->unique_query("SELECT * FROM $table_planete WHERE id = '$idPlan'"); $queryPlanete = $chapeau->unique_query("SELECT * FROM $table_planete WHERE id = '$idPlan'");
if (!empty($destin)) { if (!empty($destin)) {
$chapeau->escape($destin); $chapeau->escape($destin);
@ -48,11 +45,18 @@ if (isset($SESS) && isset($SESS->values['connected']) && $SESS->values['connecte
$start_ss = $queryPlanete['ss']; $start_ss = $queryPlanete['ss'];
$start_position = $queryPlanete['position']; $start_position = $queryPlanete['position'];
if (empty($SESS->values["prepFlottes"][$idPrep]['time']) || $met = gpc('met', 'post');
$SESS->values["prepFlottes"][$idPrep]['time'] + 1200 < time() || $cri = gpc('cri', 'post');
empty($SESS->values["prepFlottes"][$idPrep]['nbVaisseaux']) || $hyd = gpc('hyd', 'post');
empty($SESS->values["prepFlottes"][$idPrep]['vitesse']) && if (!empty($sess->values['flcontenu']) && $met+$cri+$hyd >= 0 && $met >= 0 && $cri >= 0 && $hyd >= 0) {
isset($SESS->values['auth_level'])) { $places = $sess->values['flcontenu'] - ($met+$cri+$hyd);
} else {
$places = 'inconnu';
}
if (empty($sess->values['fltime']) || $sess->values['fltime'] + 600 < time() || empty($sess->values['flnbvais']) || empty($sess->values['flvitesse']) && isset($sess->values['auth_level'])) {
$datas = array( $datas = array(
'root' => array( 'root' => array(
'destination' => $destinRapid, 'destination' => $destinRapid,
@ -60,7 +64,7 @@ if (isset($SESS) && isset($SESS->values['connected']) && $SESS->values['connecte
'deblok' => '<b>Une erreur est survenue lors de la création de la flotte. Veuillez recommencer</b>', 'deblok' => '<b>Une erreur est survenue lors de la création de la flotte. Veuillez recommencer</b>',
'conso' => '-', 'conso' => '-',
'tactique' => '', 'tactique' => '',
'places' => '', 'places' => separerNombres($places)
) )
); );
} elseif (empty($_POST['nom']) || preg_replace('@[^a-zA-Z0-9_ ]@i', '', $_POST['nom']) != $_POST['nom']) { } elseif (empty($_POST['nom']) || preg_replace('@[^a-zA-Z0-9_ ]@i', '', $_POST['nom']) != $_POST['nom']) {
@ -71,10 +75,10 @@ if (isset($SESS) && isset($SESS->values['connected']) && $SESS->values['connecte
'deblok' => '<b>Nom de la flotte incorrect !</b>', 'deblok' => '<b>Nom de la flotte incorrect !</b>',
'conso' => '-', 'conso' => '-',
'tactique' => '', 'tactique' => '',
'places' => '', 'places' => separerNombres($places)
) )
); );
} elseif ($_POST['galaxie'] > $VAR['nb_amas'] || $_POST['ss'] > $VAR['nb_systeme'] || $_POST['pos'] > $VAR['nb_planete'] || $_POST['galaxie'] < 0 || $_POST['ss'] < 1 || $_POST['pos'] < 1 || ($_POST['galaxie'] < 1 && $SESS->values['auth_level'] < 6)) { } elseif ($_POST['galaxie'] > MAX_AMAS || $_POST['ss'] > MAX_SYSTEME || $_POST['pos'] > MAX_PLANETE || $_POST['galaxie'] < 0 || $_POST['ss'] < 1 || $_POST['pos'] < 1 || ($_POST['galaxie'] < 1 && $sess->values['auth_level'] < 6)) {
$datas = array( $datas = array(
'root' => array( 'root' => array(
'destination' => $destinRapid, 'destination' => $destinRapid,
@ -82,38 +86,23 @@ if (isset($SESS) && isset($SESS->values['connected']) && $SESS->values['connecte
'deblok' => '<b>Corrigez la destination !</b>', 'deblok' => '<b>Corrigez la destination !</b>',
'conso' => '-', 'conso' => '-',
'tactique' => '', 'tactique' => '',
'places' => '', 'places' => separerNombres($places)
) )
); );
} else { } else {
$_POST['vitesse'] /= 100; $_POST['vitesse'] /= 100;
$temps = vais_tempsDeplacement($start_galaxie, $start_ss, $start_position, $_POST['galaxie'], $_POST['ss'], $_POST['pos'], $sess->values['flvitesse'], $_POST['vitesse'], $sess->values['flpreparation'], $sess->values['flchauffe']);
$planete = new planete($idPlan);
$flotte = new flotte();
$temps = $flotte->calc_deplacement($planete, $_POST['galaxie'], $_POST['ss'], $_POST['pos'], $_POST['vitesse'], $SESS->values["prepFlottes"][$idPrep]['vaisseaux'], 1000);
if ($temps <= 0) { if ($temps <= 0) {
$temps = 454; $temps = 454;
} }
$conso = $flotte->calc_deplacement($planete, $_POST['galaxie'], $_POST['ss'], $_POST['pos'], $_POST['vitesse'], $SESS->values["prepFlottes"][$idPrep]['vaisseaux'], 1000, false, true); $conso = vais_conso($temps, $sess->values['flnbvais'])*$_POST['vitesse']/45;
// $conso renvoi le temps ET la conso dans un array $places -= ceil($conso*$nbtrajet);
$conso = intval($conso[1]);
$met = intval(gpc('met', 'post'));
$cri = intval(gpc('cri', 'post'));
$hyd = intval(gpc('hyd', 'post'));
$places = $flotte->calcStockage($SESS->values["prepFlottes"][$idPrep]['vaisseaux'], $planete);
$places -= ceil($conso * $nbtrajet);
if (($met+$cri+$hyd) > 0) {
$places -= ($met+$cri+$hyd);
}
$tactique = ''; $tactique = '';
// si la mission est une mission d'attaque if ($_POST['mission'] == '1') {
if ($_POST['mission'] == '3') {
$tactique = '<label for="selecttactique">Tactique d\'attaque :</label><select id="selecttactique" name="tactique">'; $tactique = '<label for="selecttactique">Tactique d\'attaque :</label><select id="selecttactique" name="tactique">';
//On récupère le niveau actuel de la technologie Commandement militaire //On récupère le niveau actuel de la technologie Commandement militaire
$id_user = $SESS->values['id']; $id_user = $sess->values['id'];
global $table_user; $table = $config['db_prefix'].'user';
$table = $table_user;
$queryUser = $chapeau->unique_query("SELECT * FROM $table WHERE id = '$id_user'"); $queryUser = $chapeau->unique_query("SELECT * FROM $table WHERE id = '$id_user'");
$lvltechno = $queryUser['tactique']; $lvltechno = $queryUser['tactique'];
$tactiquedef = $queryUser['combatAT_tactique']; $tactiquedef = $queryUser['combatAT_tactique'];
@ -124,9 +113,9 @@ if (isset($SESS) && isset($SESS->values['connected']) && $SESS->values['connecte
'destination' => $destinRapid, 'destination' => $destinRapid,
'temps' => affTemp(floor($temps)), 'temps' => affTemp(floor($temps)),
'deblok' => '<b>Vous ne pouvez pas attaquer sans un minimum de connaissances militaires !</b>', 'deblok' => '<b>Vous ne pouvez pas attaquer sans un minimum de connaissances militaires !</b>',
'conso' => ceil($conso*$nbtrajet), 'conso' => separerNombres(ceil($conso*$nbtrajet)),
'tactique' => '', 'tactique' => '',
'places' => $places 'places' => separerNombres($places)
) )
); );
header("X-JSON: ".$json->encode($datas)); header("X-JSON: ".$json->encode($datas));
@ -142,16 +131,17 @@ if (isset($SESS) && isset($SESS->values['connected']) && $SESS->values['connecte
} }
$tactique .= '</select><br />'; $tactique .= '</select><br />';
} }
$SESS->values['flcds'] = $idPrep; $cds = sha1('flotte'.$conso.'ß10'.time().'|HB;'.rand(10, 99).$temps);
$SESS->put(); $sess->values['flcds'] = $cds;
$sess->put();
$datas = array( $datas = array(
'root' => array( 'root' => array(
'destination' => $destinRapid, 'destination' => $destinRapid,
'temps' => affTemp(floor($temps)), 'temps' => affTemp(floor($temps)),
'deblok' => '<input type="hidden" name="cds" value="'.$idPrep.'" /><input type="submit" value="GO" class="submit" />', 'deblok' => '<input type="hidden" name="cds" value="'.$cds.'" /><input type="submit" value="GO" class="submit" />',
'conso' => ceil($conso*2), 'conso' => separerNombres(ceil($conso*2)),
'tactique' => $tactique, 'tactique' => $tactique,
'places' => $places 'places' => separerNombres($places)
) )
); );
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Some files were not shown because too many files have changed in this diff Show More