Compare commits
42 Commits
task/upgra
...
master
Author | SHA1 | Date | |
---|---|---|---|
85d59f7a65 | |||
9805b58f2b | |||
4d61e17021 | |||
984c35ee64 | |||
f5fd9cab58 | |||
9902dc3638 | |||
2a3a98f42c | |||
f46379bd8f | |||
295add63bc | |||
fca32002e5 | |||
5184b511f2 | |||
4f1f6a1ef3 | |||
f69d4bf376 | |||
aff1550919 | |||
067b45bdfd | |||
ea3860f79d | |||
ff69ed0d54 | |||
6d8bf942db | |||
28b0ceeee8 | |||
cfa44975d3 | |||
93dd3e187a | |||
16c71524b1 | |||
541a0e009c | |||
9e9a4344f2 | |||
b0e5c7dea5 | |||
2269a56ce5 | |||
4fedde4cf9 | |||
81cb1e9660 | |||
bd5e4c75c1 | |||
9a14ddcd8d | |||
b7ab2b3640 | |||
eea4226991 | |||
3191822644 | |||
c1bac50417 | |||
ba1de13034 | |||
e4219f493d | |||
b1e1cc6117 | |||
a9afd5ea68 | |||
1072d78ae7 | |||
d72e495f59 | |||
5334b1877d | |||
c56099e3b0 |
@ -64,6 +64,7 @@ steps:
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- cron
|
||||
- push
|
||||
- tag
|
||||
|
||||
|
@ -1,16 +1,20 @@
|
||||
<?php
|
||||
define("INDEX", 1);
|
||||
define("DEBUG", false);
|
||||
$chrono_start = microtime();
|
||||
$onyx = @file_get_contents('./.onyx') or die("Configuration introuvable.");
|
||||
define("_FCORE", trim($onyx));
|
||||
require(_FCORE."../game/Class/JSON.php");
|
||||
require_once(_FCORE."common.php");
|
||||
require_once(trim(file_get_contents('./.onyx')));
|
||||
require_once("common.php"); //Chargement de tout le nécessaire pour le jeu
|
||||
require_once("function.php");
|
||||
require_once("Class/JSON.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->level) && !empty($sess->values['idPlan'])) {
|
||||
if (isset($SESS) && isset($SESS->values['connected']) && $SESS->values['connected'] && !empty($SESS->values['id']) && !empty($SESS->values['idPlan'])) {
|
||||
$idPrep = gpc("cds_temp", "post");
|
||||
$json = new Services_JSON();
|
||||
$nbtrajet = 2;
|
||||
|
||||
if (empty($config['flottes']) && $sess->level <= 1) {
|
||||
if (empty($VAR['flottes']) && $SESS->level <= 1) {
|
||||
$datas = 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').'" />',
|
||||
@ -28,8 +32,7 @@ if (isset($sess) && isset($sess->values['connected']) && $sess->values['connecte
|
||||
$destin = gpc('fav_dest', 'post');
|
||||
|
||||
$chapeau = new bdd();
|
||||
$chapeau->connexion();
|
||||
$idPlan = $sess->values['idPlan'];
|
||||
$idPlan = $SESS->values['idPlan'];
|
||||
$queryPlanete = $chapeau->unique_query("SELECT * FROM $table_planete WHERE id = '$idPlan'");
|
||||
if (!empty($destin)) {
|
||||
$chapeau->escape($destin);
|
||||
@ -45,18 +48,11 @@ if (isset($sess) && isset($sess->values['connected']) && $sess->values['connecte
|
||||
$start_ss = $queryPlanete['ss'];
|
||||
$start_position = $queryPlanete['position'];
|
||||
|
||||
$met = gpc('met', 'post');
|
||||
$cri = gpc('cri', 'post');
|
||||
$hyd = gpc('hyd', 'post');
|
||||
if (!empty($sess->values['flcontenu']) && $met+$cri+$hyd >= 0 && $met >= 0 && $cri >= 0 && $hyd >= 0) {
|
||||
$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'])) {
|
||||
if (empty($SESS->values["prepFlottes"][$idPrep]['time']) ||
|
||||
$SESS->values["prepFlottes"][$idPrep]['time'] + 1200 < time() ||
|
||||
empty($SESS->values["prepFlottes"][$idPrep]['nbVaisseaux']) ||
|
||||
empty($SESS->values["prepFlottes"][$idPrep]['vitesse']) &&
|
||||
isset($SESS->values['auth_level'])) {
|
||||
$datas = array(
|
||||
'root' => array(
|
||||
'destination' => $destinRapid,
|
||||
@ -64,7 +60,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>',
|
||||
'conso' => '-',
|
||||
'tactique' => '',
|
||||
'places' => separerNombres($places)
|
||||
'places' => '',
|
||||
)
|
||||
);
|
||||
} elseif (empty($_POST['nom']) || preg_replace('@[^a-zA-Z0-9_ ]@i', '', $_POST['nom']) != $_POST['nom']) {
|
||||
@ -75,10 +71,10 @@ if (isset($sess) && isset($sess->values['connected']) && $sess->values['connecte
|
||||
'deblok' => '<b>Nom de la flotte incorrect !</b>',
|
||||
'conso' => '-',
|
||||
'tactique' => '',
|
||||
'places' => separerNombres($places)
|
||||
'places' => '',
|
||||
)
|
||||
);
|
||||
} 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)) {
|
||||
} 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)) {
|
||||
$datas = array(
|
||||
'root' => array(
|
||||
'destination' => $destinRapid,
|
||||
@ -86,23 +82,38 @@ if (isset($sess) && isset($sess->values['connected']) && $sess->values['connecte
|
||||
'deblok' => '<b>Corrigez la destination !</b>',
|
||||
'conso' => '-',
|
||||
'tactique' => '',
|
||||
'places' => separerNombres($places)
|
||||
'places' => '',
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$_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) {
|
||||
$temps = 454;
|
||||
}
|
||||
$conso = vais_conso($temps, $sess->values['flnbvais'])*$_POST['vitesse']/45;
|
||||
$places -= ceil($conso*$nbtrajet);
|
||||
$conso = $flotte->calc_deplacement($planete, $_POST['galaxie'], $_POST['ss'], $_POST['pos'], $_POST['vitesse'], $SESS->values["prepFlottes"][$idPrep]['vaisseaux'], 1000, false, true);
|
||||
// $conso renvoi le temps ET la conso dans un array
|
||||
$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 = '';
|
||||
if ($_POST['mission'] == '1') {
|
||||
// si la mission est une mission d'attaque
|
||||
if ($_POST['mission'] == '3') {
|
||||
$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
|
||||
$id_user = $sess->values['id'];
|
||||
$table = $config['db_prefix'].'user';
|
||||
$id_user = $SESS->values['id'];
|
||||
global $table_user;
|
||||
$table = $table_user;
|
||||
$queryUser = $chapeau->unique_query("SELECT * FROM $table WHERE id = '$id_user'");
|
||||
$lvltechno = $queryUser['tactique'];
|
||||
$tactiquedef = $queryUser['combatAT_tactique'];
|
||||
@ -113,9 +124,9 @@ if (isset($sess) && isset($sess->values['connected']) && $sess->values['connecte
|
||||
'destination' => $destinRapid,
|
||||
'temps' => affTemp(floor($temps)),
|
||||
'deblok' => '<b>Vous ne pouvez pas attaquer sans un minimum de connaissances militaires !</b>',
|
||||
'conso' => separerNombres(ceil($conso*$nbtrajet)),
|
||||
'conso' => ceil($conso*$nbtrajet),
|
||||
'tactique' => '',
|
||||
'places' => separerNombres($places)
|
||||
'places' => $places
|
||||
)
|
||||
);
|
||||
header("X-JSON: ".$json->encode($datas));
|
||||
@ -131,17 +142,16 @@ if (isset($sess) && isset($sess->values['connected']) && $sess->values['connecte
|
||||
}
|
||||
$tactique .= '</select><br />';
|
||||
}
|
||||
$cds = sha1('flotte'.$conso.'ß10'.time().'|HB;'.rand(10, 99).$temps);
|
||||
$sess->values['flcds'] = $cds;
|
||||
$sess->put();
|
||||
$SESS->values['flcds'] = $idPrep;
|
||||
$SESS->put();
|
||||
$datas = array(
|
||||
'root' => array(
|
||||
'destination' => $destinRapid,
|
||||
'temps' => affTemp(floor($temps)),
|
||||
'deblok' => '<input type="hidden" name="cds" value="'.$cds.'" /><input type="submit" value="GO" class="submit" />',
|
||||
'conso' => separerNombres(ceil($conso*2)),
|
||||
'deblok' => '<input type="hidden" name="cds" value="'.$idPrep.'" /><input type="submit" value="GO" class="submit" />',
|
||||
'conso' => ceil($conso*2),
|
||||
'tactique' => $tactique,
|
||||
'places' => separerNombres($places)
|
||||
'places' => $places
|
||||
)
|
||||
);
|
||||
}
|
||||
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 19 KiB |
BIN
htdocs/images/planetes/100.jpg
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
htdocs/images/planetes/101.jpg
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
htdocs/images/planetes/102.jpg
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
htdocs/images/planetes/103.jpg
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
htdocs/images/planetes/104.jpg
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
htdocs/images/planetes/105.jpg
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
htdocs/images/planetes/106.jpg
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
htdocs/images/planetes/107.jpg
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
htdocs/images/planetes/108.jpg
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
htdocs/images/planetes/109.jpg
Normal file
After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 25 KiB |
BIN
htdocs/images/planetes/110.jpg
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
htdocs/images/planetes/111.jpg
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
htdocs/images/planetes/112.jpg
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
htdocs/images/planetes/113.jpg
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
htdocs/images/planetes/114.jpg
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
htdocs/images/planetes/115.jpg
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
htdocs/images/planetes/116.jpg
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
htdocs/images/planetes/117.jpg
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
htdocs/images/planetes/118.jpg
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
htdocs/images/planetes/119.jpg
Normal file
After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 24 KiB |
BIN
htdocs/images/planetes/120.jpg
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
htdocs/images/planetes/121.jpg
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
htdocs/images/planetes/122.jpg
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
htdocs/images/planetes/123.jpg
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
htdocs/images/planetes/124.jpg
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
htdocs/images/planetes/125.jpg
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
htdocs/images/planetes/126.jpg
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
htdocs/images/planetes/127.jpg
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
htdocs/images/planetes/128.jpg
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
htdocs/images/planetes/129.jpg
Normal file
After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 31 KiB |
BIN
htdocs/images/planetes/130.jpg
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
htdocs/images/planetes/131.jpg
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
htdocs/images/planetes/132.jpg
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
htdocs/images/planetes/133.jpg
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
htdocs/images/planetes/134.jpg
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
htdocs/images/planetes/135.jpg
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
htdocs/images/planetes/136.jpg
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
htdocs/images/planetes/137.jpg
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
htdocs/images/planetes/138.jpg
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
htdocs/images/planetes/139.jpg
Normal file
After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 22 KiB |
BIN
htdocs/images/planetes/140.jpg
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
htdocs/images/planetes/141.jpg
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
htdocs/images/planetes/142.jpg
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
htdocs/images/planetes/143.jpg
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
htdocs/images/planetes/144.jpg
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
htdocs/images/planetes/145.jpg
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
htdocs/images/planetes/146.jpg
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
htdocs/images/planetes/147.jpg
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
htdocs/images/planetes/148.jpg
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
htdocs/images/planetes/149.jpg
Normal file
After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 24 KiB |
BIN
htdocs/images/planetes/150.jpg
Normal file
After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 95 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 23 KiB |
BIN
htdocs/images/planetes/33.jpg
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
htdocs/images/planetes/34.jpg
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
htdocs/images/planetes/35.jpg
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
htdocs/images/planetes/36.jpg
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
htdocs/images/planetes/37.jpg
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
htdocs/images/planetes/38.jpg
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
htdocs/images/planetes/39.jpg
Normal file
After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 22 KiB |
BIN
htdocs/images/planetes/40.jpg
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
htdocs/images/planetes/41.jpg
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
htdocs/images/planetes/42.jpg
Normal file
After Width: | Height: | Size: 44 KiB |
BIN
htdocs/images/planetes/43.jpg
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
htdocs/images/planetes/44.jpg
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
htdocs/images/planetes/45.jpg
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
htdocs/images/planetes/46.jpg
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
htdocs/images/planetes/47.jpg
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
htdocs/images/planetes/48.jpg
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
htdocs/images/planetes/49.jpg
Normal file
After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 26 KiB |
BIN
htdocs/images/planetes/50.jpg
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
htdocs/images/planetes/51.jpg
Normal file
After Width: | Height: | Size: 22 KiB |