@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | function flt_mission_hold(&$mission_data) |
4 | 4 | { |
5 | - if($mission_data['fleet']['fleet_end_stay'] < SN_TIME_NOW) |
|
5 | + if ($mission_data['fleet']['fleet_end_stay'] < SN_TIME_NOW) |
|
6 | 6 | { |
7 | 7 | fleet_send_back($mission_data['fleet']); |
8 | 8 | // doquery("UPDATE {{fleets}} SET `fleet_mess` = 1 WHERE `fleet_id` = '{$fleet_row['fleet_id']}' LIMIT 1;"); |
@@ -1,7 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -function flt_mission_hold(&$mission_data) |
|
4 | -{ |
|
3 | +function flt_mission_hold(&$mission_data) { |
|
5 | 4 | if($mission_data['fleet']['fleet_end_stay'] < SN_TIME_NOW) |
6 | 5 | { |
7 | 6 | fleet_send_back($mission_data['fleet']); |
@@ -7,8 +7,7 @@ discard block |
||
7 | 7 | * @copyright 2008 By Chlorel for XNova |
8 | 8 | */ |
9 | 9 | |
10 | -function flt_mission_recycle(&$mission_data) |
|
11 | -{ |
|
10 | +function flt_mission_recycle(&$mission_data) { |
|
12 | 11 | $fleet_row = &$mission_data['fleet']; |
13 | 12 | $destination_planet = &$mission_data['dst_planet']; |
14 | 13 | |
@@ -37,8 +36,7 @@ discard block |
||
37 | 36 | if(in_array($unit_id, sn_get_groups('flt_recyclers'))) |
38 | 37 | { |
39 | 38 | $RecyclerCapacity += $capacity; |
40 | - } |
|
41 | - else |
|
39 | + } else |
|
42 | 40 | { |
43 | 41 | $OtherFleetCapacity += $capacity; |
44 | 42 | } |
@@ -55,16 +53,14 @@ discard block |
||
55 | 53 | { |
56 | 54 | $RecycledGoods["metal"] = $destination_planet["debris_metal"]; |
57 | 55 | $RecycledGoods["crystal"] = $destination_planet["debris_crystal"]; |
58 | - } |
|
59 | - else |
|
56 | + } else |
|
60 | 57 | { |
61 | 58 | if (($destination_planet["debris_metal"] > $RecyclerCapacity / 2) AND |
62 | 59 | ($destination_planet["debris_crystal"] > $RecyclerCapacity / 2)) |
63 | 60 | { |
64 | 61 | $RecycledGoods["metal"] = $RecyclerCapacity / 2; |
65 | 62 | $RecycledGoods["crystal"] = $RecyclerCapacity / 2; |
66 | - } |
|
67 | - else |
|
63 | + } else |
|
68 | 64 | { |
69 | 65 | if ($destination_planet["debris_metal"] > $destination_planet["debris_crystal"]) |
70 | 66 | { |
@@ -72,20 +68,17 @@ discard block |
||
72 | 68 | if ($destination_planet["debris_metal"] > ($RecyclerCapacity - $RecycledGoods["crystal"])) |
73 | 69 | { |
74 | 70 | $RecycledGoods["metal"] = $RecyclerCapacity - $RecycledGoods["crystal"]; |
75 | - } |
|
76 | - else |
|
71 | + } else |
|
77 | 72 | { |
78 | 73 | $RecycledGoods["metal"] = $destination_planet["debris_metal"]; |
79 | 74 | } |
80 | - } |
|
81 | - else |
|
75 | + } else |
|
82 | 76 | { |
83 | 77 | $RecycledGoods["metal"] = $destination_planet["debris_metal"]; |
84 | 78 | if ($destination_planet["debris_crystal"] > ($RecyclerCapacity - $RecycledGoods["metal"])) |
85 | 79 | { |
86 | 80 | $RecycledGoods["crystal"] = $RecyclerCapacity - $RecycledGoods["metal"]; |
87 | - } |
|
88 | - else |
|
81 | + } else |
|
89 | 82 | { |
90 | 83 | $RecycledGoods["crystal"] = $destination_planet["debris_crystal"]; |
91 | 84 | } |
@@ -58,7 +58,7 @@ |
||
58 | 58 | } |
59 | 59 | else |
60 | 60 | { |
61 | - if (($destination_planet["debris_metal"] > $RecyclerCapacity / 2) AND |
|
61 | + if (($destination_planet["debris_metal"] > $RecyclerCapacity / 2) and |
|
62 | 62 | ($destination_planet["debris_crystal"] > $RecyclerCapacity / 2)) |
63 | 63 | { |
64 | 64 | $RecycledGoods["metal"] = $RecyclerCapacity / 2; |
@@ -12,12 +12,12 @@ discard block |
||
12 | 12 | $fleet_row = &$mission_data['fleet']; |
13 | 13 | $destination_planet = &$mission_data['dst_planet']; |
14 | 14 | |
15 | - if(!$fleet_row) |
|
15 | + if (!$fleet_row) |
|
16 | 16 | { |
17 | 17 | return CACHE_NOTHING; |
18 | 18 | } |
19 | 19 | |
20 | - if(!isset($destination_planet['id'])) |
|
20 | + if (!isset($destination_planet['id'])) |
|
21 | 21 | { |
22 | 22 | // doquery("UPDATE {{fleets}} SET `fleet_mess` = 1 WHERE `fleet_id` = {$fleet_row['fleet_id']} LIMIT 1;"); |
23 | 23 | fleet_send_back($mission_data['fleet']); |
@@ -29,12 +29,12 @@ discard block |
||
29 | 29 | $RecyclerCapacity = 0; |
30 | 30 | $OtherFleetCapacity = 0; |
31 | 31 | $fleet_array = sys_unit_str2arr($fleet_row['fleet_array']); |
32 | - foreach($fleet_array as $unit_id => $unit_count) |
|
32 | + foreach ($fleet_array as $unit_id => $unit_count) |
|
33 | 33 | { |
34 | - if(in_array($unit_id, sn_get_groups('fleet'))) |
|
34 | + if (in_array($unit_id, sn_get_groups('fleet'))) |
|
35 | 35 | { |
36 | 36 | $capacity = get_unit_param($unit_id, P_CAPACITY) * $unit_count; |
37 | - if(in_array($unit_id, sn_get_groups('flt_recyclers'))) |
|
37 | + if (in_array($unit_id, sn_get_groups('flt_recyclers'))) |
|
38 | 38 | { |
39 | 39 | $RecyclerCapacity += $capacity; |
40 | 40 | } |
@@ -46,19 +46,19 @@ discard block |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | $IncomingFleetGoods = $fleet_row["fleet_resource_metal"] + $fleet_row["fleet_resource_crystal"] + $fleet_row["fleet_resource_deuterium"]; |
49 | - if($IncomingFleetGoods > $OtherFleetCapacity) |
|
49 | + if ($IncomingFleetGoods > $OtherFleetCapacity) |
|
50 | 50 | { |
51 | 51 | $RecyclerCapacity -= ($IncomingFleetGoods - $OtherFleetCapacity); |
52 | 52 | } |
53 | 53 | |
54 | - if(($destination_planet["debris_metal"] + $destination_planet["debris_crystal"]) <= $RecyclerCapacity) |
|
54 | + if (($destination_planet["debris_metal"] + $destination_planet["debris_crystal"]) <= $RecyclerCapacity) |
|
55 | 55 | { |
56 | 56 | $RecycledGoods["metal"] = $destination_planet["debris_metal"]; |
57 | 57 | $RecycledGoods["crystal"] = $destination_planet["debris_crystal"]; |
58 | 58 | } |
59 | 59 | else |
60 | 60 | { |
61 | - if (($destination_planet["debris_metal"] > $RecyclerCapacity / 2) AND |
|
61 | + if (($destination_planet["debris_metal"] > $RecyclerCapacity / 2) AND |
|
62 | 62 | ($destination_planet["debris_crystal"] > $RecyclerCapacity / 2)) |
63 | 63 | { |
64 | 64 | $RecycledGoods["metal"] = $RecyclerCapacity / 2; |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | } |
93 | 93 | } |
94 | 94 | } |
95 | - $NewCargo['Metal'] = $fleet_row["fleet_resource_metal"] + $RecycledGoods["metal"]; |
|
95 | + $NewCargo['Metal'] = $fleet_row["fleet_resource_metal"] + $RecycledGoods["metal"]; |
|
96 | 96 | $NewCargo['Crystal'] = $fleet_row["fleet_resource_crystal"] + $RecycledGoods["crystal"]; |
97 | 97 | $NewCargo['Deuterium'] = $fleet_row["fleet_resource_deuterium"]; |
98 | 98 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | HelperString::numberFloorAndFormat($RecycledGoods["metal"]), $lang['Metal'], |
106 | 106 | HelperString::numberFloorAndFormat($RecycledGoods["crystal"]), $lang['Crystal'] |
107 | 107 | ); |
108 | - msg_send_simple_message ( $fleet_row['fleet_owner'], '', $fleet_row['fleet_start_time'], MSG_TYPE_RECYCLE, $lang['sys_mess_spy_control'], $lang['sys_recy_report'], $Message); |
|
108 | + msg_send_simple_message($fleet_row['fleet_owner'], '', $fleet_row['fleet_start_time'], MSG_TYPE_RECYCLE, $lang['sys_mess_spy_control'], $lang['sys_recy_report'], $Message); |
|
109 | 109 | |
110 | 110 | // $QryUpdateFleet = "UPDATE {{fleets}} SET `fleet_mess` = 1,`fleet_resource_metal` = '{$NewCargo['Metal']}',`fleet_resource_crystal` = '{$NewCargo['Crystal']}',`fleet_resource_deuterium` = '{$NewCargo['Deuterium']}' "; |
111 | 111 | // $QryUpdateFleet .= "WHERE `fleet_id` = '{$fleet_row['fleet_id']}' LIMIT 1;"; |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | $fleet_row = &$mission_data['fleet']; |
14 | 14 | $destination_planet = &$mission_data['dst_planet']; |
15 | 15 | |
16 | - if(!$destination_planet || !is_array($destination_planet) || $fleet_row['fleet_owner'] != $destination_planet['id_owner']) |
|
16 | + if (!$destination_planet || !is_array($destination_planet) || $fleet_row['fleet_owner'] != $destination_planet['id_owner']) |
|
17 | 17 | { |
18 | 18 | // doquery("UPDATE {{fleets}} SET `fleet_mess` = 1 WHERE `fleet_id` = {$fleet_row['fleet_id']} LIMIT 1;"); |
19 | 19 | fleet_send_back($mission_data['fleet']); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | $mission_data['src_planet']['name'], uni_render_coordinates_href($fleet_row, 'fleet_start_', 3, ''), $destination_planet['name'], uni_render_coordinates_href($fleet_row, 'fleet_end_', 3, ''), |
27 | 27 | $fleet_row['fleet_resource_metal'], $lang['Metal'], $fleet_row['fleet_resource_crystal'], $lang['Crystal'], $fleet_row['fleet_resource_deuterium'], $lang['Deuterium']) . |
28 | 28 | '<br />' . $lang['sys_relocate_mess_user']; |
29 | - foreach(sys_unit_str2arr($fleet_row['fleet_array']) as $ship_id => $ship_count) |
|
29 | + foreach (sys_unit_str2arr($fleet_row['fleet_array']) as $ship_id => $ship_count) |
|
30 | 30 | { |
31 | 31 | $Message .= $lang['tech'][$ship_id] . ' - ' . $ship_count . '<br />'; |
32 | 32 | } |
@@ -8,8 +8,7 @@ |
||
8 | 8 | * @version 1.1 |
9 | 9 | * @copyright 2008 by Chlorel for XNova |
10 | 10 | */ |
11 | -function flt_mission_relocate($mission_data) |
|
12 | -{ |
|
11 | +function flt_mission_relocate($mission_data) { |
|
13 | 12 | $fleet_row = &$mission_data['fleet']; |
14 | 13 | $destination_planet = &$mission_data['dst_planet']; |
15 | 14 |
@@ -8,7 +8,7 @@ |
||
8 | 8 | function flt_mission_destroy($mission_data) { |
9 | 9 | $fleet_row = $mission_data['fleet']; |
10 | 10 | $destination_planet = $mission_data['dst_planet']; |
11 | - if(!$destination_planet || !is_array($destination_planet) || $destination_planet['planet_type'] != PT_MOON) { |
|
11 | + if (!$destination_planet || !is_array($destination_planet) || $destination_planet['planet_type'] != PT_MOON) { |
|
12 | 12 | fleet_send_back($fleet_row); |
13 | 13 | |
14 | 14 | return CACHE_FLEET; |
@@ -170,7 +170,7 @@ |
||
170 | 170 | |
171 | 171 | function upd_db_unit_by_location($user_id = 0, $location_type, $location_id, $unit_snid = 0, $for_update = false, $fields = '*') { |
172 | 172 | return db_fetch(upd_do_query( |
173 | - "SELECT {$fields} |
|
173 | + "select {$fields} |
|
174 | 174 | FROM {{unit}} |
175 | 175 | WHERE |
176 | 176 | `unit_location_type` = {$location_type} AND `unit_location_id` = {$location_id} AND " . DBStaticUnit::db_unit_time_restrictions() . |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | $source_planet = &$mission_data['src_planet']; |
15 | 15 | $destination_planet = &$mission_data['dst_planet']; |
16 | 16 | |
17 | - if(!isset($destination_planet['id']) || !$destination_planet['id_owner']) |
|
17 | + if (!isset($destination_planet['id']) || !$destination_planet['id_owner']) |
|
18 | 18 | { |
19 | 19 | // doquery("UPDATE {{fleets}} SET `fleet_mess` = 1 WHERE `fleet_id` = {$fleet_row['fleet_id']} LIMIT 1;"); |
20 | 20 | fleet_send_back($fleet_row); |
@@ -27,10 +27,10 @@ discard block |
||
27 | 27 | $destination_planet['name'], uni_render_coordinates_href($fleet_row, 'fleet_end_', 3, ''), |
28 | 28 | $fleet_row['fleet_resource_metal'], $lang['Metal'], |
29 | 29 | $fleet_row['fleet_resource_crystal'], $lang['Crystal'], |
30 | - $fleet_row['fleet_resource_deuterium'], $lang['Deuterium'] ); |
|
30 | + $fleet_row['fleet_resource_deuterium'], $lang['Deuterium']); |
|
31 | 31 | msg_send_simple_message($fleet_row['fleet_target_owner'], '', $fleet_row['fleet_start_time'], MSG_TYPE_TRANSPORT, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $Message); |
32 | 32 | |
33 | - if($fleet_row['fleet_target_owner'] <> $fleet_row['fleet_owner']) |
|
33 | + if ($fleet_row['fleet_target_owner'] <> $fleet_row['fleet_owner']) |
|
34 | 34 | { |
35 | 35 | msg_send_simple_message($fleet_row['fleet_owner'], '', $fleet_row['fleet_start_time'], MSG_TYPE_TRANSPORT, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $Message); |
36 | 36 | } |
@@ -8,8 +8,7 @@ |
||
8 | 8 | * @copyright 2008 By Chlorel for XNova |
9 | 9 | */ |
10 | 10 | |
11 | -function flt_mission_transport(&$mission_data) |
|
12 | -{ |
|
11 | +function flt_mission_transport(&$mission_data) { |
|
13 | 12 | $fleet_row = &$mission_data['fleet']; |
14 | 13 | $source_planet = &$mission_data['src_planet']; |
15 | 14 | $destination_planet = &$mission_data['dst_planet']; |
@@ -5,14 +5,14 @@ |
||
5 | 5 | */ |
6 | 6 | global $template; |
7 | 7 | |
8 | -if(isset($sn_page_name) || ($sn_page_name = isset($_GET['page']) ? trim(strip_tags($_GET['page'])) : '')) { |
|
8 | +if (isset($sn_page_name) || ($sn_page_name = isset($_GET['page']) ? trim(strip_tags($_GET['page'])) : '')) { |
|
9 | 9 | require_once('common.' . substr(strrchr(__FILE__, '.'), 1)); |
10 | - if($sn_page_name) { |
|
10 | + if ($sn_page_name) { |
|
11 | 11 | // Loading page-specific language files |
12 | 12 | |
13 | 13 | !empty($sn_mvc['model'][$sn_page_name]) and execute_hooks($sn_mvc['model'][$sn_page_name], $template, 'model', $sn_page_name); |
14 | 14 | !empty($sn_mvc['view'][$sn_page_name]) and execute_hooks($sn_mvc['view'][$sn_page_name], $template, 'view', $sn_page_name); |
15 | - if(!empty($template_result) && is_object($template)) { |
|
15 | + if (!empty($template_result) && is_object($template)) { |
|
16 | 16 | $template->assign_recursive($template_result); |
17 | 17 | } |
18 | 18 |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | |
22 | 22 | define('IN_AJAX', true); |
23 | 23 | |
24 | - if(!is_object($template)) { |
|
24 | + if (!is_object($template)) { |
|
25 | 25 | $template = gettemplate('_ajax', true); |
26 | 26 | } |
27 | 27 | |
@@ -37,16 +37,16 @@ discard block |
||
37 | 37 | |
38 | 38 | $mode = sys_get_param_str('mode'); |
39 | 39 | |
40 | - if(class_exists($className = 'Pages\\Page' . ucfirst($mode))) { |
|
40 | + if (class_exists($className = 'Pages\\Page' . ucfirst($mode))) { |
|
41 | 41 | /** |
42 | 42 | * @var \Pages\IPage $page |
43 | 43 | */ |
44 | 44 | $page = new $className(); |
45 | - if(method_exists($page, 'loadParams')) { |
|
45 | + if (method_exists($page, 'loadParams')) { |
|
46 | 46 | $page->loadParams(); |
47 | 47 | } |
48 | 48 | |
49 | - if(method_exists($page, $action = sys_get_param('action')) && $page->checkAction($action)) { |
|
49 | + if (method_exists($page, $action = sys_get_param('action')) && $page->checkAction($action)) { |
|
50 | 50 | $result = $page->$action(); |
51 | 51 | is_array($result) ? HelperArray::merge($template_result['AJAX'], $result) : false; |
52 | 52 | } |
@@ -31,7 +31,7 @@ |
||
31 | 31 | QUEST_STATUS_COMPLETE => '', |
32 | 32 | ); |
33 | 33 | |
34 | - if(!isset($statuses[$this->filterQuestStatus])) { |
|
34 | + if (!isset($statuses[$this->filterQuestStatus])) { |
|
35 | 35 | $this->filterQuestStatus = QUEST_STATUS_ALL; |
36 | 36 | } |
37 | 37 | } |