Kommunauty
Connexion
Inscription

Problème de warning


jujude67 Messages : 28

Bonjour ,

Je suis jujude67 (le retour )

J'ai un problème au niveau de mon jeu :

Dans le simulateur de combat , quand ont clique sur "simuler le combat" j'ai cela qui apparaît :

Warning: Invalid argument supplied for foreach() in /home/tgbkknfh/public_html/includes/classes/missions/calculateAttack.php on line 31



Warning: Invalid argument supplied for foreach() in /home/tgbkknfh/public_html/includes/classes/missions/calculateAttack.php on line 49



Warning: Invalid argument supplied for foreach() in /home/tgbkknfh/public_html/includes/classes/missions/calculateAttack.php on line 82



Warning: Invalid argument supplied for foreach() in /home/tgbkknfh/public_html/includes/classes/missions/calculateAttack.php on line 109



Warning: Invalid argument supplied for foreach() in /home/tgbkknfh/public_html/includes/classes/missions/calculateAttack.php on line 267



Warning: Invalid argument supplied for foreach() in /home/tgbkknfh/public_html/includes/classes/missions/calculateAttack.php on line 279



Warning: Invalid argument supplied for foreach() in /home/tgbkknfh/public_html/includes/classes/missions/GenerateReport.php on line 45



Warning: Invalid argument supplied for foreach() in /home/tgbkknfh/public_html/includes/classes/missions/GenerateReport.php on line 130

f3526e41cd7136524c3cef66b0b84ea6

Et voici le fichier calculateAttack.php :

<?php

/**
 _  \_/ |\ | /¯¯\ \  / /\    |¯¯) |_¯ \  / /¯¯\ |  |   |´¯|¯` | /¯¯\ |\ |5
 ¯  /¯\ | \| \__/  \/ /--\   |¯¯\ |__  \/  \__/ |__ \_/   |   | \__/ | \|Core.
 * @author: Copyright (C) 2011 by Brayan Narvaez (Prinick) developer of xNova Revolution
 * @author web: http://www.bnarvaez.com
 * @link: http://www.xnovarevforum.com.ar

 * @package 2Moons
 * @author Slaver <slaver7@gmail.com>
 * @copyright 2009 Lucky <douglas@crockford.com> (XGProyecto)
 * @copyright 2011 Slaver <slaver7@gmail.com> (Fork/2Moons)
 * @license http://www.gnu.org/licenses/gpl.html GNU GPLv3 License
 * @version 1.3 (2011-01-21)
 * @link http://code.google.com/p/2moons/

 * Please do not remove the credits
*/


