@@ -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; |
@@ -15,12 +15,12 @@ discard block |
||
15 | 15 | $fleet_row = &$mission_data['fleet']; |
16 | 16 | $destination_planet = &$mission_data['dst_planet']; |
17 | 17 | |
18 | - if(!$fleet_row) |
|
18 | + if (!$fleet_row) |
|
19 | 19 | { |
20 | 20 | return CACHE_NOTHING; |
21 | 21 | } |
22 | 22 | |
23 | - if(!isset($destination_planet['id'])) |
|
23 | + if (!isset($destination_planet['id'])) |
|
24 | 24 | { |
25 | 25 | // doquery("UPDATE {{fleets}} SET `fleet_mess` = 1 WHERE `fleet_id` = {$fleet_row['fleet_id']} LIMIT 1;"); |
26 | 26 | DbFleetStatic::fleet_send_back($mission_data['fleet']); |
@@ -32,12 +32,12 @@ discard block |
||
32 | 32 | $RecyclerCapacity = 0; |
33 | 33 | $OtherFleetCapacity = 0; |
34 | 34 | $fleet_array = sys_unit_str2arr($fleet_row['fleet_array']); |
35 | - foreach($fleet_array as $unit_id => $unit_count) |
|
35 | + foreach ($fleet_array as $unit_id => $unit_count) |
|
36 | 36 | { |
37 | - if(in_array($unit_id, sn_get_groups('fleet'))) |
|
37 | + if (in_array($unit_id, sn_get_groups('fleet'))) |
|
38 | 38 | { |
39 | 39 | $capacity = get_unit_param($unit_id, P_CAPACITY) * $unit_count; |
40 | - if(in_array($unit_id, sn_get_groups('flt_recyclers'))) |
|
40 | + if (in_array($unit_id, sn_get_groups('flt_recyclers'))) |
|
41 | 41 | { |
42 | 42 | $RecyclerCapacity += $capacity; |
43 | 43 | } |
@@ -49,19 +49,19 @@ discard block |
||
49 | 49 | } |
50 | 50 | |
51 | 51 | $IncomingFleetGoods = $fleet_row["fleet_resource_metal"] + $fleet_row["fleet_resource_crystal"] + $fleet_row["fleet_resource_deuterium"]; |
52 | - if($IncomingFleetGoods > $OtherFleetCapacity) |
|
52 | + if ($IncomingFleetGoods > $OtherFleetCapacity) |
|
53 | 53 | { |
54 | 54 | $RecyclerCapacity -= ($IncomingFleetGoods - $OtherFleetCapacity); |
55 | 55 | } |
56 | 56 | |
57 | - if(($destination_planet["debris_metal"] + $destination_planet["debris_crystal"]) <= $RecyclerCapacity) |
|
57 | + if (($destination_planet["debris_metal"] + $destination_planet["debris_crystal"]) <= $RecyclerCapacity) |
|
58 | 58 | { |
59 | 59 | $RecycledGoods["metal"] = $destination_planet["debris_metal"]; |
60 | 60 | $RecycledGoods["crystal"] = $destination_planet["debris_crystal"]; |
61 | 61 | } |
62 | 62 | else |
63 | 63 | { |
64 | - if (($destination_planet["debris_metal"] > $RecyclerCapacity / 2) AND |
|
64 | + if (($destination_planet["debris_metal"] > $RecyclerCapacity / 2) AND |
|
65 | 65 | ($destination_planet["debris_crystal"] > $RecyclerCapacity / 2)) |
66 | 66 | { |
67 | 67 | $RecycledGoods["metal"] = $RecyclerCapacity / 2; |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | } |
96 | 96 | } |
97 | 97 | } |
98 | - $NewCargo['Metal'] = $fleet_row["fleet_resource_metal"] + $RecycledGoods["metal"]; |
|
98 | + $NewCargo['Metal'] = $fleet_row["fleet_resource_metal"] + $RecycledGoods["metal"]; |
|
99 | 99 | $NewCargo['Crystal'] = $fleet_row["fleet_resource_crystal"] + $RecycledGoods["crystal"]; |
100 | 100 | $NewCargo['Deuterium'] = $fleet_row["fleet_resource_deuterium"]; |
101 | 101 | |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | HelperString::numberFloorAndFormat($RecycledGoods["metal"]), $lang['Metal'], |
109 | 109 | HelperString::numberFloorAndFormat($RecycledGoods["crystal"]), $lang['Crystal'] |
110 | 110 | ); |
111 | - 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); |
|
111 | + 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); |
|
112 | 112 | |
113 | 113 | // $QryUpdateFleet = "UPDATE {{fleets}} SET `fleet_mess` = 1,`fleet_resource_metal` = '{$NewCargo['Metal']}',`fleet_resource_crystal` = '{$NewCargo['Crystal']}',`fleet_resource_deuterium` = '{$NewCargo['Deuterium']}' "; |
114 | 114 | // $QryUpdateFleet .= "WHERE `fleet_id` = '{$fleet_row['fleet_id']}' LIMIT 1;"; |
@@ -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 |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | $fleet_row = &$mission_data['fleet']; |
16 | 16 | $destination_planet = &$mission_data['dst_planet']; |
17 | 17 | |
18 | - if(!$destination_planet || !is_array($destination_planet) || $fleet_row['fleet_owner'] != $destination_planet['id_owner']) |
|
18 | + if (!$destination_planet || !is_array($destination_planet) || $fleet_row['fleet_owner'] != $destination_planet['id_owner']) |
|
19 | 19 | { |
20 | 20 | // doquery("UPDATE {{fleets}} SET `fleet_mess` = 1 WHERE `fleet_id` = {$fleet_row['fleet_id']} LIMIT 1;"); |
21 | 21 | DbFleetStatic::fleet_send_back($mission_data['fleet']); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | $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, ''), |
29 | 29 | $fleet_row['fleet_resource_metal'], $lang['Metal'], $fleet_row['fleet_resource_crystal'], $lang['Crystal'], $fleet_row['fleet_resource_deuterium'], $lang['Deuterium']) . |
30 | 30 | '<br />' . $lang['sys_relocate_mess_user']; |
31 | - foreach(sys_unit_str2arr($fleet_row['fleet_array']) as $ship_id => $ship_count) |
|
31 | + foreach (sys_unit_str2arr($fleet_row['fleet_array']) as $ship_id => $ship_count) |
|
32 | 32 | { |
33 | 33 | $Message .= $lang['tech'][$ship_id] . ' - ' . $ship_count . '<br />'; |
34 | 34 | } |
@@ -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']; |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | $source_planet = &$mission_data['src_planet']; |
17 | 17 | $destination_planet = &$mission_data['dst_planet']; |
18 | 18 | |
19 | - if(!isset($destination_planet['id']) || !$destination_planet['id_owner']) |
|
19 | + if (!isset($destination_planet['id']) || !$destination_planet['id_owner']) |
|
20 | 20 | { |
21 | 21 | // doquery("UPDATE {{fleets}} SET `fleet_mess` = 1 WHERE `fleet_id` = {$fleet_row['fleet_id']} LIMIT 1;"); |
22 | 22 | DbFleetStatic::fleet_send_back($fleet_row); |
@@ -29,10 +29,10 @@ discard block |
||
29 | 29 | $destination_planet['name'], uni_render_coordinates_href($fleet_row, 'fleet_end_', 3, ''), |
30 | 30 | $fleet_row['fleet_resource_metal'], $lang['Metal'], |
31 | 31 | $fleet_row['fleet_resource_crystal'], $lang['Crystal'], |
32 | - $fleet_row['fleet_resource_deuterium'], $lang['Deuterium'] ); |
|
32 | + $fleet_row['fleet_resource_deuterium'], $lang['Deuterium']); |
|
33 | 33 | 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); |
34 | 34 | |
35 | - if($fleet_row['fleet_target_owner'] <> $fleet_row['fleet_owner']) |
|
35 | + if ($fleet_row['fleet_target_owner'] <> $fleet_row['fleet_owner']) |
|
36 | 36 | { |
37 | 37 | 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); |
38 | 38 | } |
@@ -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 | } |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | } |
102 | 102 | } |
103 | 103 | |
104 | - if(!isset($next)) { |
|
104 | + if (!isset($next)) { |
|
105 | 105 | $next = new TextEntity(); |
106 | 106 | } |
107 | 107 | |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | $prev = $this->getById($currentText->prev); |
120 | 120 | } |
121 | 121 | |
122 | - if(!isset($prev)) { |
|
122 | + if (!isset($prev)) { |
|
123 | 123 | $prev = new TextEntity(); |
124 | 124 | } |
125 | 125 |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | * @return string |
339 | 339 | */ |
340 | 340 | protected function stringValue($value) { |
341 | - return "'" . $this->escape((string)$value) . "'"; |
|
341 | + return "'" . $this->escape((string) $value) . "'"; |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | /** |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | * @return string |
350 | 350 | */ |
351 | 351 | public function quote($fieldName) { |
352 | - return "`" . $this->escape((string)$fieldName) . "`"; |
|
352 | + return "`" . $this->escape((string) $fieldName) . "`"; |
|
353 | 353 | } |
354 | 354 | |
355 | 355 | /** |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | * @return string |
397 | 397 | */ |
398 | 398 | protected function quoteTable($tableName) { |
399 | - return "`{{" . $this->escape((string)$tableName) . "}}`"; |
|
399 | + return "`{{" . $this->escape((string) $tableName) . "}}`"; |
|
400 | 400 | } |
401 | 401 | |
402 | 402 | /** |
@@ -43,7 +43,7 @@ |
||
43 | 43 | */ |
44 | 44 | public function toArray() { |
45 | 45 | $tutorial = array(); |
46 | - foreach($this->keys() as $key) { |
|
46 | + foreach ($this->keys() as $key) { |
|
47 | 47 | $tutorial[$key] = $this->$key; |
48 | 48 | } |
49 | 49 |
@@ -7,9 +7,9 @@ |
||
7 | 7 | * |
8 | 8 | */ |
9 | 9 | |
10 | -define('INSIDE' , true); |
|
11 | -define('INSTALL' , false); |
|
12 | -define('IN_ADMIN' , true); |
|
10 | +define('INSIDE', true); |
|
11 | +define('INSTALL', false); |
|
12 | +define('IN_ADMIN', true); |
|
13 | 13 | |
14 | 14 | require('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
15 | 15 |