Version 1.7b
6
htdocs/.htaccess
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
php_flag magic_quotes_gpc Off
|
||||
php_flag magic_quotes_runtime Off
|
||||
php_flag magic_quotes_sybase Off
|
||||
php_flag register_globals Off
|
||||
|
||||
Options -Indexes
|
||||
1
htdocs/.onyx
Normal file
|
|
@ -0,0 +1 @@
|
|||
../onyx/
|
||||
64
htdocs/admin.php
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
<?php
|
||||
define("INDEX", 1);
|
||||
$chrono_start = microtime();
|
||||
$onyx = @file_get_contents('./.onyx') or die("Configuration introuvable.");
|
||||
define("_FCORE",trim($onyx));
|
||||
define("_PROFILE",'admin');
|
||||
require_once(_FCORE."common.php");
|
||||
|
||||
//On vérifie si le client est connecté ou non sur le site
|
||||
if (isset($sess) && isset($sess->values['connected']) && $sess->values['connected'] && !empty($sess->values['id']) && isset($sess->values['auth_level']) && $sess->values['auth_level'] >= 3 && !empty($sess->values['idPlan'])) {
|
||||
function infoPlan($galaxie, $ss, $pos, $info){
|
||||
$req = mysql_query("SELECT * FROM planete WHERE galaxie = '$galaxie' AND ss = '$ss' AND position= '$pos';");
|
||||
$resultat = mysql_fetch_array($req);
|
||||
return $resultat[$info];
|
||||
}
|
||||
|
||||
//Connexion à la base de données
|
||||
$chapeau = new bdd();
|
||||
$chapeau->connexion();
|
||||
|
||||
//Passage des valeurs générales au template
|
||||
$template->assign('version', VERSION);
|
||||
$template->assign('page','admin');
|
||||
|
||||
$chapeau->unique_query("SELECT * FROM $table_user WHERE race = 'covenant'");
|
||||
$nbcovie = $chapeau->num_rows;
|
||||
$chapeau->unique_query("SELECT * FROM $table_user WHERE race = 'humain'");
|
||||
$nbhumain = $chapeau->num_rows;
|
||||
$template->assign('count',array('humains' => $nbhumain, 'covenants' => $nbcovie, 'serveurs' => 'cette'));
|
||||
|
||||
$id_user = $sess->values['id'];
|
||||
$queryUser = $chapeau->unique_query("SELECT * FROM $table_user WHERE id = '$id_user'");
|
||||
$race = $queryUser['race'];
|
||||
$template->assign('race',$queryUser['race']);
|
||||
$template->assign('user',$queryUser);
|
||||
$tpsdejeu = time() - $queryUser['last_visite'];
|
||||
$heur = floor($tpsdejeu/3600);
|
||||
$min = floor(($tpsdejeu - $heur*3600)/60);
|
||||
if ($heur > 0) $min = $heur.' h '.$min;
|
||||
$template->assign('tpsdejeu',$min.' min');
|
||||
|
||||
if (!isset($_GET['p'])) $_GET['p'] = '';
|
||||
switch($_GET['p']){
|
||||
case 'courrier': include(_FCORE."hb_game/jeu/admin/mail.php"); break;
|
||||
case 'vip': include(_FCORE."hb_game/jeu/admin/ip.php"); break;
|
||||
case 'vflotte': include(_FCORE."hb_game/jeu/admin/flottes.php"); break;
|
||||
case 'vplanetes': include(_FCORE."hb_game/jeu/admin/planete.php"); break;
|
||||
case 'vjoueurs': include(_FCORE."hb_game/jeu/admin/joueur.php"); break;
|
||||
case 'valliances': include(_FCORE."hb_game/jeu/admin/alliance.php"); break;
|
||||
case 'vrapports': include(_FCORE."hb_game/jeu/admin/rapport.php"); break;
|
||||
case 'sjoueurs': include(_FCORE."hb_game/jeu/admin/sanction_joueur.php"); break;
|
||||
case 'cjoueurs': include(_FCORE."hb_game/jeu/admin/prendre_controle.php"); break;
|
||||
case 'djoueurs': include(_FCORE."hb_game/jeu/admin/supprimer_joueur.php"); break;
|
||||
case 'bandeau': include(_FCORE."hb_game/jeu/admin/bandeau.php"); break;
|
||||
case 'version': include(_FCORE."hb_game/jeu/admin/version.php"); break;
|
||||
default: $pagea = 'vp';;
|
||||
}
|
||||
|
||||
$template->assign('titre',$titre);
|
||||
$template->assign('pagea',$pagea);
|
||||
$template->display('admin/'.$pagea.'.tpl');
|
||||
}
|
||||
else header('Location: index.php');
|
||||
?>
|
||||
97
htdocs/ajax_flotte.php
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) define('INDEX', 1);
|
||||
include('includes/common.php');
|
||||
require('Class/JSON.php');
|
||||
|
||||
if (isset($sess) && isset($sess->values['connected']) && $sess->values['connected'] && !empty($sess->values['id']) && isset($sess->values['auth_level']) && !empty($sess->values['idPlan'])) {
|
||||
$json = new Services_JSON();
|
||||
|
||||
$chapeau = new bdd();
|
||||
$chapeau->connexion();
|
||||
$chapeau->db();
|
||||
$table = $config['db_prefix'].'planete';
|
||||
$idPlan = $sess->values['idPlan'];
|
||||
$queryPlanete = $chapeau->unique_query("SELECT * FROM `$table` WHERE `id` = '$idPlan'");
|
||||
$start_galaxie = $queryPlanete['galaxie'];
|
||||
$start_ss = $queryPlanete['ss'];
|
||||
$start_position = $queryPlanete['position'];
|
||||
|
||||
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(
|
||||
'root' => array(
|
||||
'temps' => '-',
|
||||
'deblok' => '<b>Une erreur est survenue lors de la création de la flotte. Veuillez recommencer</b>',
|
||||
'conso' => '-',
|
||||
'tactique' => ''
|
||||
)
|
||||
);
|
||||
elseif (empty($_POST['nom']) || preg_replace('@[^a-zA-Z0-9_ ]@i', '', $_POST['nom']) != $_POST['nom'])
|
||||
$datas = array(
|
||||
'root' => array(
|
||||
'temps' => '-',
|
||||
'deblok' => '<b>Nom de la flotte incorrect !</b>',
|
||||
'conso' => '-',
|
||||
'tactique' => ''
|
||||
)
|
||||
);
|
||||
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(
|
||||
'root' => array(
|
||||
'temps' => '<span style="color: #FF0000;"><b>Lieu inaccessible</b></span>',
|
||||
'deblok' => '<b>Corrigez la destination !</b>',
|
||||
'conso' => '-',
|
||||
'tactique' => ''
|
||||
)
|
||||
);
|
||||
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']);
|
||||
if ($temps <= 0) $temps = 454;
|
||||
$conso = vais_conso($temps, $sess->values['flnbvais'])*$_POST['vitesse']/45;
|
||||
$tactique = '';
|
||||
if ($_POST['mission'] == '1') {
|
||||
$tactique = ' utiliser la tactique : <select name="tactique">';
|
||||
//On récupère le niveau actuel de la technologie Commandement militaire
|
||||
$id_user = $sess->values['id'];
|
||||
$table = $config['db_prefix'].'user';
|
||||
$queryUser = $chapeau->unique_query("SELECT * FROM `$table` WHERE `id` = '$id_user'");
|
||||
$lvltechno = $queryUser['tactique'];
|
||||
$tactiquedef = $queryUser['combatAT_tactique'];
|
||||
|
||||
if ($lvltechno < 1) { //Si on a pas le niveau, on ne peux pas envoyer la flotte
|
||||
$datas = array(
|
||||
'root' => array(
|
||||
'temps' => affTemp(floor($temps)),
|
||||
'deblok' => '<b>Vous ne pouvez pas attaquer sans un minimum de connaissances militaires !</b>',
|
||||
'conso' => separerNombres(ceil($conso*$nbtrajet)),
|
||||
'tactique' => ''
|
||||
)
|
||||
);
|
||||
header("X-JSON: ".$json->encode($datas));
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
for($i=1 ; $i<=$lvltechno ; $i++) {
|
||||
if ($tactiquedef == $i) $tactique .= '<option value="'.$i.'" selected>'.txtTactique($i).'</option>';
|
||||
else $tactique .= '<option value="'.$i.'">'.txtTactique($i).'</option>';
|
||||
}
|
||||
}
|
||||
$tactique .= '</select>';
|
||||
}
|
||||
$cds = sha1('flotte'.$conso.'ß10'.time().'|HB;'.rand(10,99).$temps);
|
||||
$sess->values['flcds'] = $cds;
|
||||
$sess->put();
|
||||
$datas = array(
|
||||
'root' => array(
|
||||
'temps' => affTemp(floor($temps)),
|
||||
'deblok' => '<input type="hidden" name="cds" value="'.$cds.'" /><input type="submit" value="GO" class="submit" />',
|
||||
'conso' => separerNombres(ceil($conso*2)),
|
||||
'tactique' => $tactique
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$chapeau->deconnexion();
|
||||
header("X-JSON: ".$json->encode($datas));
|
||||
}
|
||||
?>
|
||||
BIN
htdocs/captcha/0.TTF
Normal file
BIN
htdocs/captcha/1.TTF
Normal file
BIN
htdocs/captcha/2.TTF
Normal file
8
htdocs/captcha/captUtil.php
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) define('INDEX', 1);
|
||||
include('includes/common.php');
|
||||
require_once(_FCORE."../tables.php");
|
||||
|
||||
$sess->values['id'] = 26;
|
||||
$sess->put();
|
||||
?>
|
||||
BIN
htdocs/captcha/fond_verif_img.gif
Normal file
|
After Width: | Height: | Size: 914 B |
BIN
htdocs/captcha/fond_verif_img.png
Normal file
|
After Width: | Height: | Size: 240 B |
74
htdocs/captcha/image.php
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
<?php
|
||||
session_start();
|
||||
if(!defined('INDEX')) define('INDEX', 1);
|
||||
//include('../includes/common.php');
|
||||
|
||||
// On défini la configuration :
|
||||
if(!IsSet($_GET['nbr_chiffres']) || $_GET['nbr_chiffres'] < 5) {
|
||||
$nbr_chiffres = 7; // Nombre de chiffres qui formerons le nombre par défaut
|
||||
}
|
||||
else {
|
||||
$nbr_chiffres = $_GET['nbr_chiffres']; // Si l'on met dans l'adresse un ?nbr_chiffres=X
|
||||
}
|
||||
|
||||
// Là, on défini le header de la page pour la transformer en image
|
||||
header ("Content-type: image/png");
|
||||
// Là, on crée notre image
|
||||
$_img = imagecreatefromgif('fond_verif_img.gif');
|
||||
|
||||
// On défini maintenant les couleurs
|
||||
// Couleur de fond :
|
||||
//$arriere_plan = imagecolorallocate($_img, 0, 0, 0); // Au cas où on utiliserai pas d'image de fond, on utilise cette couleur là.
|
||||
// Autres couleurs :
|
||||
$couleur = mt_rand(0, 4);
|
||||
if ($couleur == 0) $avant_plan = imagecolorallocate($_img, rand(250,225), rand(0,25), rand(0,25));
|
||||
elseif ($couleur == 1) $avant_plan = imagecolorallocate($_img, rand(0,25), rand(250,225), rand(0,25));
|
||||
// elseif ($couleur == 2) $avant_plan = imagecolorallocate($_img, rand(0,55), rand(0,55), rand(250,255));
|
||||
elseif ($couleur == 3) $avant_plan = imagecolorallocate($_img, rand(0,25), rand(250,225), rand(250,225));
|
||||
elseif ($couleur == 4) $avant_plan = imagecolorallocate($_img, rand(250,225), rand(0,25), rand(250,225));
|
||||
elseif ($couleur == 5) $avant_plan = imagecolorallocate($_img, rand(250,225), rand(250,225), rand(0,25));
|
||||
else $avant_plan = imagecolorallocate($_img, rand(200,225), rand(200,225), rand(200,225)); // Couleur des chiffres
|
||||
|
||||
$i = 0;
|
||||
while($i < $nbr_chiffres) {
|
||||
$chiffre = mt_rand(1, 18); // On génère le nombre aléatoire
|
||||
if ($chiffre == 10) $chiffre="a";
|
||||
elseif ($chiffre == 2) $chiffre="w";
|
||||
elseif ($chiffre == 11) $chiffre="t";
|
||||
elseif ($chiffre == 12) $chiffre="c";
|
||||
elseif ($chiffre == 13) $chiffre="n";
|
||||
elseif ($chiffre == 14) $chiffre="p"; // e avec l'écriture Google
|
||||
elseif ($chiffre == 15) $chiffre="f";
|
||||
elseif ($chiffre == 16) $chiffre="y";
|
||||
elseif ($chiffre == 17) $chiffre="m";
|
||||
elseif ($chiffre == 18) $chiffre="k";
|
||||
$chiffres[$i] = $chiffre;
|
||||
$i++;
|
||||
}
|
||||
$nombre = null;
|
||||
// On explore le tableau $chiffres afin d'y afficher toutes les entrées qu'y s'y trouvent
|
||||
foreach ($chiffres as $caractere) {
|
||||
$nombre .= $caractere;
|
||||
}
|
||||
|
||||
$_SESSION['aleat_nbr'] = strtolower($nombre);
|
||||
//$sess->values['aleatnbr'] = strtolower($nombre);
|
||||
//$sess->put();
|
||||
|
||||
// On détruit les variables inutiles :
|
||||
unset($chiffre);
|
||||
unset($i);
|
||||
unset($caractere);
|
||||
unset($chiffres);
|
||||
|
||||
//$fontfile = mt_rand(0, 2).'.TTF';
|
||||
// Free
|
||||
//$fontfile = '/mnt/152/free.fr/b/c/www.msnparadize/util/ab/1.TTF';
|
||||
$fontfile = './2.TTF';
|
||||
|
||||
//imagestring($_img, 5, 18, 8, $nombre, $avant_plan);
|
||||
if ($fontfile == './0.TTF') ImageTTFText($_img, 18, 2, 0, 23, $avant_plan, $fontfile, strtoupper($nombre));
|
||||
else ImageTTFText($_img, 18.5, 2, rand(0,6), 23, $avant_plan, $fontfile, $nombre);
|
||||
|
||||
imagepng($_img);
|
||||
?>
|
||||
234
htdocs/cron/classement.php
Normal file
|
|
@ -0,0 +1,234 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) define('INDEX', 1);
|
||||
//Script by Keiran
|
||||
|
||||
set_time_limit(0);
|
||||
|
||||
$onyx = @file_get_contents('./../.onyx') or die("Configuration introuvable.");
|
||||
define("_FCORE",'../'.trim($onyx));
|
||||
require(_FCORE."common.php");
|
||||
include(_FCORE."hb_game/classement/fonctions.php");
|
||||
|
||||
$chapeau = new bdd();
|
||||
$chapeau->connexion();
|
||||
$chapeau->db();
|
||||
|
||||
##################################################
|
||||
#MAJ classement Joueurs
|
||||
##################################################
|
||||
mysql_query("TRUNCATE TABLE `classement`");
|
||||
$sql_1 = mysql_query("SELECT * FROM `user`");
|
||||
while($recup_id = mysql_fetch_array($sql_1)) {
|
||||
|
||||
$id = $recup_id['id'];
|
||||
$PSEUDO_USER = $recup_id['pseudo'];
|
||||
$race = $recup_id['race'];
|
||||
|
||||
$planete = mysql_query("SELECT * FROM `planete` WHERE `id_user` = " . $id)or die( mysql_error() );
|
||||
while ($donnees_planete = mysql_fetch_array($planete)) {
|
||||
|
||||
// partie pts batiements ressources
|
||||
$POINTS_BATIMENTS += batiment1($donnees_planete['mine_m'] ) + batiment2( $donnees_planete['mine_c'] ) + batiment3( $donnees_planete['mine_h'] ) + batiment4( $donnees_planete['centrale_s'] ) + batiment5( $donnees_planete['centrale_f'] ) + batiment6( $donnees_planete['radar'] ) + batiment7( $donnees_planete['labo'] ) + batiment8( $donnees_planete['chantier_terrestre'] ) + batiment9( $donnees_planete['chantier_spatial'] ) /* + batiment10( $donnees_planete['caserne'] )*/ + batiment11( $donnees_planete['silo'] ) + batiment11( $donnees_planete['centre_info'] );
|
||||
|
||||
// partie pts def ressources
|
||||
|
||||
$metal_d += 500 * $donnees_planete['def_1'];
|
||||
$cristal_d += 200 * $donnees_planete['def_1'];
|
||||
|
||||
$metal_d += 4000 * $donnees_planete['def_2'];
|
||||
$cristal_d += 2000 * $donnees_planete['def_2'];
|
||||
|
||||
$metal_d += 4500 * $donnees_planete['def_3'];
|
||||
$cristal_d += 800 * $donnees_planete['def_3'];
|
||||
$hydrogene_d += 600 * $donnees_planete['def_3'];
|
||||
|
||||
$metal_d += 12000 * $donnees_planete['def_4'];
|
||||
$cristal_d += 10000 * $donnees_planete['def_4'];
|
||||
$hydrogene_d += 1000 * $donnees_planete['def_4'];
|
||||
|
||||
$metal_d += 15000 * $donnees_planete['def_5'];
|
||||
$cristal_d += 9500 * $donnees_planete['def_5'];
|
||||
$hydrogene_d += 1500 * $donnees_planete['def_5'];
|
||||
|
||||
// partie pts vaiseaux
|
||||
|
||||
$POINTS_VAISSEAUX += $donnees_planete['vaisseau_1'] + $donnees_planete['vaisseau_2'] + $donnees_planete['vaisseau_3'] + $donnees_planete['vaisseau_4'] + $donnees_planete['vaisseau_5'] + $donnees_planete['vaisseau_6'] + $donnees_planete['vaisseau_7'] + $donnees_planete['vaisseau_8'] + $donnees_planete['vaisseau_9'] + $donnees_planete['vaisseau_10'] + $donnees_planete['vaisseau_11']+ $donnees_planete['vaisseau_12'];
|
||||
|
||||
// partie pts vaiseaux ressources
|
||||
|
||||
// 'cargos de classe Parabola', 1
|
||||
$metal += ( $donnees_planete['vaisseau_1'] * 1000 );
|
||||
$cristal += ( $donnees_planete['vaisseau_1'] * 800 );
|
||||
|
||||
// 'cargos de classe Laden', 2
|
||||
$metal += ( $donnees_planete['vaisseau_2'] * 4000 );
|
||||
$cristal += ( $donnees_planete['vaisseau_2'] * 3000 );
|
||||
|
||||
// 'vaisseau(X) de colonisation de classe Odyssey', 3
|
||||
$metal += ( $donnees_planete['vaisseau_3'] * 9000 );
|
||||
$cristal += ( $donnees_planete['vaisseau_3'] * 9000 );
|
||||
$hydrogene += ( $donnees_planete['vaisseau_3'] * 1000 );
|
||||
|
||||
// 'drone(s) d\'espionnage de classe Clarion', 4
|
||||
$metal += ( $donnees_planete['vaisseau_4'] * 1000) ;
|
||||
$cristal += ( $donnees_planete['vaisseau_4'] * 1200 );
|
||||
$hydrogene += ( $donnees_planete['vaisseau_4'] * 100 );
|
||||
|
||||
// 'recycleur(s) de classe Minotaur', 5
|
||||
//SELECT * FROM `user` WHERE 1$metal += ( $donnees_planete['vaisseau_5'] * 15000 );
|
||||
$cristal += ( $donnees_planete['vaisseau_5'] * 9000 );
|
||||
$hydrogene += ( $donnees_planete['vaisseau_5'] * 1000 );
|
||||
|
||||
// 'C709 Longsword Interceptor', 6
|
||||
$metal += ( $donnees_planete['vaisseau_6'] * 1700 );
|
||||
$cristal += ( $donnees_planete['vaisseau_6'] * 1220 );
|
||||
|
||||
// 'Frégates', 7
|
||||
$metal += ( $donnees_planete['vaisseau_7'] * 5800 );
|
||||
$cristal += ( $donnees_planete['vaisseau_7'] * 1400 );
|
||||
|
||||
// 'croiseur(s) de classe Halcyon', 8
|
||||
$metal += ( $donnees_planete['vaisseau_8'] * 20000 );
|
||||
$cristal += ( $donnees_planete['vaisseau_8'] * 16000 );
|
||||
$hydrogene += ( $donnees_planete['vaisseau_8'] * 1600 );
|
||||
|
||||
// 'croiseur(s) de classe Marathon', 9
|
||||
$metal += ( $donnees_planete['vaisseau_9'] * 26000 );
|
||||
$cristal += ( $donnees_planete['vaisseau_9'] * 16400 );
|
||||
$hydrogene += ( $donnees_planete['vaisseau_9'] * 1600 );
|
||||
|
||||
// 'porte vaisseaux', 10
|
||||
$metal += ( $donnees_planete['vaisseau_10'] * 60000 );
|
||||
$cristal += ( $donnees_planete['vaisseau_10'] * 40000 );
|
||||
$hydrogene += ( $nb_vaisseaux['vaisseau_10'] * 3000 );
|
||||
|
||||
$METAL_VAISSEAUX = $metal;
|
||||
$CRISTAL_VAISSEAUX = $cristal;
|
||||
$HYDROGENE_VAISSEAUX = $hydrogene;
|
||||
$RESSOURCES_VAISSEAUX = $METAL_VAISSEAUX + $CRISTAL_VAISSEAUX + $HYDROGENE_VAISSEAUX;
|
||||
|
||||
|
||||
} // boucle planetes -->
|
||||
|
||||
// partie pts techno
|
||||
$techno_db = mysql_query("SELECT `informatique`, `detection`, `armement`, `energie_t`, `reacteur`, `reacteur_f`, `reacteur_ff`, `medecine`, `tactique`, `spartan`, `blindage` FROM `user` WHERE `id` = ".$id)or die(mysql_error());
|
||||
while ($techno = mysql_fetch_array($techno_db)) {
|
||||
|
||||
$POINTS_TECHNO = $techno['informatique'] + $techno['detection'] + $techno['armement'] + $techno['energie_t'] + $techno['reacteur'] + $techno['reacteur_f'] + $techno['reacteur_ff'] + $techno['medecine'] + $techno['tactique'] + $techno['spartan'] + $techno['blindage'];
|
||||
|
||||
// partie pts techno ressources
|
||||
$RESSOURCES_TECHNO = techno1( $techno['informatique'] ) + techno2( $techno['detection'] ) + techno3( $techno['armement'] ) + techno4( $techno['energie_t'] ) + techno5( $techno['reacteur'] ) + techno6( $techno['reacteur_f'] ) + techno7( $techno['reacteur_ff'] ) + techno8( $techno['medecine'] ) + techno9( $techno['tactique'] ) + techno10( $techno['spartan'] ) + techno11( $techno['blindage'] );
|
||||
}
|
||||
|
||||
$PT_RESSOURCES = ( $RESSOURCES_VAISSEAUX + $RESSOURCES_TECHNO + $POINTS_BATIMENTS ) / 1000;
|
||||
$POINTS_BATIMENTS = $POINTS_BATIMENTS / 1000;
|
||||
|
||||
// points flottes terrestres recherches batiments
|
||||
if ($recup_id['auth_level'] < 3) mysql_query("INSERT INTO `classement` VALUES (NULL, '$PSEUDO_USER', '$race', '$PT_RESSOURCES', '$POINTS_VAISSEAUX', '0', '$POINTS_TECHNO', '$POINTS_BATIMENTS')") or die (mysql_error());
|
||||
mysql_query("UPDATE `user` SET `flotte` = '" . $POINTS_VAISSEAUX . "', `recherches` = '" . $POINTS_TECHNO . "', `batiments` = '" . $POINTS_BATIMENTS . "', `points` = '" . $PT_RESSOURCES . "' WHERE `pseudo` = '" . $PSEUDO_USER . "'") or die (mysql_error());
|
||||
|
||||
$metal = 0;
|
||||
$cristal = 0;
|
||||
$hydrogene = 0;
|
||||
$POINTS_VAISSEAUX = 0;
|
||||
$POINTS_TECHNO = 0;
|
||||
$PT_RESSOURCES = 0;
|
||||
$METAL_VAISSEAUX = 0;
|
||||
$CRISTAL_VAISSEAUX = 0;
|
||||
$HYDROGENE_VAISSEAUX = 0;
|
||||
$RESSOURCES_VAISSEAUX = 0;
|
||||
$POINTS_BATIMENTS = 0;
|
||||
|
||||
}
|
||||
|
||||
$sql_2 = mysql_query("SELECT * FROM `classement` ORDER BY `classement`.`points` DESC");
|
||||
$i=0;
|
||||
while($resultat = mysql_fetch_array($sql_2)) {
|
||||
$nomuser = $resultat['pseudo'];
|
||||
$reqd = mysql_query("SELECT `auth_level` FROM `user` WHERE `pseudo` = '$nomuser'");
|
||||
$resultatd = mysql_fetch_array($reqd);
|
||||
if ($resultatd['auth_level'] < 3) {
|
||||
$i++;
|
||||
mysql_query("UPDATE `user` SET `place_points` = '$i' WHERE `pseudo` = '$nomuser'");
|
||||
}
|
||||
else mysql_query("UPDATE `user` SET `place_points` = '0' WHERE `pseudo` = '$nomuser'");
|
||||
}
|
||||
|
||||
##################################################
|
||||
#MAJ classement Ally
|
||||
##################################################
|
||||
mysql_query("TRUNCATE TABLE `classement_alliances`");
|
||||
|
||||
//recuperation de l'id et du tag de l'ally
|
||||
$sql_1 = mysql_query("SELECT t1.id_alliance ,t2.tag
|
||||
FROM `user` AS t1
|
||||
INNER JOIN `alliances` AS t2 ON t1.id_alliance = t2.id
|
||||
GROUP BY t1.id_alliance
|
||||
");
|
||||
while($recup_id = mysql_fetch_array($sql_1))
|
||||
{
|
||||
|
||||
$id_ally = $recup_id['id_alliance'];
|
||||
$tag_ally = $recup_id['tag'];
|
||||
|
||||
// recuperation du nombre de membre dans l'ally
|
||||
$nb_members = mysql_query(" SELECT COUNT( * )
|
||||
FROM `user` AS t1
|
||||
WHERE t1.id_alliance = $id_ally
|
||||
");
|
||||
$nb_members= mysql_fetch_row($nb_members);
|
||||
|
||||
// recuperation de la somme des points de l'ally
|
||||
$nb_points = mysql_query("SELECT SUM( classement.points )
|
||||
FROM classement, user
|
||||
WHERE user.id_alliance = $id_ally
|
||||
AND user.pseudo = classement.pseudo
|
||||
");
|
||||
$nb_points= mysql_fetch_row($nb_points);
|
||||
|
||||
$nb_points_by_members = ceil($nb_points/$nb_members);
|
||||
|
||||
// recuperation de la somme des points flottes de l'ally
|
||||
$nb_points_flottes = mysql_query("SELECT SUM( classement.flottes )
|
||||
FROM classement, user
|
||||
WHERE user.id_alliance = $id_ally
|
||||
AND user.pseudo = classement.pseudo
|
||||
");
|
||||
$nb_points_flottes= mysql_fetch_row($nb_points_flottes);
|
||||
|
||||
$nb_points_flottes_by_members = ceil($nb_points_flottes/$nb_members);
|
||||
|
||||
// recuperation de la somme des points terrestres de l'ally
|
||||
$nb_points_terrestres = mysql_query("SELECT SUM( classement.terrestres )
|
||||
FROM classement, user
|
||||
WHERE user.id_alliance = $id_ally
|
||||
AND user.pseudo = classement.pseudo
|
||||
");
|
||||
$nb_points_terrestres= mysql_fetch_row($nb_points_terrestres);
|
||||
|
||||
$nb_points_terrestres_by_members = ceil($nb_points_terrestres/$nb_members);
|
||||
|
||||
// recuperation de la somme des points recherches de l'ally
|
||||
$nb_points_recherches = mysql_query("SELECT SUM( classement.recherches )
|
||||
FROM classement, user
|
||||
WHERE user.id_alliance = $id_ally
|
||||
AND user.pseudo = classement.pseudo
|
||||
");
|
||||
$nb_points_recherches= mysql_fetch_row($nb_points_recherches);
|
||||
|
||||
$nb_points_recherches_by_members = ceil($nb_points_recherches/$nb_members);
|
||||
|
||||
// recuperation de la somme des points batiments de l'ally
|
||||
$nb_points_batiments = mysql_query("SELECT SUM( classement.batiments )
|
||||
FROM classement, user
|
||||
WHERE user.id_alliance = $id_ally
|
||||
AND user.pseudo = classement.pseudo
|
||||
");
|
||||
$nb_points_batiments= mysql_fetch_row($nb_points_batiments);
|
||||
|
||||
$nb_points_batiments_by_members = ceil($nb_points_batiments/$nb_members);
|
||||
|
||||
mysql_query("INSERT INTO `classement_alliances` VALUES (NULL, '$tag_ally', '$nb_members[0]', '$nb_points[0]','$nb_points_by_members', '$nb_points_flottes[0]','$nb_points_flottes_by_members', '$nb_points_terrestres[0]', '$nb_points_terrestres_by_members', '$nb_points_recherches[0]', '$nb_points_recherches_by_members', '$nb_points_batiments[0]', '$nb_points_batiments_by_members')");
|
||||
}
|
||||
$chapeau->deconnexion();
|
||||
?>
|
||||
15
htdocs/cron/optimize.php
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) define('INDEX', 1);
|
||||
|
||||
set_time_limit(0);
|
||||
require('../includes/common.php');
|
||||
|
||||
$chapeau = new bdd();
|
||||
$chapeau->connexion();
|
||||
$chapeau->db();
|
||||
|
||||
$chapeau->query("OPTIMIZE TABLE `alliances` , `alliances_attente` , `alliances_chat` , `alliances_creation` , `alliances_grade` , `banni` , `bug` , `classement` , `flottes` , `flottes_combats` , `historique` , `infoshead` , `mail` , `planete` , `registre_identification` , `securite_identification` , `sessions` , `user` , `user_inscriptions` , `version`;
|
||||
TRUNCATE TABLE `registre_identification`;");
|
||||
|
||||
$chapeau->deconnexion();
|
||||
?>
|
||||
BIN
htdocs/favicon.ico
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
htdocs/images/accueil/annonce.jpg
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
htdocs/images/accueil/dossier.jpg
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
htdocs/images/accueil/news_img.jpg
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
htdocs/images/accueil/stat.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
htdocs/images/batiments/baseradardl3.jpg
Normal file
|
After Width: | Height: | Size: 47 KiB |
BIN
htdocs/images/batiments/caserncov0ry.jpg
Normal file
|
After Width: | Height: | Size: 44 KiB |
BIN
htdocs/images/batiments/caserne.jpg
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
htdocs/images/batiments/centrale electrique.jpg
Normal file
|
After Width: | Height: | Size: 47 KiB |
BIN
htdocs/images/batiments/centrale solaire.jpg
Normal file
|
After Width: | Height: | Size: 60 KiB |
BIN
htdocs/images/batiments/centrale_f.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
htdocs/images/batiments/centrale_fusion.jpg
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
htdocs/images/batiments/centrale_s.JPG
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
htdocs/images/batiments/centrederecherchegu9.jpg
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
htdocs/images/batiments/chantier spatial.jpg
Normal file
|
After Width: | Height: | Size: 40 KiB |
BIN
htdocs/images/batiments/chantier-spatial.jpg
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
htdocs/images/batiments/chantier-terrestre.jpg
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
htdocs/images/batiments/chantier_terrestre.jpg
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
htdocs/images/batiments/chantier_terrestre.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
htdocs/images/batiments/chantierspatialff8.jpg
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
htdocs/images/batiments/chantierterrestrecopybj8.jpg
Normal file
|
After Width: | Height: | Size: 49 KiB |
BIN
htdocs/images/batiments/chantierterrestrehg1.jpg
Normal file
|
After Width: | Height: | Size: 39 KiB |
BIN
htdocs/images/batiments/chantierterrestrenz5.jpg
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
htdocs/images/batiments/covbase25ro.jpg
Normal file
|
After Width: | Height: | Size: 41 KiB |
BIN
htdocs/images/batiments/covielabocn5.jpg
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
htdocs/images/batiments/cristaloo3.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
htdocs/images/batiments/ecole militaire.jpg
Normal file
|
After Width: | Height: | Size: 50 KiB |
BIN
htdocs/images/batiments/ecole_militaire.jpg
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
htdocs/images/batiments/entrepot.jpg
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
htdocs/images/batiments/generateurafusiondb2.jpg
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
htdocs/images/batiments/generateurdecristalmh5.jpg
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
htdocs/images/batiments/generateurdemetalsg0.jpg
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
htdocs/images/batiments/generateurdenergievb7.jpg
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
htdocs/images/batiments/generateurdhydrognedh3.jpg
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
htdocs/images/batiments/informatique.jpg
Normal file
|
After Width: | Height: | Size: 41 KiB |
BIN
htdocs/images/batiments/ionisateur.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
htdocs/images/batiments/ioniseurdn4.jpg
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
htdocs/images/batiments/mine_c.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
htdocs/images/batiments/mine_m.jpg
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
htdocs/images/batiments/mine_m.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
htdocs/images/batiments/nanw9.jpg
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
htdocs/images/batiments/oeil.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
htdocs/images/batiments/oeilduprophetewj6.jpg
Normal file
|
After Width: | Height: | Size: 40 KiB |
BIN
htdocs/images/batiments/ordianteur_hologramme.jpg
Normal file
|
After Width: | Height: | Size: 7 KiB |
BIN
htdocs/images/batiments/powersupplycoviejq1.jpg
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
htdocs/images/batiments/purificateur_c.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
htdocs/images/batiments/purificateur_m.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
htdocs/images/batiments/purificateurdemtalhb3.jpg
Normal file
|
After Width: | Height: | Size: 39 KiB |
BIN
htdocs/images/batiments/radar.jpg
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
htdocs/images/batiments/recherches.jpg
Normal file
|
After Width: | Height: | Size: 40 KiB |
BIN
htdocs/images/batiments/sanstitretruecolor09zn6.jpg
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
htdocs/images/batiments/sanstitrevi7.jpg
Normal file
|
After Width: | Height: | Size: 41 KiB |
BIN
htdocs/images/batiments/search0yp.jpg
Normal file
|
After Width: | Height: | Size: 56 KiB |
BIN
htdocs/images/batiments/silo.jpg
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
htdocs/images/batiments/solaire.jpg
Normal file
|
After Width: | Height: | Size: 48 KiB |
BIN
htdocs/images/batiments/stockage.jpg
Normal file
|
After Width: | Height: | Size: 40 KiB |
BIN
htdocs/images/batiments/stockagebasement1cs10bl.jpg
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
htdocs/images/batiments/synchroniseur.jpg
Normal file
|
After Width: | Height: | Size: 39 KiB |
BIN
htdocs/images/caserne/31598918ol1.jpg
Normal file
|
After Width: | Height: | Size: 35 KiB |
BIN
htdocs/images/caserne/72188202fg9.jpg
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
htdocs/images/caserne/81770345oo4.jpg
Normal file
|
After Width: | Height: | Size: 37 KiB |
BIN
htdocs/images/caserne/85631315fq7.jpg
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
htdocs/images/caserne/86497470qz6.jpg
Normal file
|
After Width: | Height: | Size: 35 KiB |
BIN
htdocs/images/caserne/88091275ja8.jpg
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
htdocs/images/caserne/88218731ts1.jpg
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
htdocs/images/caserne/94990342wb4.jpg
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
htdocs/images/caserne/98004530fx3.jpg
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
htdocs/images/caserne/TCAO2.jpg
Normal file
|
After Width: | Height: | Size: 49 KiB |
BIN
htdocs/images/caserne/brute.jpg
Normal file
|
After Width: | Height: | Size: 44 KiB |
BIN
htdocs/images/caserne/defenseurlegerhs8.jpg
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
htdocs/images/caserne/defenseurlourdhr3.jpg
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
htdocs/images/caserne/drone.jpg
Normal file
|
After Width: | Height: | Size: 55 KiB |
BIN
htdocs/images/caserne/elite.jpg
Normal file
|
After Width: | Height: | Size: 48 KiB |
BIN
htdocs/images/caserne/exosquelettehbpb2.jpg
Normal file
|
After Width: | Height: | Size: 31 KiB |
BIN
htdocs/images/caserne/grenadier.jpg
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
htdocs/images/caserne/grunt1.jpg
Normal file
|
After Width: | Height: | Size: 55 KiB |
BIN
htdocs/images/caserne/hunter1.jpg
Normal file
|
After Width: | Height: | Size: 54 KiB |
BIN
htdocs/images/caserne/ingenieur_c.jpg
Normal file
|
After Width: | Height: | Size: 49 KiB |
BIN
htdocs/images/caserne/ingenieurs.jpg
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
htdocs/images/caserne/jackal.jpg
Normal file
|
After Width: | Height: | Size: 50 KiB |
BIN
htdocs/images/caserne/jackalsniper.jpg
Normal file
|
After Width: | Height: | Size: 45 KiB |
BIN
htdocs/images/caserne/marinehf0.jpg
Normal file
|
After Width: | Height: | Size: 49 KiB |
BIN
htdocs/images/caserne/marines.jpg
Normal file
|
After Width: | Height: | Size: 46 KiB |
BIN
htdocs/images/caserne/medecin.jpg
Normal file
|
After Width: | Height: | Size: 39 KiB |
BIN
htdocs/images/caserne/medecin_c.jpg
Normal file
|
After Width: | Height: | Size: 52 KiB |
BIN
htdocs/images/caserne/scoutma3.jpg
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
htdocs/images/caserne/sentinellelegerecn4.jpg
Normal file
|
After Width: | Height: | Size: 12 KiB |