//create the table that is to have the main content of the page in it echo "<table border='0' width='100%' cellspacing='0' cellpadding='0'><tr><td width='450' valign='top'><br /><br /><br />"; //list games echo "<b>Game Listings</b> for <b class='b1'>$p_user[login_name]</b><br /><br />"; echo "To login or join a game, click it's name below<br /><br />"; echo "<table border='1' cellspacing='0' cellpadding='20'>"; echo "<tr><td valign='top' width='300' bgcolor='#555555'>"; echo "List of games presently running on this server:<br /><br />"; */ // check of the user is in holiday mode $show_holiday_form = true; $show_galaxies = true; $holiday_msg = "<b>Mode vacances</b><br />Si vous passez en mode vacance vous ne pourrez plus gérer votre compte, vos productions seront arretées et les autres joueurs ne pourront vous attaquer."; if (checkHolidayMode()) { $mode = "Désactiver le mode vacances"; $mode_val = 0; $show_galaxies = false; $holiday_msg = "Vous êtes en mode vacances, pour revenir en mode normal appuyez sur ce bouton"; } else { $mode = "Activer le mode vacances"; $mode_val = 1; if (!checkHoliday24h()) { $show_holiday_form = false; } } /* if ( isset( $_POST['mode'] ) ) { setHolidayMode( (int)$_POST['mode'] ); echo "<script>self.location='game_listing.php';</script>";
} elseif (config_check("hs", $ships) && config_check("sc", $ships)) { # ls, no scanner. $error_str .= sprintf($st[60], $ships[class_name]); } if ($ships['clan_id'] == $user['clan_id'] && $user['clan_id'] > 0 && $GAME_VARS['clan_fleet_attacking'] == 1) { $error_str .= " - " . $cw['can_fleet'] . ": <b>{$ships['clan_fleet_id']}</b>"; } //attack link won't be shown if: //player cannot attack //target is admin //is a clanmate //target in safe_turns //target ship is ls stealth and no scanner //user in holiday mode //(config_check("ls", $ships) || config_check("hs", $ships) && !config_check("sc", $ships)) if ($can_attack == 0 || $ships['login_id'] == 1 || $user['clan_id'] == $ships['clan_id'] && $user['clan_id'] > 0 || $ships['turns_run'] < $GAME_VARS['turns_safe'] || (config_check("ls", $ships) || config_check("hs", $ships) && !config_check("sc", $ships)) || checkHolidayMode($ships['login_id'])) { $error_str .= "<br />"; } else { $error_str .= " - <a href='attack.php?target={$ships['ship_id']}'>" . $cw['attack'] . "</a><br />"; } $ships = dbr2(1); } #end of loop through other ships. unset($ships); } else { $error_str .= $st[61]; } /* SHOW SUMMARY OF ENEMY SHIPS */ } else { db2("select count(s.ship_id) as total, sum(s.fighters) as fighters, s.login_id, u.clan_id, u.turns_run, s.config from {$db_name}_ships s, {$db_name}_users u where s.location = '{$user['location']}' && s.ship_id > 1 && s.login_id != '{$user['login_id']}' && u.login_id = s.login_id group by config REGEXP 'hs|ls', login_id order by total"); $ships = dbr2(1);
} elseif ($user['turns'] < $GAME_VARS['attack_turn_cost_planet'] && $planet_attack == 1) { $tech_str = sprintf($st[243], $GAME_VARS[attack_turn_cost_planet]); //ensure target is attackable, and that it even exists properly! } elseif ($target_fleet_brief['turns_run'] < $GAME_VARS['turns_safe']) { $tech_str = $st[244]; //ensure the attacking ship has a scanner on it. } elseif ($planet_attack == 0 && (!config_check("sc", $user_ship) && (config_check("ls", $target_fleet_brief) || config_check("hs", $target_fleet_brief)) && $planet_attack == 0)) { $tech_str = $st[245]; //player trying to attack either themselves, or a clan-mate?!?! } elseif ($target_fleet_brief['login_id'] == $user['login_id'] || $target_fleet_brief['clan_id'] == $user['clan_id'] && $user['clan_id'] > 0) { $tech_str = $st[246]; //wouldn't want to attack the admin would we? } elseif ($target_fleet_brief['login_id'] == 1) { $tech_str = $st[247]; //check if attacked user is in holiday mode } elseif (checkHolidayMode($target_fleet_brief['login_id'])) { $tech_str = $st[1886]; //user passed initial tests. } else { unset($warship_count); /*********** * second level of checks. Ensure there is a fleet to attack and user may actually attack ***********/ //select all enemy ships that belong to that user and are in that fleet, or that are clan-mates and are in the same fleet - must also be outside turns safe. /*$enemy_ship_counter_sql = " from ${db_name}_ships s, ${db_name}_users u, ${db_name}_planets p where ( (((s.fleet_id = '$target_fleet_brief[fleet_id]' && s.login_id = '$target_fleet_brief[login_id]') || (u.clan_id > 0 && s.clan_fleet_id = '$target_fleet_brief[clan_fleet_id]' && u.clan_id = '$target_fleet_brief[clan_id]' && s.login_id != '$target_fleet_brief[login_id]')) && s.location = '$combat_loc' && s.login_id = u.login_id) || (((p.fleet_id = '$target_fleet_brief[fleet_id]' && p.login_id = '$target_fleet_brief[login_id]') || (u.clan_id > 0 && p.clan_fleet_id = '$target_fleet_brief[clan_fleet_id]' && u.clan_id = '$target_fleet_brief[clan_id]' && p.login_id != '$target_fleet_brief[login_id]')) && p.location = '$combat_loc' && p.login_id = u.login_id ))