forked from halo-battle/game
Version 1.12
This commit is contained in:
parent
2a066a7498
commit
de31cd3e9a
1373 changed files with 156282 additions and 45238 deletions
|
|
@ -1,10 +1,12 @@
|
|||
<?php
|
||||
//Définition de la constante anti-hacking
|
||||
define("INDEX", 1);
|
||||
$chrono_start = microtime();
|
||||
$onyx = @file_get_contents('./.onyx') or die("Configuration introuvable.");
|
||||
define("_FCORE",trim($onyx));
|
||||
define("xCSRF",true);
|
||||
require_once(_FCORE."common.php");
|
||||
define("DEBUG", false);
|
||||
define("xCSRF",true); //On annule la vérification des attaques CSRF car on sait que toutes les requêtes viennent d'un autre serveur, deplus les risques sont minimes
|
||||
|
||||
//Inclusion de l'API Onyx
|
||||
require_once(trim(file_get_contents('./.onyx')));
|
||||
require_once("common.php"); //Chargement de tout le nécessaire pour le jeu
|
||||
|
||||
$id = gpc('i');
|
||||
if (!is_numeric($id)) $id = 0;
|
||||
|
|
@ -14,13 +16,13 @@ $s = gpc('s');
|
|||
|
||||
header ("Content-type: image/png");
|
||||
|
||||
if (file_exists(_FCORE."hb_game/cache/signatures/".$id.".".$f.$s.".sign") && time() - filemtime(_FCORE."../game/cache/signatures/".$id.".".$f.$s.".sign") < $config['cache']['signatures']) {
|
||||
readfile(_FCORE."../game/cache/signatures/".$id.".".$f.$s.".sign");
|
||||
if (file_exists(ONYX."cache/signatures/".$id.".".$f.$s.".sign") && time() - filemtime(ONYX."cache/signatures/".$id.".".$f.$s.".sign") < 36000) {
|
||||
readfile(ONYX."cache/signatures/".$id.".".$f.$s.".sign");
|
||||
}
|
||||
else {
|
||||
$fontfile = _FCORE."../game/signatures/ARIAL.TTF";
|
||||
$fontfile = ONYX."include/content/signatures/ARIAL.TTF";
|
||||
|
||||
$bdd->connexion();
|
||||
$bdd = new BDD();
|
||||
$bdd->escape($id);
|
||||
$joueur = $bdd->unique_query("SELECT $table_user.pseudo, $table_user.auth_level, $table_user.race, $table_user.place_points, $table_user.points, $table_user.batiments, $table_user.flotte, $table_alliances.tag, $table_alliances.nom FROM $table_user INNER JOIN $table_alliances ON $table_user.id_alliance = $table_alliances.id WHERE $table_user.id = $id;");
|
||||
if ($joueur == false) $joueur = $bdd->unique_query("SELECT pseudo, auth_level, race, place_points, points, batiments, flotte FROM $table_user WHERE id = $id;");
|
||||
|
|
@ -29,11 +31,11 @@ else {
|
|||
$transport = $bdd->unique_query("SELECT COUNT(id) AS nombre FROM $table_mail WHERE contenu LIKE 'Les vaisseaux de $nomjoueur %';");
|
||||
$bdd->deconnexion();
|
||||
|
||||
if (!empty($s) && $joueur['auth_level'] >= 1) {
|
||||
if (!empty($s) && $joueur['auth_level'] >= 1){
|
||||
switch($s){
|
||||
case 1:
|
||||
$img = 'mixte1userbarju7.png';
|
||||
$_img = imagecreatefrompng(_FCORE."../game/signatures/".$img);
|
||||
$_img = imagecreatefrompng(ONYX."include/content/signatures/".$img);
|
||||
$entete = imagecolorallocate($_img, 255, 255, 255);
|
||||
$contenu = imagecolorallocate($_img, 255, 255, 255);
|
||||
$infos = array(
|
||||
|
|
@ -57,7 +59,7 @@ else {
|
|||
break;
|
||||
default:
|
||||
$img = 'mixte1userbarju7.png';
|
||||
$_img = imagecreatefrompng(_FCORE."../game/signatures/".$img);
|
||||
$_img = imagecreatefrompng(ONYX."include/content/signatures/".$img);
|
||||
$entete = imagecolorallocate($_img, 255, 255, 255);
|
||||
$contenu = imagecolorallocate($_img, 255, 255, 255);
|
||||
$infos = array(
|
||||
|
|
@ -79,14 +81,14 @@ else {
|
|||
)
|
||||
);
|
||||
}
|
||||
if ($joueur['race'] == 'covenant') $_imgavatar = imagecreatefrompng(_FCORE."../game/signatures/covi.png");
|
||||
else $_imgavatar = imagecreatefrompng(_FCORE."../game/signatures/hum.png");
|
||||
if ($joueur['race'] == 'covenant') $_imgavatar = imagecreatefrompng(ONYX."include/content/signatures/covi.png");
|
||||
else $_imgavatar = imagecreatefrompng(ONYX."include/content/signatures/hum.png");
|
||||
}
|
||||
elseif ($joueur['race'] == 'covenant') {
|
||||
switch($f){
|
||||
case 1:
|
||||
$img = 'userbarallicopygs1.png';
|
||||
$_img = imagecreatefrompng(_FCORE."../game/signatures/".$img);
|
||||
$_img = imagecreatefrompng(ONYX."include/content/signatures/".$img);
|
||||
$entete = imagecolorallocate($_img, 255, 255, 255);
|
||||
$contenu = imagecolorallocate($_img, 255, 255, 255);
|
||||
$infos = array(
|
||||
|
|
@ -110,7 +112,7 @@ else {
|
|||
break;
|
||||
default:
|
||||
$img = 'covenantuserbarus1.png';
|
||||
$_img = imagecreatefrompng(_FCORE."../game/signatures/".$img);
|
||||
$_img = imagecreatefrompng(ONYX."include/content/signatures/".$img);
|
||||
$entete = imagecolorallocate($_img, 255, 255, 255);
|
||||
$contenu = imagecolorallocate($_img, 0, 0, 0);
|
||||
$infos = array(
|
||||
|
|
@ -132,13 +134,13 @@ else {
|
|||
)
|
||||
);
|
||||
}
|
||||
$_imgavatar = imagecreatefrompng(_FCORE."../game/signatures/covi.png");
|
||||
$_imgavatar = imagecreatefrompng(ONYX."include/content/signatures/covi.png");
|
||||
}
|
||||
else {
|
||||
switch($f){
|
||||
case 1:
|
||||
$img = 'userbarallicopygs1.png';
|
||||
$_img = imagecreatefrompng(_FCORE."../game/signatures/".$img);
|
||||
$_img = imagecreatefrompng(ONYX."include/content/signatures/".$img);
|
||||
$entete = imagecolorallocate($_img, 255, 255, 255);
|
||||
$contenu = imagecolorallocate($_img, 255, 255, 255);
|
||||
$infos = array(
|
||||
|
|
@ -162,7 +164,7 @@ else {
|
|||
break;
|
||||
default:
|
||||
$img = 'humainuserbarhz2.png';
|
||||
$_img = imagecreatefrompng(_FCORE."../game/signatures/".$img);
|
||||
$_img = imagecreatefrompng(ONYX."include/content/signatures/".$img);
|
||||
$entete = imagecolorallocate($_img, 255, 255, 255);
|
||||
//$contenu = imagecolorallocate($_img, 160, 160, 0);
|
||||
$contenu = imagecolorallocate($_img, 255, 255, 255);
|
||||
|
|
@ -185,7 +187,7 @@ else {
|
|||
)
|
||||
);
|
||||
}
|
||||
$_imgavatar = imagecreatefrompng(_FCORE."../game/signatures/hum.png");
|
||||
$_imgavatar = imagecreatefrompng(ONYX."include/content/signatures/hum.png");
|
||||
}
|
||||
|
||||
$blanc = imagecolorallocate($_img, 255, 255, 255);
|
||||
|
|
@ -197,14 +199,14 @@ else {
|
|||
|
||||
if ($joueur == false) {
|
||||
ImageTTFText($_img, 20, -20, 123, 17, $rouge, $fontfile, 'Joueur introuvable !');
|
||||
if (file_exists(_FCORE."../game/cache/signatures/".$id.".".$f.$s.".sign")) unlink(_FCORE."../game/cache/signatures/".$id.".".$f.$s.".sign");
|
||||
if (file_exists(ONYX."/cache/signatures/".$id.".".$f.$s.".sign")) unlink(ONYX."/cache/signatures/".$id.".".$f.$s.".sign");
|
||||
}
|
||||
else {
|
||||
if ($joueur['auth_level'] > 4) ImageTTFText($_img, 12, 0, 45, 23, $vert, $fontfile, ucfirst($joueur['pseudo']));
|
||||
elseif ($joueur['auth_level'] >= 1) ImageTTFText($_img, 12, 0, 45, 23, $jaune, $fontfile, ucfirst($joueur['pseudo']));
|
||||
else ImageTTFText($_img, 12, 0, 45, 23, $entete, $fontfile, ucfirst($joueur['pseudo']));
|
||||
|
||||
ImageTTFText($_img, 12, 0, 255, 23, $entete, $fontfile, $config['serveur_name']);
|
||||
ImageTTFText($_img, 12, 0, 255, 23, $entete, $fontfile, $VAR['serveur_name']);
|
||||
|
||||
if (isset($joueur['tag'])) {
|
||||
if (empty($joueur['place_points'])) ImageTTFText($_img, 11, 0, 32, 47, $contenu, $fontfile, "Classement : Non classé");
|
||||
|
|
@ -230,8 +232,8 @@ else {
|
|||
|
||||
if ($joueur == false) imagepng($_img);
|
||||
else {
|
||||
imagepng($_img, _FCORE."../game/cache/signatures/".$id.".".$f.$s.".sign");
|
||||
readfile(_FCORE."../game/cache/signatures/".$id.".".$f.$s.".sign");
|
||||
imagepng($_img, ONYX."cache/signatures/".$id.".".$f.$s.".sign");
|
||||
readfile(ONYX."cache/signatures/".$id.".".$f.$s.".sign");
|
||||
}
|
||||
}
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue