2008-11-17 11:00:00 +00:00
< ? php
/**
* Class Rapport
*
* Génération et envoie de rapport de mission de flotte
*
*/
class Rapport {
2008-11-16 11:00:00 +00:00
var $table = 'mail' ;
2008-11-17 11:00:00 +00:00
var $type = 0 ;
var $var = array ();
var $utilA = 0 ;
var $utilB = 0 ;
var $timestamp = 0 ;
2008-11-04 11:00:00 +00:00
var $basededonnes ;
2008-11-17 11:00:00 +00:00
/**
* Constructor
* @ access protected
*/
function Rapport ( $type , $utilA , $utilB , $time ){
2008-11-16 11:00:00 +00:00
global $table_mail ;
$this -> table = $table_mail ;
2008-11-17 11:00:00 +00:00
$this -> type = $type ;
$this -> utilA = $utilA ;
$this -> utilB = $utilB ;
$this -> timestamp = $time ;
2008-11-04 11:00:00 +00:00
$this -> basededonnes = new bdd ();
2008-11-17 11:00:00 +00:00
}
function addInfo ( $info , $id ){
$this -> var [ $id ] = $info ;
}
function send (){
if ( $this -> type == '1' ) $this -> sendCombat ();
elseif ( $this -> type == '2' ) $this -> sendTransport ();
elseif ( $this -> type == '3' ) $this -> sendColonisation ();
elseif ( $this -> type == '4' ) $this -> sendRecyclage ();
elseif ( $this -> type == '5' ) $this -> sendEspionnage ();
elseif ( $this -> type == '6' ) $this -> sendAlliance ();
2008-11-18 11:00:00 +00:00
elseif ( $this -> type == '7' ) $this -> sendAlliance2 ();
2008-11-17 11:00:00 +00:00
}
function sendEspionnage (){
2008-11-04 11:00:00 +00:00
global $config ;
include_once ( _FCORE . " hb_game/function.php " );
2008-11-17 11:00:00 +00:00
$titreA = 'Rapport d\'espionnage de ' . $this -> var [ 0 ][ 'nom_planete' ] . ' [' . $this -> var [ 0 ][ 'galaxie' ] . ':' . $this -> var [ 0 ][ 'ss' ] . ':' . $this -> var [ 0 ][ 'position' ] . ']' ;
$rapportA = '<b>Espionnage de ' . trouvNom ( $this -> utilB ) . ' sur ' . $this -> var [ 0 ][ 'nom_planete' ] . '[' . $this -> var [ 0 ][ 'galaxie' ] . ':' . $this -> var [ 0 ][ 'ss' ] . ':' . $this -> var [ 0 ][ 'position' ] . ']</b><br /><br />' ;
$race = trouvInfo ( $this -> utilB , 'race' );
$auth_level = 0 ;
2008-11-04 11:00:00 +00:00
include ( _FCORE . " hb_game/noms.php " );
include ( _FCORE . " hb_game/vars.php " );
2008-11-17 11:00:00 +00:00
if ( isset ( $this -> var [ 1 ]) && $this -> var [ 1 ] == false ) $rapportA .= '<i>Nos sondes n\'ont pas pu récolter d\'information sur cette planète.</i>' ;
else {
$rapportA .= '<table style="margin: auto;"><tr><th colspan="2">Ressources sur la planète :</th></tr><tr><td>Métal :</td><td>' . $this -> var [ 0 ][ 'metal' ] . '</td></tr><tr><td>Cristal :</td><td>' . $this -> var [ 0 ][ 'cristal' ] . '</td></tr><tr><td>Hydrogène :</td><td>' . $this -> var [ 0 ][ 'hydrogene' ] . '</td></tr></table><br />' ;
if ( isset ( $this -> var [ 1 ]) && $this -> var [ 1 ] == true ) {
$rapportA .= '<table style="margin: auto;"><tr><th>Nombre</th><th>Vaisseaux</th></tr>' ;
$nbvais = count ( $nomvaisn );
for ( $i = 1 ; $i < $nbvais ; $i ++ ) {
if ( $this -> var [ 0 ][ 'vaisseau_' . $i ] >= 1 ) $rapportA .= '<tr><td>' . $this -> var [ 0 ][ 'vaisseau_' . $i ] . '</td><td>' . $nomvaisn [ $i - 1 ] . '</td></tr>' ;
}
$rapportA .= '</table><br />' ;
}
if ( isset ( $this -> var [ 2 ]) && $this -> var [ 2 ] == true ) {
$rapportA .= '<table style="margin: auto;"><tr><th>Nombre</th><th>Défenses</th></tr>' ;
$nbdef = count ( $nomterrn ) - 7 ;
for ( $i = 1 ; $i < $nbdef ; $i ++ ) {
if ( $this -> var [ 0 ][ 'def_' . $i ] >= 1 ) $rapportA .= '<tr><td>' . $this -> var [ 0 ][ 'def_' . $i ] . '</td><td>' . $nomterrn [ $i + 7 ] . '</td></tr>' ;
}
$rapportA .= '</table><br />' ;
}
if ( isset ( $this -> var [ 3 ]) && $this -> var [ 3 ] == true ) {
$rapportA .= '<table style="margin: auto;"><tr><th>Niveau</th><th>Batiment</th></tr>' ;
$nbbat = count ( $batiment );
for ( $i = 1 ; $i < $nbbat ; $i ++ ) {
if ( $this -> var [ 0 ][ $batimentVAR [ $i - 1 ]] >= 1 ) $rapportA .= '<tr><td>' . $this -> var [ 0 ][ $batimentVAR [ $i - 1 ]] . '</td><td>' . $batiment [ $i - 1 ] . '</td></tr>' ;
}
$rapportA .= '</table><br />' ;
}
if ( isset ( $this -> var [ 4 ]) && is_array ( $this -> var [ 4 ])) {
$rapportA .= '<table style="margin: auto;"><tr><th>Niveau</th><th>Technologie</th></tr>' ;
$nbtec = count ( $technolo );
for ( $i = 1 ; $i < $nbtec ; $i ++ ) {
if ( $this -> var [ 4 ][ $technoloVAR [ $i - 1 ]] >= 1 ) $rapportA .= '<tr><td>' . $this -> var [ 4 ][ $technoloVAR [ $i - 1 ]] . '</td><td>' . $technolo [ $i - 1 ] . '</td></tr>' ;
}
$rapportA .= '</table><br />' ;
}
if ( isset ( $this -> var [ 5 ]) && is_array ( $this -> var [ 5 ])) {
//ISOLEMENT
}
}
$titreB = 'Rapport de contre-espionnage' ;
2008-11-16 11:00:00 +00:00
$rapportB = 'Nous venons d\'apprendre que notre planète : ' . $this -> var [ 0 ][ 'nom_planete' ] . '[' . $this -> var [ 0 ][ 'galaxie' ] . ':' . $this -> var [ 0 ][ 'ss' ] . ':' . $this -> var [ 0 ][ 'position' ] . '] a été la cible d\'un espionnage de la part de ' . trouvNom ( $this -> utilA );
2008-11-17 11:00:00 +00:00
$temps = $this -> timestamp ;
2008-11-16 11:00:00 +00:00
$utilA = trouvNom ( $this -> utilA );
$utilB = trouvNom ( $this -> utilB );
2008-11-17 11:00:00 +00:00
2008-11-04 11:00:00 +00:00
$db = new bdd ();
$db -> connexion ();
$db -> escape ( $titreA );
$db -> escape ( $titreB );
$db -> escape ( $rapportA );
$db -> escape ( $rapportB );
2008-11-16 11:00:00 +00:00
$db -> escape ( $utilA );
$db -> escape ( $utilB );
$db -> query ( " INSERT INTO " . $this -> table . " VALUES('', '1', ' $utilA ', '', ' $titreA ', ' $rapportA ', ' $temps ') " );
$db -> query ( " INSERT INTO " . $this -> table . " VALUES('', '1', ' $utilB ', '', ' $titreB ', ' $rapportB ', ' $temps ') " );
2008-11-04 11:00:00 +00:00
$db -> deconnexion ();
2008-11-17 11:00:00 +00:00
}
2008-12-01 11:00:00 +00:00
function sendTransport (){
2008-11-04 11:00:00 +00:00
global $config ;
include_once ( _FCORE . " hb_game/function.php " );
2008-12-01 11:00:00 +00:00
$titre = 'Transport vers ' . $this -> var [ 0 ][ 'nom_planete' ] . ' [' . $this -> var [ 0 ][ 'galaxie' ] . ':' . $this -> var [ 0 ][ 'ss' ] . ':' . $this -> var [ 0 ][ 'position' ] . ']' ;
$race = trouvInfo ( $this -> utilA , 'race' );
2008-11-04 11:00:00 +00:00
include ( _FCORE . " hb_game/noms.php " );
2008-12-01 11:00:00 +00:00
$rapportA = 'Vos vaisseaux ont déposé ' . $this -> var [ 1 ][ 0 ] . ' de ' . $ressourc [ 0 ] . ', ' . $this -> var [ 1 ][ 1 ] . ' de ' . $ressourc [ 1 ] . ' et ' . $this -> var [ 1 ][ 2 ] . ' d\'' . $ressourc [ 2 ] . ' sur ' . $this -> var [ 0 ][ 'nom_planete' ] . '[' . $this -> var [ 0 ][ 'galaxie' ] . ':' . $this -> var [ 0 ][ 'ss' ] . ':' . $this -> var [ 0 ][ 'position' ] . ']</b><br /><br />' ;
$race = trouvInfo ( $this -> utilB , 'race' );
2008-11-04 11:00:00 +00:00
include ( _FCORE . " hb_game/noms.php " );
2008-12-01 11:00:00 +00:00
$rapportB = 'Les vaisseaux de ' . trouvNom ( $this -> utilA ) . ' ont déposé ' . $this -> var [ 1 ][ 0 ] . ' de ' . $ressourc [ 0 ] . ', ' . $this -> var [ 1 ][ 1 ] . ' de ' . $ressourc [ 1 ] . ' et ' . $this -> var [ 1 ][ 2 ] . ' d\'' . $ressourc [ 2 ] . ' sur ' . $this -> var [ 0 ][ 'nom_planete' ] . '[' . $this -> var [ 0 ][ 'galaxie' ] . ':' . $this -> var [ 0 ][ 'ss' ] . ':' . $this -> var [ 0 ][ 'position' ] . ']</b><br /><br />' ;
$temps = $this -> timestamp ;
2008-11-16 11:00:00 +00:00
$utilA = trouvNom ( $this -> utilA );
$utilB = trouvNom ( $this -> utilB );
2008-12-01 11:00:00 +00:00
2008-11-04 11:00:00 +00:00
$db = new bdd ();
$db -> connexion ();
$db -> escape ( $titre );
$db -> escape ( $rapportA );
$db -> escape ( $rapportB );
2008-11-16 11:00:00 +00:00
$db -> escape ( $utilA );
$db -> escape ( $utilB );
$db -> query ( " INSERT INTO " . $this -> table . " VALUES('', '1', ' $utilA ', '', ' $titre ', ' $rapportA ', ' $temps ') " );
if ( $utilA != $utilB ) $db -> query ( " INSERT INTO " . $this -> table . " VALUES('', '1', ' $utilB ', '', ' $titre ', ' $rapportB ', ' $temps ') " );
2008-11-04 11:00:00 +00:00
$db -> deconnexion ();
2008-12-01 11:00:00 +00:00
}
function sendColonisation (){
2008-11-04 11:00:00 +00:00
include_once ( _FCORE . " hb_game/function.php " );
2008-12-01 11:00:00 +00:00
$titre = 'Colonisation de [' . $this -> var [ 0 ][ 0 ] . ':' . $this -> var [ 0 ][ 1 ] . ':' . $this -> var [ 0 ][ 2 ] . ']' ;
if ( $this -> var [ 1 ]) $rapport = 'Votre vaisseau a atteint la planète [' . $this -> var [ 0 ][ 0 ] . ':' . $this -> var [ 0 ][ 1 ] . ':' . $this -> var [ 0 ][ 2 ] . '] et commence la colonisation.' ;
else $rapport = 'Nous n\'avons pas pu coloniser la planète [' . $this -> var [ 0 ][ 0 ] . ':' . $this -> var [ 0 ][ 1 ] . ':' . $this -> var [ 0 ][ 2 ] . '] car lorsque nous sommes arrivé sur place, elle était déjà colonisée.' ;
$temps = $this -> timestamp ;
2008-11-16 11:00:00 +00:00
$utilA = trouvNom ( $this -> utilA );
2008-12-01 11:00:00 +00:00
2008-11-04 11:00:00 +00:00
$db = new bdd ();
$db -> connexion ();
$db -> escape ( $titre );
$db -> escape ( $rapport );
2008-11-16 11:00:00 +00:00
$db -> escape ( $utilA );
$db -> query ( " INSERT INTO " . $this -> table . " VALUES('', '1', ' $utilA ', '', ' $titre ', ' $rapport ', ' $temps ') " );
2008-11-04 11:00:00 +00:00
$db -> deconnexion ();
2008-12-01 11:00:00 +00:00
}
function sendRecyclage (){
2008-11-04 11:00:00 +00:00
include_once ( _FCORE . " hb_game/function.php " );
2008-12-01 11:00:00 +00:00
$titre = 'Recyclage de ' . $this -> var [ 0 ][ 'nom_planete' ] . ' [' . $this -> var [ 0 ][ 'galaxie' ] . ':' . $this -> var [ 0 ][ 'ss' ] . ':' . $this -> var [ 0 ][ 'position' ] . ']' ;
$rapport = 'Vos vaisseaux récoltent ' . $this -> var [ 1 ][ 0 ] . ' de ' . $ressourc [ 0 ] . ' et ' . $this -> var [ 1 ][ 1 ] . ' de ' . $ressourc [ 1 ] . ' sur ' . $this -> var [ 0 ][ 'nom_planete' ] . '[' . $this -> var [ 0 ][ 'galaxie' ] . ':' . $this -> var [ 0 ][ 'ss' ] . ':' . $this -> var [ 0 ][ 'position' ] . ']</b><br /><br />' ;
$temps = $this -> timestamp ;
2008-11-16 11:00:00 +00:00
$utilA = trouvNom ( $this -> utilA );
2008-12-01 11:00:00 +00:00
2008-11-04 11:00:00 +00:00
$db = new bdd ();
$db -> connexion ();
$db -> escape ( $titre );
$db -> escape ( $rapport );
2008-11-16 11:00:00 +00:00
$db -> escape ( $utilA );
$db -> query ( " INSERT INTO " . $this -> table . " VALUES('', '1', ' $utilA ', '', ' $titre ', ' $rapport ', ' $temps ') " );
2008-11-04 11:00:00 +00:00
$db -> deconnexion ();
2008-12-01 11:00:00 +00:00
}
2008-11-30 11:00:00 +00:00
function sendCombat (){
2008-11-04 11:00:00 +00:00
include ( _FCORE . " hb_game/vars.php " );
include_once ( _FCORE . " hb_game/function.php " );
2008-11-30 11:00:00 +00:00
require_once ( SMARTY_DIR . " Smarty.class.php " );
$rapportA = new Smarty ();
$rapportB = new Smarty ();
$rapportA -> template_dir = _FCORE . 'templates/templates/' ;
$rapportA -> compile_dir = _FCORE . 'templates/templates_c/' ;
$rapportA -> config_dir = _FCORE . 'templates/configs/' ;
$rapportA -> cache_dir = _FCORE . 'templates/cache/' ;
$rapportB -> template_dir = _FCORE . 'templates/templates/' ;
$rapportB -> compile_dir = _FCORE . 'templates/templates_c/' ;
$rapportB -> config_dir = _FCORE . 'templates/configs/' ;
$rapportB -> cache_dir = _FCORE . 'templates/cache/' ;
$this -> var [ 4 ][ 'pseudo' ] = trouvNom ( $this -> var [ 4 ][ 'id_user' ]);
$this -> var [ 5 ][ 'pseudo' ] = trouvNom ( $this -> var [ 5 ][ 'id_user' ]);
$rapportA -> assign ( 'tour' , $this -> var [ 3 ]);
$rapportA -> assign ( 'EN' , $this -> var [ 4 ]);
$rapportA -> assign ( 'flotte' , $this -> var [ 5 ]);
$rapportA -> assign ( 'vaisseaux1' , $this -> var [ 0 ]);
$rapportA -> assign ( 'vaisseaux2' , $this -> var [ 1 ]);
$rapportA -> assign ( 'defenses1' , $this -> var [ 2 ]);
$rapportA -> assign ( 'vaisseaux3' , $this -> var [ 7 ]);
$rapportA -> assign ( 'vaisseaux4' , $this -> var [ 8 ]);
$rapportA -> assign ( 'defenses2' , $this -> var [ 9 ]);
$rapportA -> assign ( 'termine' , $this -> var [ 6 ][ 0 ]);
$rapportA -> assign ( 'attaquantG' , $this -> var [ 6 ][ 1 ]);
$rapportA -> assign ( 'pillage' , $this -> var [ 11 ]);
$rapportA -> assign ( 'vaisBC' , $nomvais_bc );
$rapportA -> assign ( 'vaisPV' , $nomvais_pv );
2008-12-01 11:00:00 +00:00
$rapportA -> assign ( 'defBC' , $defense_bc );
$rapportA -> assign ( 'defPV' , $defense_pv );
2008-11-30 11:00:00 +00:00
$rapportA -> assign ( 'nextTour' , $this -> var [ 10 ]);
$race = trouvInfo ( $this -> utilA , 'race' );
2008-11-04 11:00:00 +00:00
include ( _FCORE . " hb_game/noms.php " );
2008-11-30 11:00:00 +00:00
$rapportA -> assign ( 'ressources' , $ressourc );
$rapportA -> assign ( 'nomvaisAT' , $nomvaisa );
$race = trouvInfo ( $this -> var [ 4 ][ 'id_user' ], 'race' );
2008-11-04 11:00:00 +00:00
include ( _FCORE . " hb_game/noms.php " );
2008-11-30 11:00:00 +00:00
$rapportA -> assign ( 'nomvaisEN' , $nomvaisa );
array_splice ( $nomterra , 0 , 8 );
$rapportA -> assign ( 'nomdefEN' , $nomterra );
$rapportA = $rapportA -> fetch ( 'game/ATrapport_combat.tpl' );
$rapportB -> assign ( 'tour' , $this -> var [ 3 ]);
$rapportB -> assign ( 'EN' , $this -> var [ 4 ]);
$rapportB -> assign ( 'flotte' , $this -> var [ 5 ]);
$rapportB -> assign ( 'vaisseaux1' , $this -> var [ 0 ]);
$rapportB -> assign ( 'vaisseaux2' , $this -> var [ 1 ]);
$rapportB -> assign ( 'defenses1' , $this -> var [ 2 ]);
$rapportB -> assign ( 'vaisseaux3' , $this -> var [ 7 ]);
$rapportB -> assign ( 'vaisseaux4' , $this -> var [ 8 ]);
$rapportB -> assign ( 'defenses2' , $this -> var [ 9 ]);
$rapportB -> assign ( 'termine' , $this -> var [ 6 ][ 0 ]);
$rapportB -> assign ( 'attaquantG' , $this -> var [ 6 ][ 1 ]);
2008-11-16 11:00:00 +00:00
$rapportB -> assign ( 'matchnul' , $this -> var [ 6 ][ 2 ]);
2008-11-30 11:00:00 +00:00
$rapportB -> assign ( 'pillage' , $this -> var [ 11 ]);
$rapportB -> assign ( 'vaisBC' , $nomvais_bc );
$rapportB -> assign ( 'vaisPV' , $nomvais_pv );
2008-12-01 11:00:00 +00:00
$rapportB -> assign ( 'defBC' , $defense_bc );
$rapportB -> assign ( 'defPV' , $defense_pv );
2008-11-30 11:00:00 +00:00
$rapportB -> assign ( 'nextTour' , $this -> var [ 10 ]);
$race = trouvInfo ( $this -> utilA , 'race' );
2008-11-04 11:00:00 +00:00
include ( _FCORE . " hb_game/noms.php " );
2008-11-30 11:00:00 +00:00
$rapportB -> assign ( 'ressources' , $ressourc );
$rapportB -> assign ( 'nomvaisAT' , $nomvaisa );
$race = trouvInfo ( $this -> var [ 4 ][ 'id_user' ], 'race' );
2008-11-04 11:00:00 +00:00
include ( _FCORE . " hb_game/noms.php " );
2008-11-30 11:00:00 +00:00
$rapportB -> assign ( 'nomvaisEN' , $nomvaisa );
array_splice ( $nomterra , 0 , 8 );
$rapportB -> assign ( 'nomdefEN' , $nomterra );
$rapportB = $rapportB -> fetch ( 'game/ENrapport_combat.tpl' );
2008-11-04 11:00:00 +00:00
$titreA = 'Combat contre ' . $this -> var [ 4 ][ 'pseudo' ];
$titreB = 'Combat contre ' . $this -> var [ 5 ][ 'pseudo' ];
2008-11-30 11:00:00 +00:00
$temps = $this -> timestamp ;
2008-11-16 11:00:00 +00:00
$utilA = trouvNom ( $this -> utilA );
$utilB = trouvNom ( $this -> utilB );
2008-11-30 11:00:00 +00:00
2008-11-04 11:00:00 +00:00
$db = new bdd ();
$db -> connexion ();
$db -> escape ( $titreA );
$db -> escape ( $titreB );
$db -> escape ( $rapportA );
$db -> escape ( $rapportB );
2008-11-16 11:00:00 +00:00
$db -> escape ( $utilA );
$db -> escape ( $utilB );
$db -> query ( " INSERT INTO " . $this -> table . " VALUES('', '1', ' $utilA ', '', ' $titreA ', ' $rapportA ', ' $temps ') " );
$db -> query ( " INSERT INTO " . $this -> table . " VALUES('', '1', ' $utilB ', '', ' $titreB ', ' $rapportB ', ' $temps ') " );
2008-11-04 11:00:00 +00:00
$db -> deconnexion ();
2008-11-30 11:00:00 +00:00
}
2008-12-01 11:00:00 +00:00
function show (){
2008-11-04 11:00:00 +00:00
include ( _FCORE . " hb_game/vars.php " );
include_once ( _FCORE . " hb_game/function.php " );
2008-12-01 11:00:00 +00:00
require_once ( SMARTY_DIR . " Smarty.class.php " );
$rapportA = new Smarty ();
$rapportA -> template_dir = _FCORE . 'templates/templates/' ;
$rapportA -> compile_dir = _FCORE . 'templates/templates_c/' ;
$rapportA -> config_dir = _FCORE . 'templates/configs/' ;
$rapportA -> cache_dir = _FCORE . 'templates/cache/' ;
$rapportA -> assign ( 'tour' , $this -> var [ 3 ]);
$rapportA -> assign ( 'EN' , $this -> var [ 4 ]);
$rapportA -> assign ( 'flotte' , $this -> var [ 5 ]);
$rapportA -> assign ( 'vaisseaux1' , $this -> var [ 0 ]);
$rapportA -> assign ( 'vaisseaux2' , $this -> var [ 1 ]);
$rapportA -> assign ( 'defenses1' , $this -> var [ 2 ]);
$rapportA -> assign ( 'vaisseaux3' , $this -> var [ 7 ]);
$rapportA -> assign ( 'vaisseaux4' , $this -> var [ 8 ]);
$rapportA -> assign ( 'defenses2' , $this -> var [ 9 ]);
$rapportA -> assign ( 'termine' , $this -> var [ 6 ][ 0 ]);
$rapportA -> assign ( 'attaquantG' , $this -> var [ 6 ][ 1 ]);
$rapportA -> assign ( 'pillage' , $this -> var [ 11 ]);
$rapportA -> assign ( 'debris' , $this -> var [ 12 ]);
2008-11-04 11:00:00 +00:00
$rapportA -> assign ( 'infoPLUS' , $this -> var [ 14 ]);
2008-11-16 11:00:00 +00:00
//$rapportA->assign('infoPLUS2', $this->var[15]);
2008-12-01 11:00:00 +00:00
$rapportA -> assign ( 'page' , 'simulation' );
$rapportA -> assign ( 'enligne' , $this -> var [ 13 ][ 0 ]);
$rapportA -> assign ( 'infos' , $this -> var [ 13 ][ 1 ]);
$rapportA -> assign ( 'nbinfos' , $this -> var [ 13 ][ 2 ]);
$rapportA -> assign ( 'count' , $this -> var [ 13 ][ 3 ]);
$rapportA -> assign ( 'version' , $this -> var [ 13 ][ 4 ]);
$rapportA -> assign ( 'tpsdejeu' , $this -> var [ 13 ][ 5 ]);
$rapportA -> assign ( 'vaisBC' , $nomvais_bc );
$rapportA -> assign ( 'vaisPV' , $nomvais_pv );
$rapportA -> assign ( 'defBC' , $defense_bc );
$rapportA -> assign ( 'defPV' , $defense_pv );
$rapportA -> assign ( 'nextTour' , $this -> var [ 10 ]);
$race = trouvInfo ( $this -> utilA , 'race' );
2008-11-04 11:00:00 +00:00
include ( _FCORE . " hb_game/noms.php " );
2008-12-01 11:00:00 +00:00
$rapportA -> assign ( 'ressources' , $ressourc );
$rapportA -> assign ( 'nomvaisAT' , $nomvaisa );
$rapportA -> assign ( 'nomvaisEN' , $nomvaisa );
array_splice ( $nomterra , 0 , 8 );
$rapportA -> assign ( 'nomdefEN' , $nomterra );
$rapportA -> assign ( 'race' , $race );
return $rapportA -> fetch ( 'game/SIMrapport_combat.tpl' );
return $rapportA ;
}
2008-11-17 11:00:00 +00:00
function sendAlliance (){
2008-11-04 11:00:00 +00:00
include_once ( _FCORE . " hb_game/function.php " );
2008-11-17 11:00:00 +00:00
$titreA = 'Déclaration officielle de votre alliance !' ;
2008-11-30 11:00:00 +00:00
$rapportA = 'Félicitations, votre alliance a recueilli suffisament de signature, sa déclaration est maintenant officielle !<br /><br />Vous pouvez dès maintenant administrer votre alliance en vous rendant sur la page Alliance.' ;
2008-11-17 11:00:00 +00:00
$temps = $this -> timestamp ;
2008-11-04 11:00:00 +00:00
$db = new bdd ();
$db -> connexion ();
$db -> escape ( $titreA );
$db -> escape ( $rapportA );
2008-11-16 11:00:00 +00:00
$utilA = trouvNom ( $this -> utilA );
$db -> escape ( $utilA );
$db -> query ( " INSERT INTO " . $this -> table . " VALUES('', '1', ' $utilA ', '', ' $titreA ', ' $rapportA ', ' $temps ') " );
2008-11-04 11:00:00 +00:00
$db -> deconnexion ();
2008-11-17 11:00:00 +00:00
}
2008-11-18 11:00:00 +00:00
function sendAlliance2 (){
2008-11-04 11:00:00 +00:00
include_once ( _FCORE . " hb_game/function.php " );
2008-11-18 11:00:00 +00:00
$titreA = 'Fondation de votre alliance !' ;
2008-11-22 11:00:00 +00:00
$rapportA = 'Pour terminer la création de votre alliance, trouvez 4 joueurs de cette galaxie sans alliance pour leur faire signer votre traité de fondation d\'alliance.<br /><br />Lien de signature : <a href="?p=alliances&q=signer&i=' . $this -> var [ 0 ] . '">http://' . $_SERVER [ 'HTTP_HOST' ] . '/?p=alliances&q=signer&i=' . $this -> var [ 0 ] . '</a>' ;
2008-11-18 11:00:00 +00:00
$temps = $this -> timestamp ;
2008-11-04 11:00:00 +00:00
$db = new bdd ();
$db -> connexion ();
$db -> escape ( $titreA );
$db -> escape ( $rapportA );
2008-11-16 11:00:00 +00:00
$utilA = trouvNom ( $this -> utilA );
$db -> escape ( $utilA );
$db -> query ( " INSERT INTO " . $this -> table . " VALUES('', '1', ' $utilA ', '', ' $titreA ', ' $rapportA ', ' $temps ') " );
2008-11-04 11:00:00 +00:00
$db -> deconnexion ();
2008-11-18 11:00:00 +00:00
}
2008-11-17 11:00:00 +00:00
}
?>