@@ -30,29 +30,29 @@ discard block |
||
| 30 | 30 | } |
| 31 | 31 | $size = getimagesize(SN_ROOT_PHYSICAL . $img_name); |
| 32 | 32 | $im = imagecreatefrompng(SN_ROOT_PHYSICAL . $img_name); |
| 33 | - $image = imagecreatetruecolor($size[0],$size[1]); |
|
| 34 | - imagecopy($image,$im,0,0,0,0,$size[0],$size[1]); |
|
| 33 | + $image = imagecreatetruecolor($size[0], $size[1]); |
|
| 34 | + imagecopy($image, $im, 0, 0, 0, 0, $size[0], $size[1]); |
|
| 35 | 35 | imagedestroy($im); |
| 36 | 36 | |
| 37 | 37 | // Colors |
| 38 | 38 | $color = "FFFFFF"; |
| 39 | - $red = hexdec(substr($color,0,2)); |
|
| 40 | - $green = hexdec(substr($color,2,4)); |
|
| 41 | - $blue = hexdec(substr($color,4,6)); |
|
| 42 | - $select = imagecolorallocate($image,$red,$green,$blue); |
|
| 39 | + $red = hexdec(substr($color, 0, 2)); |
|
| 40 | + $green = hexdec(substr($color, 2, 4)); |
|
| 41 | + $blue = hexdec(substr($color, 4, 6)); |
|
| 42 | + $select = imagecolorallocate($image, $red, $green, $blue); |
|
| 43 | 43 | $txt_shadow = imagecolorallocatealpha($image, 255, 255, 255, 255); |
| 44 | 44 | $txt_color = imagecolorallocatealpha($image, 255, 255, 255, 2); |
| 45 | 45 | $txt_shadow2 = imagecolorallocatealpha($image, 255, 255, 255, 255); |
| 46 | 46 | $txt_color2 = imagecolorallocatealpha($image, 255, 255, 255, 40); |
| 47 | 47 | |
| 48 | - $fonts = array ( |
|
| 48 | + $fonts = array( |
|
| 49 | 49 | 'userbar' => SN_ROOT_PHYSICAL . "design/fonts/" . $config->int_userbar_font, |
| 50 | 50 | 'universe' => SN_ROOT_PHYSICAL . "design/fonts/" . $config->int_banner_fontUniverse, |
| 51 | 51 | 'raids' => SN_ROOT_PHYSICAL . "design/fonts/" . $config->int_banner_fontRaids, |
| 52 | 52 | 'info' => SN_ROOT_PHYSICAL . "design/fonts/" . $config->int_banner_fontInfo, |
| 53 | 53 | ); |
| 54 | 54 | |
| 55 | - if($id) |
|
| 55 | + if ($id) |
|
| 56 | 56 | { |
| 57 | 57 | // Querys |
| 58 | 58 | $user = db_user_by_id($id); |
@@ -62,8 +62,8 @@ discard block |
||
| 62 | 62 | $b_user = $user['username']; |
| 63 | 63 | $b_ally = $user['ally_name']; |
| 64 | 64 | $b_planet = $planet_row['name']; |
| 65 | - $b_xyz = "[".$planet_row['galaxy'].":".$planet_row['system'].":".$planet_row['planet']."]"; |
|
| 66 | - $b_lvl = ($user['total_rank'] ? $user['total_rank'] : $config->users_amount) ."/{$config->users_amount}"; |
|
| 65 | + $b_xyz = "[" . $planet_row['galaxy'] . ":" . $planet_row['system'] . ":" . $planet_row['planet'] . "]"; |
|
| 66 | + $b_lvl = ($user['total_rank'] ? $user['total_rank'] : $config->users_amount) . "/{$config->users_amount}"; |
|
| 67 | 67 | } |
| 68 | 68 | else |
| 69 | 69 | { |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | imagettftext($image, 11, 0, 8, 26, $txt_shadow, $fonts['info'], $b_user); |
| 86 | 86 | imagettftext($image, 11, 0, 6, 23, $txt_color, $fonts['info'], $b_user); |
| 87 | 87 | |
| 88 | - if($id) |
|
| 88 | + if ($id) |
|
| 89 | 89 | { |
| 90 | 90 | // Player level - right-alligned |
| 91 | 91 | $is = imagettfbbox(11, 0, $fonts['info'], $b_lvl); |
@@ -94,37 +94,37 @@ discard block |
||
| 94 | 94 | |
| 95 | 95 | // Ally name |
| 96 | 96 | $is = imagettfbbox(9, 0, $fonts['info'], $b_ally); |
| 97 | - imagettftext($image, 9, 0, 412-$is[2], 37, $txt_shadow, $fonts['info'], $b_ally); |
|
| 98 | - imagettftext($image, 9, 0, 410-$is[2], 35, $txt_color, $fonts['info'], $b_ally); |
|
| 97 | + imagettftext($image, 9, 0, 412 - $is[2], 37, $txt_shadow, $fonts['info'], $b_ally); |
|
| 98 | + imagettftext($image, 9, 0, 410 - $is[2], 35, $txt_color, $fonts['info'], $b_ally); |
|
| 99 | 99 | |
| 100 | 100 | // Player b_planet |
| 101 | - imagettftext($image, 6, 0, 8, 10, $txt_shadow2, $fonts['raids'], $b_planet." ".$b_xyz); |
|
| 102 | - imagettftext($image, 6, 0, 6, 9, $txt_color2, $fonts['raids'], $b_planet." ".$b_xyz); |
|
| 101 | + imagettftext($image, 6, 0, 8, 10, $txt_shadow2, $fonts['raids'], $b_planet . " " . $b_xyz); |
|
| 102 | + imagettftext($image, 6, 0, 6, 9, $txt_color2, $fonts['raids'], $b_planet . " " . $b_xyz); |
|
| 103 | 103 | |
| 104 | 104 | //StatPoint |
| 105 | - $b_points = $lang['ov_points'].": ".pretty_number($user['total_points']); |
|
| 105 | + $b_points = $lang['ov_points'] . ": " . pretty_number($user['total_points']); |
|
| 106 | 106 | $is = imagettfbbox(8, 0, $fonts['info'], $b_points); |
| 107 | - imagettftext($image, 8, 0, 412-$is[2], 11, $txt_shadow, $fonts['info'], $b_points); |
|
| 108 | - imagettftext($image, 8, 0, 410-$is[2], 9, $txt_color, $fonts['info'], $b_points); |
|
| 107 | + imagettftext($image, 8, 0, 412 - $is[2], 11, $txt_shadow, $fonts['info'], $b_points); |
|
| 108 | + imagettftext($image, 8, 0, 410 - $is[2], 9, $txt_color, $fonts['info'], $b_points); |
|
| 109 | 109 | |
| 110 | 110 | //Raids Total |
| 111 | 111 | imagettftext($image, 6, 0, 8, 37, $txt_shadow2, $fonts['raids'], $lang['NumberOfRaids']); |
| 112 | 112 | imagettftext($image, 6, 0, 6, 35, $txt_color2, $fonts['raids'], $lang['NumberOfRaids']); |
| 113 | - $b_points = ": ".pretty_number($user['raids']); |
|
| 113 | + $b_points = ": " . pretty_number($user['raids']); |
|
| 114 | 114 | imagettftext($image, 6, 0, 61, 37, $txt_shadow2, $fonts['raids'], $b_points); |
| 115 | 115 | imagettftext($image, 6, 0, 59, 35, $txt_color2, $fonts['raids'], $b_points); |
| 116 | 116 | |
| 117 | 117 | //Raids Won |
| 118 | 118 | imagettftext($image, 6, 0, 8, 47, $txt_shadow2, $fonts['raids'], $lang['RaidsWin']); |
| 119 | 119 | imagettftext($image, 6, 0, 6, 45, $txt_color2, $fonts['raids'], $lang['RaidsWin']); |
| 120 | - $b_points = ": ".pretty_number($user['raidswin']); |
|
| 120 | + $b_points = ": " . pretty_number($user['raidswin']); |
|
| 121 | 121 | imagettftext($image, 6, 0, 61, 47, $txt_shadow2, $fonts['raids'], $b_points); |
| 122 | 122 | imagettftext($image, 6, 0, 59, 45, $txt_color2, $fonts['raids'], $b_points); |
| 123 | 123 | |
| 124 | 124 | //Raids Lost |
| 125 | 125 | imagettftext($image, 6, 0, 8, 57, $txt_shadow2, $fonts['raids'], $lang['RaidsLoose']); |
| 126 | 126 | imagettftext($image, 6, 0, 6, 55, $txt_color2, $fonts['raids'], $lang['RaidsLoose']); |
| 127 | - $b_points = ": ".pretty_number($user['raidsloose']); |
|
| 127 | + $b_points = ": " . pretty_number($user['raidsloose']); |
|
| 128 | 128 | imagettftext($image, 6, 0, 61, 57, $txt_shadow2, $fonts['raids'], $b_points); |
| 129 | 129 | imagettftext($image, 6, 0, 59, 55, $txt_color2, $fonts['raids'], $b_points); |
| 130 | 130 | } |
@@ -137,25 +137,25 @@ discard block |
||
| 137 | 137 | $is = imagettfbbox(9, 0, $fonts['userbar'], $b_univ); |
| 138 | 138 | $is = $size[0] - $is[2] - 2; |
| 139 | 139 | imagettftext($image, 9, 0, $is, $size[1] - 3, $txt_shadow, $fonts['userbar'], $b_univ); |
| 140 | - imagettftext($image, 9, 0, $is-1, $size[1] - 5, $txt_color, $fonts['userbar'], $b_univ); |
|
| 141 | - imagettftext($image, 22, 0, $is-8, $size[1], $txt_color, $fonts['userbar'], '/'); |
|
| 140 | + imagettftext($image, 9, 0, $is - 1, $size[1] - 5, $txt_color, $fonts['userbar'], $b_univ); |
|
| 141 | + imagettftext($image, 22, 0, $is - 8, $size[1], $txt_color, $fonts['userbar'], '/'); |
|
| 142 | 142 | |
| 143 | 143 | // Player name |
| 144 | 144 | imagettftext($image, 9, 0, 4, $size[1] - 4, $txt_shadow, $fonts['userbar'], $b_user); |
| 145 | 145 | imagettftext($image, 9, 0, 2, $size[1] - 6, $txt_color, $fonts['userbar'], $b_user); |
| 146 | 146 | |
| 147 | - if($id) |
|
| 147 | + if ($id) |
|
| 148 | 148 | { |
| 149 | 149 | // Player level - right-alligned |
| 150 | 150 | $isp = imagettfbbox(9, 0, $fonts['userbar'], $b_lvl); |
| 151 | - imagettftext($image, 9, 0, $is-$isp[2] - 10, $size[1] - 4, $txt_shadow, $fonts['userbar'], $b_lvl); |
|
| 152 | - imagettftext($image, 9, 0, $is-$isp[2] - 10 - 1, $size[1] - 4 - 1, $txt_color, $fonts['userbar'], $b_lvl); |
|
| 151 | + imagettftext($image, 9, 0, $is - $isp[2] - 10, $size[1] - 4, $txt_shadow, $fonts['userbar'], $b_lvl); |
|
| 152 | + imagettftext($image, 9, 0, $is - $isp[2] - 10 - 1, $size[1] - 4 - 1, $txt_color, $fonts['userbar'], $b_lvl); |
|
| 153 | 153 | } |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | //And now convert it back to PNG-8 |
| 157 | - $im_result = imagecreate($size[0],$size[1]); |
|
| 158 | - imagecopy($im_result,$image,0,0,0,0,$size[0],$size[1]); |
|
| 157 | + $im_result = imagecreate($size[0], $size[1]); |
|
| 158 | + imagecopy($im_result, $image, 0, 0, 0, 0, $size[0], $size[1]); |
|
| 159 | 159 | imagedestroy($image); |
| 160 | 160 | //And save it |
| 161 | 161 | $imagetypes = imagetypes(); |
@@ -1,11 +1,11 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -function geoip_status(){return sn_function_call('geoip_status', array(&$result));} |
|
| 3 | +function geoip_status() {return sn_function_call('geoip_status', array(&$result)); } |
|
| 4 | 4 | function sn_geoip_status(&$result) { |
| 5 | 5 | return $result = false; |
| 6 | 6 | } |
| 7 | 7 | |
| 8 | -function geoip_ip_info($ip){return sn_function_call('geoip_ip_info', array($ip, &$result));} |
|
| 8 | +function geoip_ip_info($ip) {return sn_function_call('geoip_ip_info', array($ip, &$result)); } |
|
| 9 | 9 | function sn_geoip_ip_info($ip, &$result) { |
| 10 | 10 | return $result = false; |
| 11 | 11 | } |
@@ -4,9 +4,9 @@ discard block |
||
| 4 | 4 | { |
| 5 | 5 | global $user; |
| 6 | 6 | |
| 7 | - if(!empty($ranks)) |
|
| 7 | + if (!empty($ranks)) |
|
| 8 | 8 | { |
| 9 | - foreach($ranks as $rank => $rights) |
|
| 9 | + foreach ($ranks as $rank => $rights) |
|
| 10 | 10 | { |
| 11 | 11 | $rights = implode(',', $rights); |
| 12 | 12 | $ranklist .= $rights . ';'; |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | ORDER BY alliance_diplomacy_time, alliance_diplomacy_id;" |
| 38 | 38 | ); |
| 39 | 39 | |
| 40 | - while($record = db_fetch($query)) |
|
| 40 | + while ($record = db_fetch($query)) |
|
| 41 | 41 | { |
| 42 | 42 | $temp_array[$record['alliance_diplomacy_contr_ally_id']] = $record; |
| 43 | 43 | } |
@@ -85,28 +85,28 @@ discard block |
||
| 85 | 85 | function rpg_points_change($user_id, $change_type, $dark_matter, $comment = false, $already_changed = false) { |
| 86 | 86 | global $debug, $config, $dm_change_legit, $user; |
| 87 | 87 | |
| 88 | - if(!$user_id) { |
|
| 88 | + if (!$user_id) { |
|
| 89 | 89 | return false; |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | $dm_change_legit = true; |
| 93 | 93 | $sn_data_dark_matter_db_name = pname_resource_name(RES_DARK_MATTER); |
| 94 | 94 | |
| 95 | - if($already_changed) { |
|
| 95 | + if ($already_changed) { |
|
| 96 | 96 | $rows_affected = 1; |
| 97 | 97 | } else { |
| 98 | 98 | $changeset = array(); |
| 99 | 99 | $a_user = db_user_by_id($user_id, true); |
| 100 | - if($dark_matter < 0) { |
|
| 100 | + if ($dark_matter < 0) { |
|
| 101 | 101 | $dark_matter_exists = mrc_get_level($a_user, null, RES_DARK_MATTER, false, true); |
| 102 | 102 | $dark_matter_exists < 0 ? $dark_matter_exists = 0 : false; |
| 103 | 103 | $metamatter_to_reduce = -$dark_matter - $dark_matter_exists; |
| 104 | - if($metamatter_to_reduce > 0) { |
|
| 104 | + if ($metamatter_to_reduce > 0) { |
|
| 105 | 105 | $metamatter_exists = mrc_get_level($a_user, null, RES_METAMATTER); |
| 106 | - if($metamatter_exists < $metamatter_to_reduce) { |
|
| 106 | + if ($metamatter_exists < $metamatter_to_reduce) { |
|
| 107 | 107 | $debug->error('Ошибка снятия ТМ - ММ+ТМ меньше, чем сумма для снятия!', 'Ошибка снятия ТМ', LOG_ERR_INT_NOT_ENOUGH_DARK_MATTER); |
| 108 | 108 | } |
| 109 | - if(is_array($comment)) { |
|
| 109 | + if (is_array($comment)) { |
|
| 110 | 110 | $comment = call_user_func_array('sprintf', $comment); |
| 111 | 111 | } |
| 112 | 112 | // mm_points_change($user_id, $change_type, -$metamatter_to_reduce, 'ММ в ТМ: ' . (-$dark_matter) . ' ТМ = ' . $dark_matter_exists . ' ТМ + ' . $metamatter_to_reduce . ' ММ. ' . $comment); |
@@ -121,9 +121,9 @@ discard block |
||
| 121 | 121 | $rows_affected = classSupernova::$db->db_affected_rows(); |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | - if($rows_affected || !$dark_matter) { |
|
| 124 | + if ($rows_affected || !$dark_matter) { |
|
| 125 | 125 | $page_url = db_escape($_SERVER['SCRIPT_NAME']); |
| 126 | - if(is_array($comment)) { |
|
| 126 | + if (is_array($comment)) { |
|
| 127 | 127 | $comment = call_user_func_array('sprintf', $comment); |
| 128 | 128 | } |
| 129 | 129 | $comment = db_escape($comment); |
@@ -137,18 +137,18 @@ discard block |
||
| 137 | 137 | {$dark_matter}, '{$comment}', '{$page_url}', {$user_id} |
| 138 | 138 | );"); |
| 139 | 139 | |
| 140 | - if($user['id'] == $user_id) { |
|
| 140 | + if ($user['id'] == $user_id) { |
|
| 141 | 141 | $user['dark_matter'] += $dark_matter; |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | - if($dark_matter > 0) { |
|
| 144 | + if ($dark_matter > 0) { |
|
| 145 | 145 | $old_referral = doquery("SELECT * FROM {{referrals}} WHERE `id` = {$user_id} LIMIT 1 FOR UPDATE;", '', true); |
| 146 | - if($old_referral['id']) { |
|
| 146 | + if ($old_referral['id']) { |
|
| 147 | 147 | doquery("UPDATE {{referrals}} SET dark_matter = dark_matter + '{$dark_matter}' WHERE `id` = {$user_id} LIMIT 1;"); |
| 148 | 148 | $new_referral = doquery("SELECT * FROM {{referrals}} WHERE `id` = {$user_id} LIMIT 1;", '', true); |
| 149 | 149 | |
| 150 | 150 | $partner_bonus = floor($new_referral['dark_matter'] / $config->rpg_bonus_divisor) - ($old_referral['dark_matter'] >= $config->rpg_bonus_minimum ? floor($old_referral['dark_matter'] / $config->rpg_bonus_divisor) : 0); |
| 151 | - if($partner_bonus > 0 && $new_referral['dark_matter'] >= $config->rpg_bonus_minimum) { |
|
| 151 | + if ($partner_bonus > 0 && $new_referral['dark_matter'] >= $config->rpg_bonus_minimum) { |
|
| 152 | 152 | rpg_points_change($new_referral['id_partner'], RPG_REFERRAL, $partner_bonus, "Incoming From Referral ID {$user_id}"); |
| 153 | 153 | } |
| 154 | 154 | } |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | { |
| 166 | 166 | $q = 1.03; |
| 167 | 167 | |
| 168 | - switch($type) |
|
| 168 | + switch ($type) |
|
| 169 | 169 | { |
| 170 | 170 | case RPG_STRUCTURE: |
| 171 | 171 | $field_level = 'lvl_minier'; |
@@ -203,19 +203,19 @@ discard block |
||
| 203 | 203 | |
| 204 | 204 | $xp = &$user[$field_xp]; |
| 205 | 205 | |
| 206 | - if($xp_to_add) |
|
| 206 | + if ($xp_to_add) |
|
| 207 | 207 | { |
| 208 | 208 | $xp += $xp_to_add; |
| 209 | 209 | db_user_set_by_id($user['id'], "`{$field_xp}` = `{$field_xp}` + '{$xp_to_add}'"); |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | $level = $user[$field_level]; |
| 213 | - while($xp > rpg_xp_for_level($level + 1, $b1, $q)) |
|
| 213 | + while ($xp > rpg_xp_for_level($level + 1, $b1, $q)) |
|
| 214 | 214 | { |
| 215 | 215 | $level++; |
| 216 | 216 | } |
| 217 | 217 | $level -= $user[$field_level]; |
| 218 | - if($level > 0) |
|
| 218 | + if ($level > 0) |
|
| 219 | 219 | { |
| 220 | 220 | db_user_set_by_id($user['id'], "`{$field_level}` = `{$field_level}` + '{$level}'"); |
| 221 | 221 | rpg_points_change($user['id'], $type, $level * 1000, $comment); |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | |
| 226 | 226 | function rpg_xp_for_level($level, $b1, $q) |
| 227 | 227 | { |
| 228 | - return floor($b1 * (pow($q, $level) - 1)/($q - 1)); |
|
| 228 | + return floor($b1 * (pow($q, $level) - 1) / ($q - 1)); |
|
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | function rpg_get_miner_xp($level) |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | "ally_id = '{$ally_id}'" . ($ally_rank_id >= 0 ? " AND ally_rank_id = {$ally_rank_id}" : ''), |
| 27 | 27 | false, 'id, username'); |
| 28 | 28 | // while ($u = db_fetch($query)) |
| 29 | - foreach($query as $u) |
|
| 29 | + foreach ($query as $u) |
|
| 30 | 30 | { |
| 31 | 31 | $sendList[] = $u['id']; |
| 32 | 32 | $list .= "<br>{$u['username']} "; |
@@ -41,19 +41,19 @@ discard block |
||
| 41 | 41 | { |
| 42 | 42 | global $config, $user, $sn_message_class_list; |
| 43 | 43 | |
| 44 | - if(!$owners) |
|
| 44 | + if (!$owners) |
|
| 45 | 45 | { |
| 46 | 46 | return; |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | $timestamp = $timestamp ? $timestamp : SN_TIME_NOW; |
| 50 | 50 | $sender = intval($sender); |
| 51 | - if(!is_array($owners)) |
|
| 51 | + if (!is_array($owners)) |
|
| 52 | 52 | { |
| 53 | 53 | $owners = array($owners); |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - if(!$escaped) |
|
| 56 | + if (!$escaped) |
|
| 57 | 57 | { |
| 58 | 58 | $from = db_escape($from); |
| 59 | 59 | $subject = db_escape($subject); |
@@ -69,9 +69,9 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | $message_class_name_total = $sn_message_class_list[MSG_TYPE_NEW]['name']; |
| 71 | 71 | |
| 72 | - if($owners[0] == '*') |
|
| 72 | + if ($owners[0] == '*') |
|
| 73 | 73 | { |
| 74 | - if($user['authlevel'] < 3) |
|
| 74 | + if ($user['authlevel'] < 3) |
|
| 75 | 75 | { |
| 76 | 76 | return false; |
| 77 | 77 | } |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | |
| 88 | 88 | foreach ($owners as $owner) |
| 89 | 89 | { |
| 90 | - if($user['id'] != $owner) |
|
| 90 | + if ($user['id'] != $owner) |
|
| 91 | 91 | { |
| 92 | 92 | $owner_row = db_user_by_id($owner); |
| 93 | 93 | } |
@@ -97,18 +97,18 @@ discard block |
||
| 97 | 97 | } |
| 98 | 98 | sys_user_options_unpack($owner_row); |
| 99 | 99 | |
| 100 | - if($force || !$message_class_switchable || $owner_row["opt_{$message_class_name}"]) |
|
| 100 | + if ($force || !$message_class_switchable || $owner_row["opt_{$message_class_name}"]) |
|
| 101 | 101 | { |
| 102 | 102 | $insert_values[] = sprintf($insert_template, $owner); |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | - if($message_class_email && $config->game_email_pm && $owner_row["opt_email_{$message_class_name}"]) |
|
| 105 | + if ($message_class_email && $config->game_email_pm && $owner_row["opt_email_{$message_class_name}"]) |
|
| 106 | 106 | { |
| 107 | 107 | @$result = mymail($owner_row['email'], $subject, $text_unescaped, '', true); |
| 108 | 108 | } |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | - if(empty($insert_values)) |
|
| 111 | + if (empty($insert_values)) |
|
| 112 | 112 | { |
| 113 | 113 | return; |
| 114 | 114 | } |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | } |
| 119 | 119 | db_user_list_set_mass_mail($owners, "`{$message_class_name}` = `{$message_class_name}` + 1, `{$message_class_name_total}` = `{$message_class_name_total}` + 1"); |
| 120 | 120 | |
| 121 | - if(in_array($user['id'], $owners) || $owners[0] == '*') |
|
| 121 | + if (in_array($user['id'], $owners) || $owners[0] == '*') |
|
| 122 | 122 | { |
| 123 | 123 | $user[$message_class_name]++; |
| 124 | 124 | $user[$message_class_name_total]++; |
@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | function eco_get_planet_caps_modify_production(&$item, $key, $data) { |
| 4 | 4 | static $modifiers; |
| 5 | 5 | |
| 6 | - if(!$modifiers) { |
|
| 6 | + if (!$modifiers) { |
|
| 7 | 7 | $modifiers = sn_get_groups('modifiers'); |
| 8 | 8 | } |
| 9 | 9 | $item = floor(mrc_modify_value($data['user'], $data['planet'], $modifiers[MODIFIER_RESOURCE_PRODUCTION], $item)); |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | static $sn_group_modifiers, $config_resource_multiplier, $config_resource_multiplier_plain, $config_eco_scale_storage; |
| 17 | 17 | |
| 18 | - if(!$sn_group_modifiers) { |
|
| 18 | + if (!$sn_group_modifiers) { |
|
| 19 | 19 | $sn_group_modifiers = sn_get_groups('modifiers'); |
| 20 | 20 | $config_resource_multiplier = game_resource_multiplier(); |
| 21 | 21 | $config_resource_multiplier_plain = game_resource_multiplier(true); |
@@ -26,15 +26,15 @@ discard block |
||
| 26 | 26 | $caps['storage'][RES_METAL][0] = $config->eco_planet_storage_metal; |
| 27 | 27 | $caps['storage'][RES_CRYSTAL][0] = $config->eco_planet_storage_crystal; |
| 28 | 28 | $caps['storage'][RES_DEUTERIUM][0] = $config->eco_planet_storage_deuterium; |
| 29 | - foreach(sn_get_groups('storages') as $unit_id) { |
|
| 30 | - foreach(get_unit_param($unit_id, P_STORAGE) as $resource_id => $function) { |
|
| 29 | + foreach (sn_get_groups('storages') as $unit_id) { |
|
| 30 | + foreach (get_unit_param($unit_id, P_STORAGE) as $resource_id => $function) { |
|
| 31 | 31 | $caps['storage'][$resource_id][$unit_id] = floor($config_eco_scale_storage * |
| 32 | 32 | mrc_modify_value($user, $planet_row, $sn_group_modifiers[MODIFIER_RESOURCE_CAPACITY], $function(mrc_get_level($user, $planet_row, $unit_id))) |
| 33 | 33 | ); |
| 34 | 34 | } |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - if($planet_row['planet_type'] == PT_MOON) { |
|
| 37 | + if ($planet_row['planet_type'] == PT_MOON) { |
|
| 38 | 38 | return $caps; |
| 39 | 39 | } |
| 40 | 40 | |
@@ -46,12 +46,12 @@ discard block |
||
| 46 | 46 | $caps['production_full'][RES_DEUTERIUM][0] = floor($config->deuterium_basic_income * $config_resource_multiplier * (isset($planet_density[RES_DEUTERIUM]) ? $planet_density[RES_DEUTERIUM] : 1)); |
| 47 | 47 | $caps['production_full'][RES_ENERGY][0] = floor($config->energy_basic_income * $config_resource_multiplier_plain * (isset($planet_density[RES_ENERGY]) ? $planet_density[RES_ENERGY] : 1)); |
| 48 | 48 | |
| 49 | - foreach(sn_get_groups('factories') as $unit_id) { |
|
| 49 | + foreach (sn_get_groups('factories') as $unit_id) { |
|
| 50 | 50 | $unit_data = get_unit_param($unit_id); |
| 51 | 51 | $unit_level = mrc_get_level($user, $planet_row, $unit_id); |
| 52 | 52 | $unit_load = $planet_row[pname_factory_production_field_name($unit_id)]; |
| 53 | 53 | |
| 54 | - foreach($unit_data[P_UNIT_PRODUCTION] as $resource_id => $function) { |
|
| 54 | + foreach ($unit_data[P_UNIT_PRODUCTION] as $resource_id => $function) { |
|
| 55 | 55 | $caps['production_full'][$resource_id][$unit_id] = $function($unit_level, $unit_load, $user, $planet_row) |
| 56 | 56 | * ($resource_id == RES_ENERGY ? $config_resource_multiplier_plain : $config_resource_multiplier) |
| 57 | 57 | * (isset($planet_density[$resource_id]) ? $planet_density[$resource_id] : 1); |
@@ -60,21 +60,21 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | array_walk_recursive($caps['production_full'], 'eco_get_planet_caps_modify_production', array('user' => $user, 'planet' => $planet_row)); |
| 62 | 62 | |
| 63 | - foreach($caps['production_full'] as $resource_id => $resource_data) { |
|
| 63 | + foreach ($caps['production_full'] as $resource_id => $resource_data) { |
|
| 64 | 64 | $caps['total_production_full'][$resource_id] = array_sum($resource_data); |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | $caps['production'] = $caps['production_full']; |
| 68 | 68 | |
| 69 | - if($caps['production'][RES_ENERGY][STRUC_MINE_FUSION]) { |
|
| 69 | + if ($caps['production'][RES_ENERGY][STRUC_MINE_FUSION]) { |
|
| 70 | 70 | $deuterium_balance = array_sum($caps['production'][RES_DEUTERIUM]); |
| 71 | 71 | $energy_balance = array_sum($caps['production'][RES_ENERGY]); |
| 72 | - if($deuterium_balance < 0 || $energy_balance < 0) { |
|
| 72 | + if ($deuterium_balance < 0 || $energy_balance < 0) { |
|
| 73 | 73 | $caps['production'][RES_DEUTERIUM][STRUC_MINE_FUSION] = $caps['production'][RES_ENERGY][STRUC_MINE_FUSION] = 0; |
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - foreach($caps['production'][RES_ENERGY] as $energy) { |
|
| 77 | + foreach ($caps['production'][RES_ENERGY] as $energy) { |
|
| 78 | 78 | $caps[RES_ENERGY][$energy >= 0 ? BUILD_CREATE : BUILD_DESTROY] += $energy; |
| 79 | 79 | } |
| 80 | 80 | |
@@ -84,10 +84,10 @@ discard block |
||
| 84 | 84 | ? $caps[RES_ENERGY][BUILD_CREATE] / $caps[RES_ENERGY][BUILD_DESTROY] |
| 85 | 85 | : 1; |
| 86 | 86 | |
| 87 | - foreach($caps['production'] as $resource_id => &$resource_data) { |
|
| 88 | - if($caps['efficiency'] != 1) { |
|
| 89 | - foreach($resource_data as $unit_id => &$resource_production) { |
|
| 90 | - if(!($unit_id == STRUC_MINE_FUSION && $resource_id == RES_DEUTERIUM) && $unit_id != 0 && !($resource_id == RES_ENERGY && $resource_production >= 0)) { |
|
| 87 | + foreach ($caps['production'] as $resource_id => &$resource_data) { |
|
| 88 | + if ($caps['efficiency'] != 1) { |
|
| 89 | + foreach ($resource_data as $unit_id => &$resource_production) { |
|
| 90 | + if (!($unit_id == STRUC_MINE_FUSION && $resource_id == RES_DEUTERIUM) && $unit_id != 0 && !($resource_id == RES_ENERGY && $resource_production >= 0)) { |
|
| 91 | 91 | $resource_production = $resource_production * $caps['efficiency']; |
| 92 | 92 | } |
| 93 | 93 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | $caps['total'][$resource_id] = $caps['total'][$resource_id] >= 0 ? floor($caps['total'][$resource_id]) : ceil($caps['total'][$resource_id]); |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - foreach($caps['storage'] as $resource_id => &$resource_data) { |
|
| 99 | + foreach ($caps['storage'] as $resource_id => &$resource_data) { |
|
| 100 | 100 | $caps['total_storage'][$resource_id] = array_sum($resource_data); |
| 101 | 101 | } |
| 102 | 102 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if(!defined('INSIDE')) |
|
| 3 | +if (!defined('INSIDE')) |
|
| 4 | 4 | { |
| 5 | 5 | die('Hack attempt!'); |
| 6 | 6 | } |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | 'shield' => 10, |
| 39 | 39 | 'armor' => 400, |
| 40 | 40 | 'attack' => 5, |
| 41 | - 'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250, ), |
|
| 41 | + 'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250,), |
|
| 42 | 42 | ), |
| 43 | 43 | SHIP_CARGO_BIG => array( |
| 44 | 44 | 'name' => 'big_ship_cargo', |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | 'shield' => 25, |
| 59 | 59 | 'armor' => 1200, |
| 60 | 60 | 'attack' => 5, |
| 61 | - 'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250, ), |
|
| 61 | + 'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250,), |
|
| 62 | 62 | 'engine' => array( |
| 63 | 63 | array( |
| 64 | 64 | 'tech' => TECH_ENGINE_CHEMICAL, |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | 'shield' => 50, |
| 87 | 87 | 'armor' => 3000, |
| 88 | 88 | 'attack' => 10, |
| 89 | - 'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250, ), |
|
| 89 | + 'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250,), |
|
| 90 | 90 | 'engine' => array( |
| 91 | 91 | array( |
| 92 | 92 | 'tech' => TECH_ENGINE_ION, |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | 'shield' => 200, |
| 115 | 115 | 'armor' => 70000, |
| 116 | 116 | 'attack' => 50, |
| 117 | - 'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250, ), |
|
| 117 | + 'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250,), |
|
| 118 | 118 | 'engine' => array( |
| 119 | 119 | array( |
| 120 | 120 | 'tech' => TECH_ENGINE_HYPER, |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | 'shield' => 100, |
| 144 | 144 | 'armor' => 3000, |
| 145 | 145 | 'attack' => 50, |
| 146 | - 'amplify' => array(SHIP_SPY => 10.001, SHIP_SATTELITE_SOLAR => 21, ), |
|
| 146 | + 'amplify' => array(SHIP_SPY => 10.001, SHIP_SATTELITE_SOLAR => 21,), |
|
| 147 | 147 | 'engine' => array( |
| 148 | 148 | array( |
| 149 | 149 | 'tech' => TECH_ENGINE_ION, |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | 'shield' => 10, |
| 172 | 172 | 'armor' => 1600, |
| 173 | 173 | 'attack' => 1, |
| 174 | - 'amplify' => array(SHIP_SPY => 500.05, SHIP_SATTELITE_SOLAR => 1050, ), |
|
| 174 | + 'amplify' => array(SHIP_SPY => 500.05, SHIP_SATTELITE_SOLAR => 1050,), |
|
| 175 | 175 | 'engine' => array( |
| 176 | 176 | array( |
| 177 | 177 | 'tech' => TECH_ENGINE_CHEMICAL, |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | 'shield' => 0.01, |
| 200 | 200 | 'armor' => 100, |
| 201 | 201 | 'attack' => 0.01, |
| 202 | - 'amplify' => array( SHIP_SPY => 1,), |
|
| 202 | + 'amplify' => array(SHIP_SPY => 1,), |
|
| 203 | 203 | 'engine' => array( |
| 204 | 204 | array( |
| 205 | 205 | 'tech' => TECH_ENGINE_CHEMICAL, |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | 'factor' => 1, |
| 224 | 224 | ), |
| 225 | 225 | P_UNIT_PRODUCTION => array( |
| 226 | - RES_ENERGY => function($level, $production_factor, $user, $planet_row) {return ($planet_row["temp_max"] / 4 + 20) * $level * (0.1 * $production_factor);}, |
|
| 226 | + RES_ENERGY => function($level, $production_factor, $user, $planet_row) {return ($planet_row["temp_max"] / 4 + 20) * $level * (0.1 * $production_factor); }, |
|
| 227 | 227 | ), |
| 228 | 228 | P_MINING_IS_MANAGED => true, |
| 229 | 229 | |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | 'shield' => 10, |
| 233 | 233 | 'armor' => 200, |
| 234 | 234 | 'attack' => 1, |
| 235 | - 'amplify' => array(SHIP_SPY => 1, ), |
|
| 235 | + 'amplify' => array(SHIP_SPY => 1,), |
|
| 236 | 236 | 'engine' => array( |
| 237 | 237 | array( |
| 238 | 238 | 'tech' => TECH_ENGINE_CHEMICAL, |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | 'shield' => 10, |
| 265 | 265 | 'armor' => 400, |
| 266 | 266 | 'attack' => 50, |
| 267 | - 'amplify' => array(SHIP_CARGO_SMALL => 16.4, SHIP_SPY => 10.001, SHIP_SATTELITE_SOLAR => 21, ), |
|
| 267 | + 'amplify' => array(SHIP_CARGO_SMALL => 16.4, SHIP_SPY => 10.001, SHIP_SATTELITE_SOLAR => 21,), |
|
| 268 | 268 | 'engine' => array( |
| 269 | 269 | array( |
| 270 | 270 | 'tech' => TECH_ENGINE_CHEMICAL, |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | 'shield' => 25, |
| 294 | 294 | 'armor' => 1000, |
| 295 | 295 | 'attack' => 150, |
| 296 | - 'amplify' => array(SHIP_CARGO_SMALL => 8.2, SHIP_SPY => 3.33367, SHIP_SATTELITE_SOLAR => 7, ), |
|
| 296 | + 'amplify' => array(SHIP_CARGO_SMALL => 8.2, SHIP_SPY => 3.33367, SHIP_SATTELITE_SOLAR => 7,), |
|
| 297 | 297 | 'engine' => array( |
| 298 | 298 | array( |
| 299 | 299 | 'tech' => TECH_ENGINE_ION, |
@@ -352,7 +352,7 @@ discard block |
||
| 352 | 352 | 'shield' => 50, |
| 353 | 353 | 'armor' => 2700, |
| 354 | 354 | 'attack' => 400, |
| 355 | - 'amplify' => array(SHIP_SMALL_FIGHTER_LIGHT => 6.15, SHIP_SPY => 1.25013, SHIP_SATTELITE_SOLAR => 2.625, UNIT_DEF_TURRET_MISSILE => 5.5, ), |
|
| 355 | + 'amplify' => array(SHIP_SMALL_FIGHTER_LIGHT => 6.15, SHIP_SPY => 1.25013, SHIP_SATTELITE_SOLAR => 2.625, UNIT_DEF_TURRET_MISSILE => 5.5,), |
|
| 356 | 356 | 'engine' => array( |
| 357 | 357 | array( |
| 358 | 358 | 'tech' => TECH_ENGINE_ION, |
@@ -411,7 +411,7 @@ discard block |
||
| 411 | 411 | 'shield' => 200, |
| 412 | 412 | 'armor' => 6000, |
| 413 | 413 | 'attack' => 1000, |
| 414 | - 'amplify' => array(SHIP_SPY => 0.50005, SHIP_SATTELITE_SOLAR => 1.05, UNIT_DEF_TURRET_MISSILE => 1.76, ), |
|
| 414 | + 'amplify' => array(SHIP_SPY => 0.50005, SHIP_SATTELITE_SOLAR => 1.05, UNIT_DEF_TURRET_MISSILE => 1.76,), |
|
| 415 | 415 | 'engine' => array( |
| 416 | 416 | array( |
| 417 | 417 | 'tech' => TECH_ENGINE_HYPER, |
@@ -507,7 +507,7 @@ discard block |
||
| 507 | 507 | 'shield' => 500, |
| 508 | 508 | 'armor' => 11000, |
| 509 | 509 | 'attack' => 2000, |
| 510 | - 'amplify' => array(SHIP_SPY => 0.25003, SHIP_SATTELITE_SOLAR => 0.525, SHIP_LARGE_BATTLESHIP => 7.4, UNIT_DEF_TURRET_LASER_SMALL => 1.125, ), |
|
| 510 | + 'amplify' => array(SHIP_SPY => 0.25003, SHIP_SATTELITE_SOLAR => 0.525, SHIP_LARGE_BATTLESHIP => 7.4, UNIT_DEF_TURRET_LASER_SMALL => 1.125,), |
|
| 511 | 511 | 'engine' => array( |
| 512 | 512 | array( |
| 513 | 513 | 'tech' => TECH_ENGINE_HYPER, |
@@ -611,7 +611,7 @@ discard block |
||
| 611 | 611 | 'shield' => 20, |
| 612 | 612 | 'armor' => 200, |
| 613 | 613 | 'attack' => 80, |
| 614 | - 'amplify' => array(SHIP_SPY => 7, ), |
|
| 614 | + 'amplify' => array(SHIP_SPY => 7,), |
|
| 615 | 615 | ), |
| 616 | 616 | UNIT_DEF_TURRET_LASER_SMALL => array( |
| 617 | 617 | 'name' => 'small_laser', |
@@ -629,7 +629,7 @@ discard block |
||
| 629 | 629 | 'shield' => 25, |
| 630 | 630 | 'armor' => 200, |
| 631 | 631 | 'attack' => 100, |
| 632 | - 'amplify' => array(SHIP_SPY => 5, ), |
|
| 632 | + 'amplify' => array(SHIP_SPY => 5,), |
|
| 633 | 633 | ), |
| 634 | 634 | UNIT_DEF_TURRET_LASER_BIG => array( |
| 635 | 635 | 'name' => 'big_laser', |
@@ -647,7 +647,7 @@ discard block |
||
| 647 | 647 | 'shield' => 100, |
| 648 | 648 | 'armor' => 800, |
| 649 | 649 | 'attack' => 250, |
| 650 | - 'amplify' => array(SHIP_SPY => 2, ), |
|
| 650 | + 'amplify' => array(SHIP_SPY => 2,), |
|
| 651 | 651 | ), |
| 652 | 652 | UNIT_DEF_TURRET_GAUSS => array( |
| 653 | 653 | 'name' => 'gauss_canyon', |
@@ -665,7 +665,7 @@ discard block |
||
| 665 | 665 | 'armor' => 3500, |
| 666 | 666 | 'shield' => 200, |
| 667 | 667 | 'attack' => 1100, |
| 668 | - 'amplify' => array(SHIP_SPY => 0.5, ), |
|
| 668 | + 'amplify' => array(SHIP_SPY => 0.5,), |
|
| 669 | 669 | ), |
| 670 | 670 | UNIT_DEF_TURRET_ION => array( |
| 671 | 671 | 'name' => 'ionic_canyon', |
@@ -683,7 +683,7 @@ discard block |
||
| 683 | 683 | 'shield' => 500, |
| 684 | 684 | 'armor' => 800, |
| 685 | 685 | 'attack' => 150, |
| 686 | - 'amplify' => array(SHIP_SPY => 3.3, ), |
|
| 686 | + 'amplify' => array(SHIP_SPY => 3.3,), |
|
| 687 | 687 | ), |
| 688 | 688 | UNIT_DEF_TURRET_PLASMA => array( |
| 689 | 689 | 'name' => 'buster_canyon', |
@@ -701,7 +701,7 @@ discard block |
||
| 701 | 701 | 'shield' => 300, |
| 702 | 702 | 'armor' => 10000, |
| 703 | 703 | 'attack' => 3000, |
| 704 | - 'amplify' => array(SHIP_SPY => 0.17, ), |
|
| 704 | + 'amplify' => array(SHIP_SPY => 0.17,), |
|
| 705 | 705 | ), |
| 706 | 706 | |
| 707 | 707 | UNIT_DEF_SHIELD_SMALL => array( |
@@ -721,7 +721,7 @@ discard block |
||
| 721 | 721 | 'shield' => 2000, |
| 722 | 722 | 'armor' => 2000, |
| 723 | 723 | 'attack' => 1, |
| 724 | - 'amplify' => array(SHIP_SPY => 500, ), |
|
| 724 | + 'amplify' => array(SHIP_SPY => 500,), |
|
| 725 | 725 | ), |
| 726 | 726 | UNIT_DEF_SHIELD_BIG => array( |
| 727 | 727 | 'name' => 'big_protection_shield', |
@@ -740,7 +740,7 @@ discard block |
||
| 740 | 740 | 'shield' => 2000, |
| 741 | 741 | 'armor' => 10000, |
| 742 | 742 | 'attack' => 1, |
| 743 | - 'amplify' => array(SHIP_SPY => 500, ), |
|
| 743 | + 'amplify' => array(SHIP_SPY => 500,), |
|
| 744 | 744 | ), |
| 745 | 745 | UNIT_DEF_SHIELD_PLANET => array( |
| 746 | 746 | 'name' => 'planet_protector', |
@@ -7,8 +7,8 @@ |
||
| 7 | 7 | * |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -define('INSIDE' , true); |
|
| 11 | -define('INSTALL' , false); |
|
| 10 | +define('INSIDE', true); |
|
| 11 | +define('INSTALL', false); |
|
| 12 | 12 | |
| 13 | 13 | require('common.' . substr(strrchr(__FILE__, '.'), 1)); |
| 14 | 14 | |
@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
| 4 | 4 | |
| 5 | -if(sys_get_param_int('BE_DEBUG') && !defined('BE_DEBUG')) |
|
| 5 | +if (sys_get_param_int('BE_DEBUG') && !defined('BE_DEBUG')) |
|
| 6 | 6 | { |
| 7 | 7 | define('BE_DEBUG', true); |
| 8 | 8 | } |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | $sym_defender = $_POST['defender'] ? $_POST['defender'] : array(); |
| 16 | 16 | $sym_attacker = $_POST['attacker'] ? $_POST['attacker'] : array(); |
| 17 | 17 | |
| 18 | -if($replay) |
|
| 18 | +if ($replay) |
|
| 19 | 19 | { |
| 20 | 20 | $unpacked = sn_ube_simulator_decode_replay($replay); |
| 21 | 21 | |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | $sym_attacker = array(1 => $sym_attacker); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | -if($_POST['submit'] || $execute) |
|
| 31 | +if ($_POST['submit'] || $execute) |
|
| 32 | 32 | { |
| 33 | 33 | $replay = sn_ube_simulator_encode_replay($sym_defender, 'D'); |
| 34 | 34 | $replay .= sn_ube_simulator_encode_replay($sym_attacker, 'A'); |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | // sn_ube_report_save($combat_data); |
| 43 | 43 | // } |
| 44 | 44 | |
| 45 | - if(sys_get_param_str('reload')) |
|
| 45 | + if (sys_get_param_str('reload')) |
|
| 46 | 46 | { |
| 47 | 47 | $combat_data = sn_ube_report_load($combat_data[UBE_REPORT_CYPHER]); |
| 48 | 48 | } |
@@ -62,9 +62,9 @@ discard block |
||
| 62 | 62 | $template = gettemplate('simulator', true); |
| 63 | 63 | $techs_and_officers = array(TECH_WEAPON, TECH_SHIELD, TECH_ARMOR, MRC_ADMIRAL); |
| 64 | 64 | |
| 65 | - foreach($techs_and_officers as $tech_id) |
|
| 65 | + foreach ($techs_and_officers as $tech_id) |
|
| 66 | 66 | { |
| 67 | - if(!$sym_attacker[1][$tech_id]) |
|
| 67 | + if (!$sym_attacker[1][$tech_id]) |
|
| 68 | 68 | { |
| 69 | 69 | $sym_attacker[1][$tech_id] = mrc_get_level($user, false, $tech_id); |
| 70 | 70 | } |
@@ -78,14 +78,14 @@ discard block |
||
| 78 | 78 | UNIT_GOVERNORS => array(MRC_FORTIFIER), |
| 79 | 79 | UNIT_DEFENCE => sn_get_groups('defense_active'), |
| 80 | 80 | ); |
| 81 | - foreach($show_groups as $unit_group_id => $unit_group) |
|
| 81 | + foreach ($show_groups as $unit_group_id => $unit_group) |
|
| 82 | 82 | { |
| 83 | 83 | $template->assign_block_vars('simulator', array( |
| 84 | 84 | 'GROUP' => $unit_group_id, |
| 85 | 85 | 'NAME' => $lang['tech'][$unit_group_id], |
| 86 | 86 | )); |
| 87 | 87 | |
| 88 | - foreach($unit_group as $unit_id) |
|
| 88 | + foreach ($unit_group as $unit_id) |
|
| 89 | 89 | { |
| 90 | 90 | $tab++; |
| 91 | 91 | |