function calculateAttack(&$attackers, &$defenders, $FleetTF, $DefTF)
{
global $pricelist, $CombatCaps, $resource;

$TRES = array('attacker' => 0, 'defender' => 0);
$ARES = $DRES = array('metal' => 0, 'crystal' => 0);
$ROUND = array();
$RF = array();

foreach ($attackers as $fleetID => $attacker)
{
foreach ($attacker['detail'] as $element => $amount)
{
$ARES['metal'] += $pricelist[$element]['metal'] * $amount;
$ARES['crystal'] += $pricelist[$element]['crystal'] * $amount;
}
}

foreach($CombatCaps as $e => $arr) {
foreach($arr['sd'] as $t => $sd) {
if($sd == 0) continue;
$RF[$t][$e] = $sd;
}
}

$TRES['attacker'] = $ARES['metal'] + $ARES['crystal'] ;

foreach ($defenders as $fleetID => $defender)
{
foreach ($defender['def'] as $element => $amount)
{
if ($element < 300) {
$DRES['metal'] += $pricelist[$element]['metal'] * $amount;
$DRES['crystal'] += $pricelist[$element]['crystal'] * $amount ;

$TRES['defender'] += $pricelist[$element]['metal'] * $amount;
$TRES['defender'] += $pricelist[$element]['crystal'] * $amount;
} else {
if (!isset($STARTDEF[$element]))
$STARTDEF[$element] = 0;

$STARTDEF[$element] += $amount;

$TRES['defender'] += $pricelist[$element]['metal'] * $amount;
$TRES['defender'] += $pricelist[$element]['crystal'] * $amount;
}
}
}

for ($ROUNDC = 0; $ROUNDC <= MAX_ATTACK_ROUNDS; $ROUNDC++)
{
$attackDamage  = array('total' => 0);
$attackShield  = array('total' => 0);
$attackAmount  = array('total' => 0);
$defenseDamage = array('total' => 0);
$defenseShield = array('total' => 0);
$defenseAmount = array('total' => 0);
$attArray = array();
$defArray = array();

foreach ($attackers as $fleetID => $attacker) {
$attackDamage[$fleetID] = 0;
$attackShield[$fleetID] = 0;
$attackAmount[$fleetID] = 0;

$attTech = (1 + (0.1 * $attacker['user']['military_tech']) + $attacker['user']['factor']['attack']);
$defTech = (1 + (0.1 * $attacker['user']['defence_tech']) + $attacker['user']['factor']['defensive']);
$shieldTech = (1 + (0.1 * $attacker['user']['shield_tech']) + $attacker['user']['factor']['shield']);
$attackers[$fleetID]['techs'] = array($attTech, $defTech, $shieldTech);

foreach ($attacker['detail'] as $element => $amount) {
$thisAtt = $amount * ($CombatCaps[$element]['attack']) * $attTech * (rand(80, 120) / 100); //attaque
$thisDef = $amount * ($CombatCaps[$element]['shield']) * $defTech ; //bouclier
$thisShield = $amount * ($pricelist[$element]['metal'] + $pricelist[$element]['crystal'] + $pricelist[$element]['norio']) / 10 * $shieldTech; //coque

$attArray[$fleetID][$element] = array('def' => $thisDef, 'shield' => $thisShield, 'att' => $thisAtt);

$attackDamage[$fleetID] += $thisAtt;
$attackDamage['total'] += $thisAtt;
$attackShield[$fleetID] += $thisDef;
$attackShield['total'] += $thisDef;
$attackAmount[$fleetID] += $amount;
$attackAmount['total'] += $amount;
}
$temp1 = $attacker['detail'];
}

foreach ($defenders as $fleetID => $defender) {
$defenseDamage[$fleetID] = 0;
$defenseShield[$fleetID] = 0;
$defenseAmount[$fleetID] = 0;

$attTech = (1 + (0.1 * $defender['user']['military_tech']) + $defender['user']['factor']['attack']);
$defTech = (1 + (0.1 * $defender['user']['defence_tech']) + $defender['user']['factor']['defensive']);
$shieldTech = (1 + (0.1 * $defender['user']['shield_tech']) + $defender['user']['factor']['shield']);
$defenders[$fleetID]['techs'] = array($attTech, $defTech, $shieldTech);

foreach ($defender['def'] as $element => $amount) {
$thisAtt = $amount * ($CombatCaps[$element]['attack']) * $attTech * (rand(80, 120) / 100); //attaque
$thisDef = $amount * ($CombatCaps[$element]['shield']) * $defTech ; //bouclier
$thisShield = $amount * ($pricelist[$element]['metal'] + $pricelist[$element]['crystal'] + $pricelist[$element]['norio']) / 10 * $shieldTech; //coque

if ($element == 407 || $element == 408 || $element == 409) $thisAtt = 0;

$defArray[$fleetID][$element] = array('def' => $thisDef, 'shield' => $thisShield, 'att' => $thisAtt);

$defenseDamage[$fleetID] += $thisAtt;
$defenseDamage['total'] += $thisAtt;
$defenseShield[$fleetID] += $thisDef;
$defenseShield['total'] += $thisDef;
$defenseAmount[$fleetID] += $amount;
$defenseAmount['total'] += $amount;
}
$temp2 = $defender['def'];
}

$ROUND[$ROUNDC] = array('attackers' => $attackers, 'defenders' => $defenders, 'attackA' => $attackAmount, 'defenseA' => $defenseAmount, 'infoA' => $attArray, 'infoD' => $defArray);

if ($ROUNDC >= MAX_ATTACK_ROUNDS || $defenseAmount['total'] <= 0 || $attackAmount['total'] <= 0) {
break;
}

// Calculate hit percentages (ACS only but ok)
$attackPct = array();
foreach ($attackAmount as $fleetID => $amount) {
if (!is_numeric($fleetID)) continue;
$attackPct[$fleetID] = $amount / $attackAmount['total'];
}

$defensePct = array();
foreach ($defenseAmount as $fleetID => $amount) {
if (!is_numeric($fleetID)) continue;
$defensePct[$fleetID] = $amount / $defenseAmount['total'];
}

// CALCUL DES PERTES !!!
$attacker_n = array();
$attacker_shield = 0;
$defenderAttack = 0;
foreach ($attackers as $fleetID => $attacker) {
$attacker_n[$fleetID] = array();

foreach($attacker['detail'] as $element => $amount) {
if ($amount <= 0) {
$attacker_n[$fleetID][$element] = 0;
continue;
}

$defender_moc = $amount * ($defenseDamage['total'] * $attackPct[$fleetID]) / $attackAmount[$fleetID];

if(isset($RF[$element])) {
foreach($RF[$element] as $shooter => $shots) {
foreach($defArray as $fID => $rfdef) {
if($rfdef[$shooter]['att'] <= 0 || $attackAmount[$fleetID] <= 0) continue;

$defender_moc += $rfdef[$shooter]['att'] * $shots / ($amount / $attackAmount[$fleetID] * $attackPct[$fleetID]);
$defenseAmount['total'] += $defenders[$fID]['def'][$shooter] * $shots;
}
}
}

$defenderAttack += $defender_moc;

if (($attArray[$fleetID][$element]['def'] / $amount) >= $defender_moc) {
$attacker_n[$fleetID][$element] = round($amount);
$attacker_shield += $defender_moc;
continue;
}

$max_removePoints = floor($amount * $defenseAmount['total'] / $attackAmount[$fleetID] * $attackPct[$fleetID]);

$attacker_shield += min($attArray[$fleetID][$element]['def'], $defender_moc);
$defender_moc -= min($attArray[$fleetID][$element]['def'], $defender_moc);

$ile_removePoints = max(min($max_removePoints, $amount * min($defender_moc / $attArray[$fleetID][$element]['shield'] * (rand(0, 200) / 100), 1)), 0);

$attacker_n[$fleetID][$element] = max(ceil($amount - $ile_removePoints), 0);
}
}

$defender_n = array();
$defender_shield = 0;
$attackerAttack = 0;
foreach ($defenders as $fleetID => $defender) {
$defender_n[$fleetID] = array();

foreach($defender['def'] as $element => $amount) {
if ($amount <= 0) {
$defender_n[$fleetID][$element] = 0;
continue;
}

$attacker_moc = $amount * ($attackDamage['total'] * $defensePct[$fleetID]) / $defenseAmount[$fleetID];
if (isset($RF[$element])) {
foreach($RF[$element] as $shooter => $shots) {
foreach($attArray as $fID => $rfatt) {
if ($rfatt[$shooter]['att'] <= 0 || $defenseAmount[$fleetID] <= 0 ) continue;

$attacker_moc += $rfatt[$shooter]['att'] * $shots / ($amount / $defenseAmount[$fleetID] * $defensePct[$fleetID]);
$attackAmount['total'] += $attackers[$fID]['detail'][$shooter] * $shots;
}
}
}

$attackerAttack += $attacker_moc;

if (($defArray[$fleetID][$element]['def'] / $amount) >= $attacker_moc) {
$defender_n[$fleetID][$element] = round($amount);
$defender_shield += $attacker_moc;
continue;
}

$max_removePoints = floor($amount * $attackAmount['total'] / $defenseAmount[$fleetID] * $defensePct[$fleetID]);
$defender_shield += min($defArray[$fleetID][$element]['def'], $attacker_moc);
$attacker_moc -= min($defArray[$fleetID][$element]['def'], $attacker_moc);

$ile_removePoints = max(min($max_removePoints, $amount * min($attacker_moc / $defArray[$fleetID][$element]['shield'] * (rand(0, 200) / 100), 1)), 0);

$defender_n[$fleetID][$element] = max(ceil($amount - $ile_removePoints), 0);
}
}

$ROUND[$ROUNDC]['attack'] = $attackerAttack;
$ROUND[$ROUNDC]['defense'] = $defenderAttack;
$ROUND[$ROUNDC]['attackShield'] = $attacker_shield;
$ROUND[$ROUNDC]['defShield'] = $defender_shield;
foreach ($attackers as $fleetID => $attacker) {
$attackers[$fleetID]['detail'] =  array_map('round', $attacker_n[$fleetID]);
}

foreach ($defenders as $fleetID => $defender) {
$defenders[$fleetID]['def'] = array_map('round', $defender_n[$fleetID]);
}
}

if ($attackAmount['total'] <= 0 && $defenseAmount['total'] > 0) {
$won = "r"; // defender
} elseif ($attackAmount['total'] > 0 && $defenseAmount['total'] <= 0) {
$won = "a"; // attacker
} else {
$won = "w"; // draw
#$ROUND[count($ROUND)] = array('attackers' => $attackers, 'defenders' => $defenders, 'attack' => $attackDamage, 'defense' => $defenseDamage, 'attackA' => $attackAmount, 'defenseA' => $defenseAmount);
}

// CDR
foreach ($attackers as $fleetID => $attacker) {    // flotte attaquant en CDR
foreach ($attacker['detail'] as $element => $amount) {
$TRES['attacker'] -= $pricelist[$element]['metal'] * $amount ;
$TRES['attacker'] -= $pricelist[$element]['crystal'] * $amount ;

$ARES['metal'] -= $pricelist[$element]['metal'] * $amount ;
$ARES['crystal'] -= $pricelist[$element]['crystal'] * $amount ;
}
}

$DRESDefs = array('metal' => 0, 'crystal' => 0);

foreach ($defenders as $fleetID => $defender) {
foreach ($defender['def'] as $element => $amount) {
if ($element < 300) { // flotte defenseur en CDR
$DRES['metal'] -= $pricelist[$element]['metal'] * $amount ;
$DRES['crystal'] -= $pricelist[$element]['crystal'] * $amount ;

$TRES['defender'] -= $pricelist[$element]['metal'] * $amount ;
$TRES['defender'] -= $pricelist[$element]['crystal'] * $amount ;
} else { // defs defenseur en CDR + reconstruction
$TRES['defender'] -= $pricelist[$element]['metal'] * $amount ;
$TRES['defender'] -= $pricelist[$element]['crystal'] * $amount ;

$lost = $STARTDEF[$element] - $amount;
$giveback = round($lost * (rand(56, 84) / 100));
$defenders[$fleetID]['def'][$element] += $giveback;
$DRESDefs['metal'] += $pricelist[$element]['metal'] * ($lost - $giveback) ;
$DRESDefs['crystal'] += $pricelist[$element]['crystal'] * ($lost - $giveback) ;
}
}
}

$ARES['metal'] = max($ARES['metal'], 0);
$ARES['crystal'] = max($ARES['crystal'], 0);
$DRES['metal'] = max($DRES['metal'], 0);
$DRES['crystal'] = max($DRES['crystal'], 0);
$TRES['attacker'] = max($TRES['attacker'], 0);
$TRES['defender'] = max($TRES['defender'], 0);

$totalLost = array('att' => $TRES['attacker'], 'def' => $TRES['defender']);
$debAttMet = ($ARES['metal'] * ($FleetTF / 100));
$debAttCry = ($ARES['crystal'] * ($FleetTF / 100));
$debDefMet = ($DRES['metal'] * ($FleetTF / 100)) + ($DRESDefs['metal'] * ($DefTF / 100));
$debDefCry = ($DRES['crystal'] * ($FleetTF / 100)) + ($DRESDefs['crystal'] * ($DefTF / 100));

return array('won' => $won, 'debree' => array('att' => array($debAttMet, $debAttCry), 'def' => array($debDefMet, $debDefCry)), 'rw' => $ROUND, 'lost' => $totalLost);
}
?>

Et le fichier GenerateReport.php :

<?php

/**
 _  \_/ |\ | /¯¯\ \  / /\    |¯¯) |_¯ \  / /¯¯\ |  |   |´¯|¯` | /¯¯\ |\ |5
 ¯  /¯\ | \| \__/  \/ /--\   |¯¯\ |__  \/  \__/ |__ \_/   |   | \__/ | \|Core.
 * @author: Copyright (C) 2011 by Brayan Narvaez (Prinick) developer of xNova Revolution
 * @author web: http://www.bnarvaez.com
 * @link: http://www.xnovarevforum.com.ar

 * @package 2Moons
 * @author Slaver <slaver7@gmail.com>
 * @copyright 2009 Lucky <douglas@crockford.com> (XGProyecto)
 * @copyright 2011 Slaver <slaver7@gmail.com> (Fork/2Moons)
 * @license http://www.gnu.org/licenses/gpl.html GNU GPLv3 License
 * @version 1.3 (2011-01-21)
 * @link http://code.google.com/p/2moons/

 * Please do not remove the credits
*/

function GenerateReport($RESULT, $INFO)
{
$html = '"<div style=\"width:100%;text-align:center\"><center>';


$round_no = 1;
$des = array('att' => array(), 'def' => array());

foreach($RESULT['rw'] as $round => $data1)
{
if($round_no > MAX_ATTACK_ROUNDS) #FIX
break;

$html .= '<h3>".$LNG["sys_attack_round"]." '.$round_no.' </h3><br><br>';
$attackers1 = $data1['attackers'];
$attackers2 = $data1['infoA'];
$attackers3 = $data1['attackA'];
$defenders1 = $data1['defenders'];
$defenders2 = $data1['infoD'];
$defenders3 = $data1['defenseA'];
$coord4 = 0;
$coord5 = 0;
$coord6 = 0;
$html .= '<table>';
foreach($attackers1 as $fleet_id1 => $data2)
{
$name = $data2['user']['username'];
$coord1 = $data2['fleet']['fleet_start_galaxy'];
$coord2 = $data2['fleet']['fleet_start_system'];
$coord3 = $data2['fleet']['fleet_start_planet'];
$coord4 = $data2['fleet']['fleet_end_galaxy'];
$coord5 = $data2['fleet']['fleet_end_system'];
$coord6 = $data2['fleet']['fleet_end_planet'];
$weap = $data2['techs'][0] * 100;
$shie = $data2['techs'][1] * 100;
$armr = $data2['techs'][2] * 100;

$fl_info1   = '<td class=\"merecidas\"><table><tr><td><h3><font color=\"orange\">".$LNG["sys_attack_attacker_pos"]." '.$name.' (['.$coord1.':'.$coord2.':'.$coord3.'])</font><br>".$LNG["sys_ship_weapon"]." '.$weap.'% - ".$LNG["sys_ship_shield"]." '.$shie.'% - ".$LNG["sys_ship_armour"]." '.$armr.'%</h3>';
$table1   = '<table cellspacing=\"5\">';

if (array_sum($data2['detail']) != 0)
{
$ships1  = '<tr><td class=\"transparent\">".$LNG["sys_ship_type"]."</td>';
$count1  = '<tr><td class=\"transparent\">".$LNG["sys_ship_count"]."</td>';

foreach($data2['detail'] as $ship_id1 => $ship_count1)
{
if ($ship_count1 <= 0)
continue;

if($round_no < count($RESULT['rw']) and $round_no < MAX_ATTACK_ROUNDS )
$fark = ($ship_count1-$RESULT['rw'][$round_no]['attackers'][$fleet_id1]['detail'][$ship_id1]);

$ships1 .= '<td class=\"transparent\"><img src=\"styles/theme/gow/gebaeude/'.$ship_id1.'.png\" width=\"50\" height=\"50\"></td>';
$count1 .= '<td class=\"transparent\">'.pretty_number($ship_count1).(($round_no < count($RESULT['rw']) and $round_no < MAX_ATTACK_ROUNDS) ? ('<font color=red>-'.$fark) : '').'</font></td>';
}

$ships1 .= '</tr>';
$count1 .= '</tr>';
}
else
{
$des['att'][] = 1;
$ships1 = '<tr><td class=\"transparent\">". $LNG["sys_destroyed"]."</td></tr>';
$count1 = '';
}

$info_part1[$fleet_id1] = $fl_info1.$table1.$ships1.$count1;
}

foreach($attackers2 as $fleet_id2 => $data3)
{
$weap1 = '<tr><td class=\"transparent\">".$LNG["sys_ship_weapon"]."</td>';
$shields1 = '<tr><td class=\"transparent\">".$LNG["sys_ship_shield"]."</td>';
$armour1 = '<tr><td class=\"transparent\">".$LNG["sys_ship_armour"]."</td>';
foreach($data3 as $ship_id2 => $ship_points1)
{
if($ship_points1['shield'] <= 0)
continue;

$weap1 .= '<td class=\"transparent\">'.pretty_number($ship_points1['att']).'</td>';
$shields1 .= '<td class=\"transparent\">'.pretty_number($ship_points1['def']).'</td>';
$armour1 .= '<td class=\"transparent\">'.pretty_number($ship_points1['shield']).'</td>';
}

$weap1 .= '</tr>';
$shields1 .= '</tr>';
$armour1 .= '</tr>';
$endtable1 = '</table></td></tr></table></td>';

$info_part2[$fleet_id2] = $weap1.$shields1.$armour1.$endtable1;

if (array_sum($attackers1[$fleet_id2]['detail']) != 0)
{
$html .= $info_part1[$fleet_id2].$info_part2[$fleet_id2];
}
else
{
$html .= $info_part1[$fleet_id2];
}
}

$html .= '</tr></table>';
$html .= '<br><br>';




$html .= '<table cellspacing=\"5\"><tr>';
foreach($defenders1 as $fleet_id1 => $data2)
{
$name = $data2['user']['username'];
$weap = $data2['techs'][0] * 100;
$shie = $data2['techs'][1] * 100;
$armr = $data2['techs'][2] * 100;

$fl_info1 = '<td class=\"merecidas\"><table><tr><td><h3><font color=\"orange\"".$LNG["sys_attack_defender_pos"]." '.$name.' (['.$coord4.':'.$coord5.':'.$coord6.'])</font><br />".$LNG["sys_ship_weapon"]." '.$weap.'% - ".$LNG["sys_ship_shield"]." '.$shie.'% - ".$LNG["sys_ship_armour"]." '.$armr.'%</h3>';
$table1   = '<table width=\'100%\'>';

if (array_sum($data2['def']) != 0)
{
$ships1  = '<tr><td class=\"transparent\">".$LNG["sys_ship_type"]."</td>';
$count1  = '<tr><td class=\"transparent\">".$LNG["sys_ship_count"]."</td>';

foreach($data2['def'] as $ship_id1 => $ship_count1)
{
if ($ship_count1 == 0)
continue;

if($round_no < count($RESULT['rw']) and $round_no < MAX_ATTACK_ROUNDS )
$fark = ($ship_count1-$RESULT['rw'][$round_no]['defenders'][$fleet_id1]['def'][$ship_id1]);

$ships1 .= '<td class=\"transparent\"><img src=\"styles/theme/gow/gebaeude/'.$ship_id1.'.png\" width=\"50\" height=\"50\"></td>';
$count1 .= '<td class=\"transparent\">'.pretty_number($ship_count1).(($round_no < count($RESULT['rw']) and $round_no < MAX_ATTACK_ROUNDS) ? ('<font color=red>-'.$fark) : '').'</font></td>';
}

$ships1 .= '</tr>';
$count1 .= '</tr>';
}
else
{
$des['def'][] = 1;
$ships1 = '<tr><td class=\"transparent\">".$LNG["sys_destroyed"]."</td></tr>';
$count1 = '';
}

$info_part1[$fleet_id1] = $fl_info1.$table1.$ships1.$count1;
}

foreach($defenders2 as $fleet_id2 => $data3)
{
$weap1   = '<tr><td class=\"transparent\">".$LNG["sys_ship_weapon"]."</td>';
$shields1   = '<tr><td class=\"transparent\">".$LNG["sys_ship_shield"]."</td>';
$armour1   = '<tr><td class=\"transparent\">".$LNG["sys_ship_armour"]."</td>';

foreach( $data3 as $ship_id2 => $ship_points1)
{
if($ship_points1['shield'] <= 0)
continue;

$weap1 .= '<td class=\"transparent\">'.pretty_number($ship_points1['att']).'</td>';
$shields1 .= '<td class=\"transparent\">'.pretty_number($ship_points1['def']).'</td>';
$armour1 .= '<td class=\"transparent\">'.pretty_number($ship_points1['shield']).'</td>';
}

$weap1 .= '</tr>';
$shields1 .= '</tr>';
$armour1 .= '</tr>';
$endtable1 = '</table></td></tr></table>';

$info_part2[$fleet_id2] = $weap1.$shields1.$armour1.$endtable1;

if (array_sum($defenders1[$fleet_id2]['def']) != 0)
{
$html .= $info_part1[$fleet_id2].$info_part2[$fleet_id2];
$html .= '';
}
else
{
$html .= $info_part1[$fleet_id2];
$html .= '</table></td></tr></table><br><br>';
}
}

$html .= '</tr></table>';
if (array_sum($des['att']) == count($attackers2) || array_sum($des['def']) == count($defenders2)) break;

$html .= '".$LNG["fleet_attack_1"]." '.pretty_number($data1['attack']).' ".$LNG["fleet_attack_2"]." '.pretty_number($data1['defShield']).' ".$LNG["damage"]."<br>';
$html .= '".$LNG["fleet_defs_1"]." '.pretty_number($data1['defense']).' ".$LNG["fleet_defs_2"]." '.pretty_number($data1['attackShield']).' ".$LNG["damage"]."<br><br>';
$round_no++;
}

switch($RESULT['won'])
{
case 'r':
$result1  = '".$LNG["sys_defender_won"]."<br>';
break;
case 'a':
$result1  = '".$LNG["sys_attacker_won"]."<br>".$LNG["sys_stealed_ressources"]." '.pretty_number($INFO['steal']['metal']).' ".$LNG["Metal"].", '.pretty_number($INFO['steal']['crystal']).' ".$LNG["Crystal"].", '.pretty_number($INFO['steal']['norio']).' ".$LNG["Norio"].", ".$LNG["and"]." '.pretty_number($INFO['steal']['deuterium']).' ".$LNG["Deuterium"]."<br>';
break;
default:
$result1  = '".$LNG["sys_both_won"].".<br>';
break;
}

$html .= '<br><br>'.$result1.'<br>';
$html .= '".$LNG["sys_attacker_lostunits"]." '.pretty_number($RESULT['lost']['att']).' ".$LNG["sys_units"]."<br>';
$html .= '".$LNG["sys_defender_lostunits"]." '.pretty_number($RESULT['lost']['def']).' ".$LNG["sys_units"]."<br>';
$html .= '".$LNG["debree_field_1"]." '.pretty_number($RESULT['debree']['att'][0] + $RESULT['debree']['def'][0]).' ".$LNG["Metal"]." '.pretty_number($RESULT['debree']['att'][1] + $RESULT['debree']['def'][1]).' ".$LNG["Crystal"]." ".$LNG["sys_and"]." '.pretty_number($RESULT['debree']['att'][2] + $RESULT['debree']['def'][2]).' ".$LNG["Norio"]." ".$LNG["debree_field_2"]."<br><br>';

if($INFO['moon']['des'] == 1) {
$html .= '".sprintf($LNG["sys_destruc_mess"], "'.$INFO['start_galaxy'].'", "'.$INFO['start_system'].'", "'.$INFO['start_planet'].'", "'.$INFO['end_galaxy'].'", "'.$INFO['end_system'].'", "'.$INFO['end_planet'].'")."<br>';
if($INFO['moon']['desfail'] == 1) {
$html .= '".$LNG["sys_destruc_stop"]."<br>';
} else {
$html .= '".sprintf($LNG["sys_destruc_lune"], "'.$INFO['moon']['chance'].'")."<br>".$LNG["sys_destruc_mess1"]."';
$html .= $INFO['moon']['desfail'] == 0 ? '".$LNG["sys_destruc_reussi"]."' : '".$LNG["sys_destruc_null"]."';
$html .= '<br>".sprintf($LNG["sys_destruc_rip"], "'.$INFO['moon']['chance2'].'")."';
if($INFO['moon']['fleetfail'] == 1) {
$html .= '<br>".$LNG["sys_destruc_echec"]."';
}
}
} else {
$html .= '".$LNG["sys_moonproba"]." '.$INFO['moon']['chance'].' %<br>';
if(!empty($INFO['moon']['name']))
{
$html .= '".sprintf($LNG["sys_moonbuilt"], "'.$INFO['moon']['name'].'", "'.$INFO['end_galaxy'].'", "'.$INFO['end_system'].'", "'.$INFO['end_planet'].'")."';
}
}

if(isset($INFO['moon']['battlesim'])) {
$html .= $INFO['moon']['battlesim'];
}
$html .= '</center></div><script type=\"text/javascript\">RaportInfo = '.addcslashes(json_encode(array($RESULT['won'], ($RESULT['lost']['att'] + $RESULT['lost']['def']), $RESULT['debree']['att'][0], $RESULT['debree']['def'][0], $INFO['attvsdef'])), '"').';</script>"';
return $html;
}

?>

Que faire ?

Merci !

lundi 20 février 2012

Darkevil Messages : 221

Évite de faire un double post.

vendredi 24 février 2012

Répondre Pour répondre, tu dois d'abord t'inscrire rapidement sur Kommunauty. Rejoins-nous vite !