Completed
Push — work-fleets ( a1656f...ab0e6c )
by SuperNova.WS
09:07 queued 03:10
created
admin/settings.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -8,18 +8,18 @@  discard block
 block discarded – undo
8 8
  * @copyright 2008 by ??????? for XNova
9 9
  */
10 10
 
11
-define('INSIDE'  , true);
12
-define('INSTALL' , false);
11
+define('INSIDE', true);
12
+define('INSTALL', false);
13 13
 define('IN_ADMIN', true);
14 14
 require('../common.' . substr(strrchr(__FILE__, '.'), 1));
15 15
 
16
-if($user['authlevel'] < 3) {
16
+if ($user['authlevel'] < 3) {
17 17
   AdminMessage(classLocale::$lang['adm_err_denied']);
18 18
 }
19 19
 
20 20
 $template = gettemplate('admin/settings', true);
21 21
 
22
-if(sys_get_param('save')) {
22
+if (sys_get_param('save')) {
23 23
   classSupernova::$config->game_name               = sys_get_param_str_unsafe('game_name');
24 24
   classSupernova::$config->game_mode               = sys_get_param_int('game_mode');
25 25
   classSupernova::$config->game_speed              = sys_get_param_float('game_speed', 1);
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
   classSupernova::$config->url_faq                 = sys_get_param_str_unsafe('url_faq');
30 30
   classSupernova::$config->url_forum               = sys_get_param_str_unsafe('url_forum');
31 31
   classSupernova::$config->url_rules               = sys_get_param_str_unsafe('url_rules');
32
-  classSupernova::$config->url_purchase_metamatter         = sys_get_param_str_unsafe('url_purchase_metamatter');
32
+  classSupernova::$config->url_purchase_metamatter = sys_get_param_str_unsafe('url_purchase_metamatter');
33 33
   classSupernova::$config->game_disable            = sys_get_param_int('game_disable');
34 34
   classSupernova::$config->game_disable_reason     = sys_get_param_str_unsafe('game_disable_reason');
35 35
   classSupernova::$config->server_updater_check_auto = sys_get_param_int('server_updater_check_auto');
@@ -96,8 +96,8 @@  discard block
 block discarded – undo
96 96
   classSupernova::$config->stats_schedule          = sys_get_param_str('stats_schedule');
97 97
 
98 98
   classSupernova::$config->empire_mercenary_base_period = sys_get_param_int('empire_mercenary_base_period');
99
-  if(classSupernova::$config->empire_mercenary_temporary != sys_get_param_int('empire_mercenary_temporary')) {
100
-    if(classSupernova::$config->empire_mercenary_temporary) {
99
+  if (classSupernova::$config->empire_mercenary_temporary != sys_get_param_int('empire_mercenary_temporary')) {
100
+    if (classSupernova::$config->empire_mercenary_temporary) {
101 101
       db_unit_list_admin_delete_mercenaries_finished();
102 102
     } else {
103 103
       db_unit_list_admin_set_mercenaries_expire_time(classSupernova::$config->empire_mercenary_base_period);
@@ -138,21 +138,21 @@  discard block
 block discarded – undo
138 138
   'STATS_HIDE_PM_LINK' => classSupernova::$config->stats_hide_pm_link,
139 139
 ));
140 140
 
141
-foreach(classLocale::$lang['sys_game_disable_reason'] as $id => $name) {
141
+foreach (classLocale::$lang['sys_game_disable_reason'] as $id => $name) {
142 142
   $template->assign_block_vars('sys_game_disable_reason', array(
143 143
     'ID'   => $id,
144 144
     'NAME' => $name,
145 145
   ));
146 146
 }
147 147
 
148
-foreach(classLocale::$lang['sys_game_mode'] as $mode_id => $mode_name) {
148
+foreach (classLocale::$lang['sys_game_mode'] as $mode_id => $mode_name) {
149 149
   $template->assign_block_vars('game_modes', array(
150 150
     'ID'   => $mode_id,
151 151
     'NAME' => $mode_name,
152 152
   ));
153 153
 }
154 154
 
155
-foreach(classLocale::$lang['adm_opt_ver_response'] as $ver_id => $ver_response) {
155
+foreach (classLocale::$lang['adm_opt_ver_response'] as $ver_id => $ver_response) {
156 156
   $template->assign_block_vars('ver_response', array(
157 157
     'ID'   => $ver_id,
158 158
     'NAME' => js_safe_string($ver_response),
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 }
161 161
 
162 162
 $lang_list = lng_get_list();
163
-foreach($lang_list as $lang_id => $lang_data) {
163
+foreach ($lang_list as $lang_id => $lang_data) {
164 164
   $template->assign_block_vars('game_languages', array(
165 165
     'ID'   => $lang_id,
166 166
     'NAME' => "{$lang_data['LANG_NAME_NATIVE']} ({$lang_data['LANG_NAME_ENGLISH']})",
Please login to merge, or discard this patch.
ajax_version_check.php 2 patches
Switch Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -13,15 +13,15 @@
 block discarded – undo
13 13
   . '&id=' . urlencode(classSupernova::$config->server_updater_id);
14 14
 
15 15
 switch($mode) {
16
-  case SNC_MODE_REGISTER:
17
-    if(classSupernova::$config->server_updater_key || classSupernova::$config->server_updater_id) {
18
-      if($ajax) {
19
-        print(SNC_VER_REGISTER_ERROR_REGISTERED);
16
+    case SNC_MODE_REGISTER:
17
+      if(classSupernova::$config->server_updater_key || classSupernova::$config->server_updater_id) {
18
+        if($ajax) {
19
+          print(SNC_VER_REGISTER_ERROR_REGISTERED);
20
+        }
21
+        die();
20 22
       }
21
-      die();
22
-    }
23
-    $url .= "&name=" . urlencode(classSupernova::$config->game_name) . "&url=" . urlencode(SN_ROOT_VIRTUAL);
24
-  break;
23
+      $url .= "&name=" . urlencode(classSupernova::$config->game_name) . "&url=" . urlencode(SN_ROOT_VIRTUAL);
24
+    break;
25 25
 }
26 26
 
27 27
 $check_result = sn_get_url_contents($url);
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -12,10 +12,10 @@  discard block
 block discarded – undo
12 12
   . '&key=' . urlencode(classSupernova::$config->server_updater_key)
13 13
   . '&id=' . urlencode(classSupernova::$config->server_updater_id);
14 14
 
15
-switch($mode) {
15
+switch ($mode) {
16 16
   case SNC_MODE_REGISTER:
17
-    if(classSupernova::$config->server_updater_key || classSupernova::$config->server_updater_id) {
18
-      if($ajax) {
17
+    if (classSupernova::$config->server_updater_key || classSupernova::$config->server_updater_id) {
18
+      if ($ajax) {
19 19
         print(SNC_VER_REGISTER_ERROR_REGISTERED);
20 20
       }
21 21
       die();
@@ -25,18 +25,18 @@  discard block
 block discarded – undo
25 25
 }
26 26
 
27 27
 $check_result = sn_get_url_contents($url);
28
-if(!$check_result) {
28
+if (!$check_result) {
29 29
   $version_check = SNC_VER_ERROR_CONNECT;
30
-} elseif(($version_check = intval($check_result)) && $version_check == $check_result) {
30
+} elseif (($version_check = intval($check_result)) && $version_check == $check_result) {
31 31
   $version_check = $check_result;
32 32
 } else {
33 33
   // JSON decode if string
34 34
   $check_result = json_decode($check_result, true);
35 35
   $version_check = $check_result === null ? SNC_VER_UNKNOWN_RESPONSE : $check_result['version_check'];
36 36
 
37
-  switch($mode) {
37
+  switch ($mode) {
38 38
     case SNC_MODE_REGISTER:
39
-      if($check_result['site']['site_key'] && $check_result['site']['site_id'] && $check_result['site']['result'] == SNC_VER_REGISTER_REGISTERED) {
39
+      if ($check_result['site']['site_key'] && $check_result['site']['site_id'] && $check_result['site']['result'] == SNC_VER_REGISTER_REGISTERED) {
40 40
         classSupernova::$config->db_saveItem('server_updater_key', $check_result['site']['site_key']);
41 41
         classSupernova::$config->db_saveItem('server_updater_id', $check_result['site']['site_id']);
42 42
       }
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 classSupernova::$config->db_saveItem('server_updater_check_last', SN_TIME_NOW);
50 50
 classSupernova::$config->db_saveItem('server_updater_check_result', $version_check);
51 51
 
52
-if($ajax) {
52
+if ($ajax) {
53 53
   define('IN_AJAX', true);
54 54
   print($version_check);
55 55
 }
Please login to merge, or discard this patch.
admin/tools.php 2 patches
Switch Indentation   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -34,69 +34,69 @@
 block discarded – undo
34 34
 }
35 35
 
36 36
 switch($mode) {
37
-  case ADM_TOOL_CONFIG_RELOAD:
38
-    classSupernova::$config->db_loadAll();
39
-    sys_refresh_tablelist();
40
-
41
-    classSupernova::$config->db_loadItem('game_watchlist');
42
-    if(classSupernova::$config->game_watchlist) {
43
-      classSupernova::$config->game_watchlist_array = explode(';', classSupernova::$config->game_watchlist);
44
-    } else {
45
-      unset(classSupernova::$config->game_watchlist_array);
46
-    }
47
-  break;
48
-
49
-  case ADM_TOOL_MD5:
50
-    $template = gettemplate("admin/md5enc", true);
51
-    $password_seed = sys_get_param_str_unsafe('seed', SN_SYS_SEC_CHARS_ALLOWED);
52
-    $password_length = sys_get_param_int('length', 16);
53
-    $string = ($string = sys_get_param_str_unsafe('string')) ? $string : sys_random_string($password_length, $password_seed);
54
-
55
-    $template->assign_vars(array(
56
-      'SEED'   => $password_seed,
57
-      'LENGTH' => $password_length,
58
-      'STRING' => htmlentities($string),
59
-      'MD5'    => md5($string),
60
-    ));
61
-    display($template, classLocale::$lang['adm_tools_md5_header'], false, '', true);
62
-  break;
63
-
64
-  case ADM_TOOL_FORCE_ALL:
65
-    classSupernova::$config->db_saveItem('db_version', 0);
66
-    require_once('../includes/update.php');
67
-  break;
68
-
69
-  case ADM_TOOL_FORCE_LAST:
70
-    classSupernova::$config->db_saveItem('db_version', floor(classSupernova::$config->db_version - 1));
71
-    require_once('../includes/update.php');
72
-  break;
73
-
74
-  case ADM_TOOL_INFO_PHP:
75
-    phpinfo();
76
-  break;
77
-
78
-  case ADM_TOOL_INFO_SQL:
79
-    $template = gettemplate("simple_table", true);
80
-
81
-    $status = array(
82
-      classLocale::$lang['adm_tool_sql_server_version'] => classSupernova::$db->db_get_server_info(),
83
-      classLocale::$lang['adm_tool_sql_client_version'] => classSupernova::$db->db_get_client_info(),
84
-      classLocale::$lang['adm_tool_sql_host_info']      => classSupernova::$db->db_get_host_info(),
85
-    );
86
-    templateAssignTable($template, 'server', $status);
87
-
88
-    templateAssignTable($template, 'status', classSupernova::$db->db_get_server_stat());
89
-    templateAssignTable($template, 'params', classSupernova::$db->db_core_show_status());
90
-
91
-    $template->assign_vars(array(
92
-      'PAGE_HEADER'   => classLocale::$lang['adm_tool_sql_page_header'],
93
-      'COLUMN_NAME_1' => classLocale::$lang['adm_tool_sql_param_name'],
94
-      'COLUMN_NAME_2' => classLocale::$lang['adm_tool_sql_param_value'],
95
-      'TABLE_FOOTER'  => 'test',
96
-    ));
97
-
98
-    display($template, classLocale::$lang['adm_bn_ttle'], false, '', true);
99
-  break;
37
+    case ADM_TOOL_CONFIG_RELOAD:
38
+      classSupernova::$config->db_loadAll();
39
+      sys_refresh_tablelist();
40
+
41
+      classSupernova::$config->db_loadItem('game_watchlist');
42
+      if(classSupernova::$config->game_watchlist) {
43
+        classSupernova::$config->game_watchlist_array = explode(';', classSupernova::$config->game_watchlist);
44
+      } else {
45
+        unset(classSupernova::$config->game_watchlist_array);
46
+      }
47
+    break;
48
+
49
+    case ADM_TOOL_MD5:
50
+      $template = gettemplate("admin/md5enc", true);
51
+      $password_seed = sys_get_param_str_unsafe('seed', SN_SYS_SEC_CHARS_ALLOWED);
52
+      $password_length = sys_get_param_int('length', 16);
53
+      $string = ($string = sys_get_param_str_unsafe('string')) ? $string : sys_random_string($password_length, $password_seed);
54
+
55
+      $template->assign_vars(array(
56
+        'SEED'   => $password_seed,
57
+        'LENGTH' => $password_length,
58
+        'STRING' => htmlentities($string),
59
+        'MD5'    => md5($string),
60
+      ));
61
+      display($template, classLocale::$lang['adm_tools_md5_header'], false, '', true);
62
+    break;
63
+
64
+    case ADM_TOOL_FORCE_ALL:
65
+      classSupernova::$config->db_saveItem('db_version', 0);
66
+      require_once('../includes/update.php');
67
+    break;
68
+
69
+    case ADM_TOOL_FORCE_LAST:
70
+      classSupernova::$config->db_saveItem('db_version', floor(classSupernova::$config->db_version - 1));
71
+      require_once('../includes/update.php');
72
+    break;
73
+
74
+    case ADM_TOOL_INFO_PHP:
75
+      phpinfo();
76
+    break;
77
+
78
+    case ADM_TOOL_INFO_SQL:
79
+      $template = gettemplate("simple_table", true);
80
+
81
+      $status = array(
82
+        classLocale::$lang['adm_tool_sql_server_version'] => classSupernova::$db->db_get_server_info(),
83
+        classLocale::$lang['adm_tool_sql_client_version'] => classSupernova::$db->db_get_client_info(),
84
+        classLocale::$lang['adm_tool_sql_host_info']      => classSupernova::$db->db_get_host_info(),
85
+      );
86
+      templateAssignTable($template, 'server', $status);
87
+
88
+      templateAssignTable($template, 'status', classSupernova::$db->db_get_server_stat());
89
+      templateAssignTable($template, 'params', classSupernova::$db->db_core_show_status());
90
+
91
+      $template->assign_vars(array(
92
+        'PAGE_HEADER'   => classLocale::$lang['adm_tool_sql_page_header'],
93
+        'COLUMN_NAME_1' => classLocale::$lang['adm_tool_sql_param_name'],
94
+        'COLUMN_NAME_2' => classLocale::$lang['adm_tool_sql_param_value'],
95
+        'TABLE_FOOTER'  => 'test',
96
+      ));
97
+
98
+      display($template, classLocale::$lang['adm_bn_ttle'], false, '', true);
99
+    break;
100 100
 
101 101
 }
102 102
 
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 require('../common.' . substr(strrchr(__FILE__, '.'), 1));
13 13
 
14 14
 // if($user['authlevel'] < 1)
15
-if($user['authlevel'] < 3) {
15
+if ($user['authlevel'] < 3) {
16 16
   AdminMessage(classLocale::$lang['adm_err_denied']);
17 17
 }
18 18
 
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
  */
26 26
 function templateAssignTable($template, $str, $status) {
27 27
   $template->assign_block_vars('table', classLocale::$lang['adm_tool_sql_table'][$str]);
28
-  foreach($status as $key => $value) {
28
+  foreach ($status as $key => $value) {
29 29
     $template->assign_block_vars('table.row', array(
30 30
       'VALUE_1' => $key,
31 31
       'VALUE_2' => $value,
@@ -33,13 +33,13 @@  discard block
 block discarded – undo
33 33
   }
34 34
 }
35 35
 
36
-switch($mode) {
36
+switch ($mode) {
37 37
   case ADM_TOOL_CONFIG_RELOAD:
38 38
     classSupernova::$config->db_loadAll();
39 39
     sys_refresh_tablelist();
40 40
 
41 41
     classSupernova::$config->db_loadItem('game_watchlist');
42
-    if(classSupernova::$config->game_watchlist) {
42
+    if (classSupernova::$config->game_watchlist) {
43 43
       classSupernova::$config->game_watchlist_array = explode(';', classSupernova::$config->game_watchlist);
44 44
     } else {
45 45
       unset(classSupernova::$config->game_watchlist_array);
Please login to merge, or discard this patch.
includes/includes/flt_page5.inc 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 *
13 13
 **/
14 14
 
15
-if(SN_IN_FLEET !== true) {
15
+if (SN_IN_FLEET !== true) {
16 16
   $debug->error("Attempt to call FLEET page mode {$mode} directly - not from fleet.php", 'Forbidden', 403);
17 17
 }
18 18
 
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
   $planet_list = array();
27 27
 
28
-  if(is_array($resources_taken))
28
+  if (is_array($resources_taken))
29 29
   {
30 30
     $query = implode(',', array_keys($resources_taken));
31 31
     $query = " AND `destruyed` = 0 AND `id` IN ({$query})";
@@ -33,16 +33,16 @@  discard block
 block discarded – undo
33 33
     $query = '';
34 34
   }
35 35
 
36
-  foreach(sn_get_groups('flt_transports') as $transport_id) {
36
+  foreach (sn_get_groups('flt_transports') as $transport_id) {
37 37
     $transports[$transport_id] = get_unit_param($transport_id, P_CAPACITY);
38 38
   }
39 39
   arsort($transports);
40 40
 
41 41
   $planets_db_list = db_planet_list_sorted($user, $planetrow['id'], '*', $query);
42 42
   !is_array($planets_db_list) ? $planets_db_list = array() : false;
43
-  foreach($planets_db_list as $planet_db_data) {
43
+  foreach ($planets_db_list as $planet_db_data) {
44 44
   // begin planet loop
45
-    if(!$query) {
45
+    if (!$query) {
46 46
       $resources_taken[$planet_db_data['id']] = 1;
47 47
     }
48 48
     sn_db_transaction_start();
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
     $planet_id = $planet_db_data['id'];
55 55
 
56 56
     $planet_resources = 0;
57
-    foreach(sn_get_groups('resources_loot') as $resource_id) {
58
-      if($resources_taken[$planet_id] == 1 || $resources_taken[$planet_id][$resource_id]) {
57
+    foreach (sn_get_groups('resources_loot') as $resource_id) {
58
+      if ($resources_taken[$planet_id] == 1 || $resources_taken[$planet_id][$resource_id]) {
59 59
         $planet_resources += floor(mrc_get_level($user, $planet_db_data, $resource_id, true, true)); // $planet_db_data[get_unit_param($resource_id, P_NAME)]);
60 60
       }
61 61
     }
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
     $fleet_capacity = 0;
87 87
     $ship_loadout = array();
88 88
     $fleet = array();
89
-    foreach($transports as $ship_id => $ship_capacity) {
90
-      if($ship_count = mrc_get_level($user, $planet_db_data, $ship_id, true, true)) {
89
+    foreach ($transports as $ship_id => $ship_capacity) {
90
+      if ($ship_count = mrc_get_level($user, $planet_db_data, $ship_id, true, true)) {
91 91
         $ship_loadout[$ship_id]['capacity'] = $ship_count * $ship_capacity;
92 92
         $ship_loadout[$ship_id]['taken'] = 0;
93 93
         $fleet_capacity += $ship_loadout[$ship_id]['capacity'];
@@ -98,9 +98,9 @@  discard block
 block discarded – undo
98 98
 
99 99
     $will_take = min($planet_resources, $fleet_capacity);
100 100
 
101
-    foreach($ship_loadout as $ship_id => &$planet_ship) {
101
+    foreach ($ship_loadout as $ship_id => &$planet_ship) {
102 102
       $can_take = min($will_take, $planet_ship['capacity']);
103
-      if($can_take <= 0) {
103
+      if ($can_take <= 0) {
104 104
         continue;
105 105
       }
106 106
       $planet_ship['capacity'] -= $can_take;
@@ -108,23 +108,23 @@  discard block
 block discarded – undo
108 108
       $fleet[$ship_id] = ceil($planet_ship['taken'] / $transports[$ship_id]);
109 109
 
110 110
       $will_take -= $can_take;
111
-      if($will_take <= 0) {
111
+      if ($will_take <= 0) {
112 112
         break;
113 113
       }
114 114
     }
115 115
 
116
-    if(!empty($fleet)) {
116
+    if (!empty($fleet)) {
117 117
       $travel_data = flt_travel_data($user, $planetrow, $planet_db_data, $fleet, 10);
118 118
       $planet_data['FLEET_SPEED'] = $travel_data['fleet_speed'];
119 119
       $planet_data['DISTANCE']    = $travel_data['distance'];
120 120
       $planet_data['DURATION']    = $travel_data['duration'];
121 121
       $planet_data['CONSUMPTION'] = $travel_data['consumption'];
122 122
 
123
-      if(floor(mrc_get_level($user, $planet_db_data, RES_DEUTERIUM, true)) >= $planet_data['CONSUMPTION']) {
123
+      if (floor(mrc_get_level($user, $planet_db_data, RES_DEUTERIUM, true)) >= $planet_data['CONSUMPTION']) {
124 124
         $will_take = min($planet_resources, $fleet_capacity) - $planet_data['CONSUMPTION'];
125 125
 
126
-        foreach(sn_get_groups('resources_loot') as $resource_id) {
127
-          if($resources_taken[$planet_id] != 1 && !$resources_taken[$planet_id][$resource_id]) {
126
+        foreach (sn_get_groups('resources_loot') as $resource_id) {
127
+          if ($resources_taken[$planet_id] != 1 && !$resources_taken[$planet_id][$resource_id]) {
128 128
             continue;
129 129
           }
130 130
 
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
           $fleet[$resource_id] = min($will_take, $resource_amount);
134 134
           $will_take -= $resource_amount;
135 135
 
136
-          if($will_take <= 0) {
136
+          if ($will_take <= 0) {
137 137
             break;
138 138
           }
139 139
         }
@@ -157,19 +157,19 @@  discard block
 block discarded – undo
157 157
 
158 158
 $resources_taken = sys_get_param('resources');
159 159
 
160
-if(!empty($resources_taken))  { // begin processing parameters
160
+if (!empty($resources_taken)) { // begin processing parameters
161 161
   $planet_list = flt_build_gathering($resources_taken);
162 162
 
163
-  foreach($planet_list as $planet_id => $planet_data) {
164
-    if($planet_data['RESULT'] == FLIGHT_ALLOWED) {
163
+  foreach ($planet_list as $planet_id => $planet_data) {
164
+    if ($planet_data['RESULT'] == FLIGHT_ALLOWED) {
165 165
       $planet_data['RESULT'] = flt_t_send_fleet($user, $planet_data['PLANET_DB_DATA'], $planetrow, $planet_data['FLEET'], MT_TRANSPORT);
166 166
     }
167 167
 
168 168
     $planet_data['MESSAGE'] = classLocale::$lang['fl_attack_error'][$planet_data['RESULT']];
169 169
 
170 170
     $template->assign_block_vars('results', $planet_data);
171
-    if(!empty($planet_data['FLEET']) && $planet_data['RESULT'] == FLIGHT_ALLOWED) {
172
-      foreach($planet_data['FLEET'] as $unit_id => $amount) {
171
+    if (!empty($planet_data['FLEET']) && $planet_data['RESULT'] == FLIGHT_ALLOWED) {
172
+      foreach ($planet_data['FLEET'] as $unit_id => $amount) {
173 173
         $template->assign_block_vars('results.units', array(
174 174
           'ID'     => $unit_id,
175 175
           'NAME'   => classLocale::$lang['tech'][$unit_id],
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 
183 183
 // Building list of own planets & moons
184 184
 $planet_list = flt_build_gathering();
185
-foreach($planet_list as $planet_data) {
185
+foreach ($planet_list as $planet_data) {
186 186
   $planet_data['DURATION'] = $planet_data['DURATION'] ? pretty_time($planet_data['DURATION']) : classLocale::$lang['flt_no_fuel'];
187 187
   $template->assign_block_vars('colonies', $planet_data);
188 188
 }
Please login to merge, or discard this patch.
fleet.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,9 +7,9 @@  discard block
 block discarded – undo
7 7
 
8 8
 // TODO - Переместить это куда-нибудь
9 9
 $fleet_page = sys_get_param_int('fleet_page', sys_get_param_int('mode'));
10
-if($fleet_ship_sort = sys_get_param_id('sort_elements') && $fleet_page == 0) {
10
+if ($fleet_ship_sort = sys_get_param_id('sort_elements') && $fleet_page == 0) {
11 11
   define('IN_AJAX', true);
12
-  if(!empty(classLocale::$lang['player_option_fleet_ship_sort'][$fleet_ship_sort])) {
12
+  if (!empty(classLocale::$lang['player_option_fleet_ship_sort'][$fleet_ship_sort])) {
13 13
     // player_save_option($user, PLAYER_OPTION_FLEET_SHIP_SORT, $fleet_ship_sort);
14 14
     // player_save_option($user, PLAYER_OPTION_FLEET_SHIP_SORT_INVERSE, sys_get_param_id('fleet_ship_sort_inverse', 0));
15 15
     classSupernova::$user_options[PLAYER_OPTION_FLEET_SHIP_SORT] = $fleet_ship_sort;
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 $objFleet5->initDefaults($user, $planetrow, $targetVector, $target_mission, $ships, $fleet_group_mr, $speed_percent);
43 43
 
44 44
 
45
-switch($fleet_page) {
45
+switch ($fleet_page) {
46 46
   case 1:
47 47
     $objFleet5->fleetPage1();
48 48
   break;
Please login to merge, or discard this patch.
includes/includes/ube_zi_helpers.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,9 +27,9 @@  discard block
 block discarded – undo
27 27
   print($round);
28 28
   print('<table border=1>');
29 29
   print('<tr align="left">');
30
-  foreach($header as $key => $value)
30
+  foreach ($header as $key => $value)
31 31
   {
32
-    if(is_array($value))
32
+    if (is_array($value))
33 33
     {
34 34
       continue;
35 35
     }
@@ -61,9 +61,9 @@  discard block
 block discarded – undo
61 61
   );
62 62
 
63 63
   print('<tr align="right">');
64
-  foreach($unit_crossfire_result as $key => $value)
64
+  foreach ($unit_crossfire_result as $key => $value)
65 65
   {
66
-    if(is_array($value))
66
+    if (is_array($value))
67 67
     {
68 68
       continue;
69 69
     }
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,7 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-function sn_ube_combat_helper_round_header($round)
4
-{
3
+function sn_ube_combat_helper_round_header($round) {
5 4
   $header = array(
6 5
     'ИД1',
7 6
     'ИД2',
@@ -40,13 +39,11 @@  discard block
 block discarded – undo
40 39
   print('</tr>');
41 40
 }
42 41
 
43
-function sn_ube_combat_helper_round_footer($round = 0)
44
-{
42
+function sn_ube_combat_helper_round_footer($round = 0) {
45 43
   print('</table>');
46 44
 }
47 45
 
48
-function sn_ube_combat_helper_round_row(&$unit_crossfire_result)
49
-{
46
+function sn_ube_combat_helper_round_row(&$unit_crossfire_result) {
50 47
   $SN = array(
51 48
     SHIP_CARGO_SMALL => 'МаТр', SHIP_CARGO_BIG => 'БоТр', SHIP_CARGO_SUPER => 'СуТр', SHIP_CARGO_HYPER => 'ГпТр',
52 49
     SHIP_SATTELITE_SOLAR => 'СоСп', 
Please login to merge, or discard this patch.
includes/vars/vars_mission_checks.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
   'checkSpeedPercentOld'       => FLIGHT_FLEET_SPEED_WRONG,
11 11
   'checkTargetInUniverse'      => FLIGHT_VECTOR_BEYOND_UNIVERSE,
12 12
   'checkTargetNotSource'       => FLIGHT_VECTOR_SAME_SOURCE,
13
-  'checkSenderNoVacation'      => FLIGHT_PLAYER_VACATION_OWN,  // tODO
13
+  'checkSenderNoVacation'      => FLIGHT_PLAYER_VACATION_OWN, // tODO
14 14
   'checkTargetNoVacation'      => FLIGHT_PLAYER_VACATION,
15 15
   'checkFleetNotEmpty'         => FLIGHT_SHIPS_NO_SHIPS,
16 16
   // 'checkUnitsPositive'         => FLIGHT_SHIPS_NEGATIVE, // Unused - 'cause it's not allowed to put negative units into Unit class
Please login to merge, or discard this patch.
includes/vars/vars_structures.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -15,8 +15,8 @@  discard block
 block discarded – undo
15 15
       'factor' => 1.5,
16 16
     ),
17 17
     P_UNIT_PRODUCTION => array(
18
-      RES_METAL     => function ($level, $production_factor, $user, $planet_row) {return  40 * $level * pow(1.1, $level) * (0.1 * $production_factor);},
19
-      RES_ENERGY    => function ($level, $production_factor, $user, $planet_row) {return -13 * $level * pow(1.1, $level) * (0.1 * $production_factor);},
18
+      RES_METAL     => function($level, $production_factor, $user, $planet_row) {return  40 * $level * pow(1.1, $level) * (0.1 * $production_factor); },
19
+      RES_ENERGY    => function($level, $production_factor, $user, $planet_row) {return -13 * $level * pow(1.1, $level) * (0.1 * $production_factor); },
20 20
     ),
21 21
     P_MINING_IS_MANAGED => true,
22 22
   ),
@@ -33,8 +33,8 @@  discard block
 block discarded – undo
33 33
       'factor' => 1.6,
34 34
     ),
35 35
     P_UNIT_PRODUCTION => array(
36
-      RES_CRYSTAL   => function ($level, $production_factor, $user, $planet_row) {return  32 * $level * pow(1.1, $level) * (0.1 * $production_factor);},
37
-      RES_ENERGY    => function ($level, $production_factor, $user, $planet_row) {return -16 * $level * pow(1.1, $level) * (0.1 * $production_factor);},
36
+      RES_CRYSTAL   => function($level, $production_factor, $user, $planet_row) {return  32 * $level * pow(1.1, $level) * (0.1 * $production_factor); },
37
+      RES_ENERGY    => function($level, $production_factor, $user, $planet_row) {return -16 * $level * pow(1.1, $level) * (0.1 * $production_factor); },
38 38
     ),
39 39
     P_MINING_IS_MANAGED => true,
40 40
   ),
@@ -51,8 +51,8 @@  discard block
 block discarded – undo
51 51
       'factor' => 1.5,
52 52
     ),
53 53
     P_UNIT_PRODUCTION => array(
54
-      RES_DEUTERIUM => function ($level, $production_factor, $user, $planet_row) {return  10 * $level * pow(1.1, $level) * (0.1 * $production_factor) * (-0.002 * $planet_row["temp_max"] + 1.28);},
55
-      RES_ENERGY    => function ($level, $production_factor, $user, $planet_row) {return -20 * $level * pow(1.1, $level) * (0.1 * $production_factor);},
54
+      RES_DEUTERIUM => function($level, $production_factor, $user, $planet_row) {return  10 * $level * pow(1.1, $level) * (0.1 * $production_factor) * (-0.002 * $planet_row["temp_max"] + 1.28); },
55
+      RES_ENERGY    => function($level, $production_factor, $user, $planet_row) {return -20 * $level * pow(1.1, $level) * (0.1 * $production_factor); },
56 56
     ),
57 57
     P_MINING_IS_MANAGED => true,
58 58
   ),
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
       'factor' => 1.5,
70 70
     ),
71 71
     P_UNIT_PRODUCTION => array(
72
-      RES_ENERGY    => function ($level, $production_factor, $user, $planet_row) {return ($planet_row["temp_max"] / 5 + 15) * $level * pow(1.1, $level) * (0.1 * $production_factor);},
72
+      RES_ENERGY    => function($level, $production_factor, $user, $planet_row) {return ($planet_row["temp_max"] / 5 + 15) * $level * pow(1.1, $level) * (0.1 * $production_factor); },
73 73
     ),
74 74
     P_MINING_IS_MANAGED => true,
75 75
   ),
@@ -87,8 +87,8 @@  discard block
 block discarded – undo
87 87
       'factor' => 1.8,
88 88
     ),
89 89
     P_UNIT_PRODUCTION => array(
90
-      RES_DEUTERIUM => function ($level, $production_factor, $user, $planet_row) {return -10 * $level * pow(1.1, $level) * (0.1 * $production_factor);},
91
-      RES_ENERGY    => function ($level, $production_factor, $user, $planet_row) {return  30 * $level * pow(1.05 + 0.01 * mrc_get_level($user, null, TECH_ENERGY), $level) * (0.1 * $production_factor);},
90
+      RES_DEUTERIUM => function($level, $production_factor, $user, $planet_row) {return -10 * $level * pow(1.1, $level) * (0.1 * $production_factor); },
91
+      RES_ENERGY    => function($level, $production_factor, $user, $planet_row) {return  30 * $level * pow(1.05 + 0.01 * mrc_get_level($user, null, TECH_ENERGY), $level) * (0.1 * $production_factor); },
92 92
     ),
93 93
     P_MINING_IS_MANAGED => true,
94 94
   ),
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
       'factor' => 2,
106 106
     ),
107 107
     'storage' => array(
108
-      RES_METAL => function($level) {return BASE_STORAGE_SIZE * pow(1.5, $level);},
108
+      RES_METAL => function($level) {return BASE_STORAGE_SIZE * pow(1.5, $level); },
109 109
     ),
110 110
   ),
111 111
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
       'factor' => 2,
122 122
     ),
123 123
     'storage' => array(
124
-      RES_CRYSTAL => function($level) {return BASE_STORAGE_SIZE * pow(1.5, $level);},
124
+      RES_CRYSTAL => function($level) {return BASE_STORAGE_SIZE * pow(1.5, $level); },
125 125
     ),
126 126
   ),
127 127
 
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
       'factor' => 2,
138 138
     ),
139 139
     'storage' => array(
140
-      RES_DEUTERIUM => function($level) {return BASE_STORAGE_SIZE * pow(1.5, $level);},
140
+      RES_DEUTERIUM => function($level) {return BASE_STORAGE_SIZE * pow(1.5, $level); },
141 141
     ),
142 142
   ),
143 143
 
Please login to merge, or discard this patch.
includes/vars/vars_combats.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     'shield' => 10,
36 36
     'armor' => 400,
37 37
     'attack' => 5,
38
-    'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250, ),
38
+    'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250,),
39 39
   ),
40 40
   SHIP_CARGO_BIG => array(
41 41
     'name' => 'big_ship_cargo',
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
     'shield' => 25,
56 56
     'armor' => 1200,
57 57
     'attack' => 5,
58
-    'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250, ),
58
+    'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250,),
59 59
     'engine' => array(
60 60
       array(
61 61
         'tech' => TECH_ENGINE_CHEMICAL,
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
     'shield' => 50,
84 84
     'armor' => 3000,
85 85
     'attack' => 10,
86
-    'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250, ),
86
+    'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250,),
87 87
     'engine' => array(
88 88
       array(
89 89
         'tech' => TECH_ENGINE_ION,
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
     'shield' => 200,
112 112
     'armor' => 70000,
113 113
     'attack' => 50,
114
-    'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250, ),
114
+    'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250,),
115 115
     'engine' => array(
116 116
       array(
117 117
         'tech' => TECH_ENGINE_HYPER,
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
     'shield' => 100,
141 141
     'armor' => 3000,
142 142
     'attack' => 50,
143
-    'amplify' => array(SHIP_SPY => 10.001, SHIP_SATTELITE_SOLAR => 21, ),
143
+    'amplify' => array(SHIP_SPY => 10.001, SHIP_SATTELITE_SOLAR => 21,),
144 144
     'engine' => array(
145 145
       array(
146 146
         'tech' => TECH_ENGINE_ION,
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
     'shield' => 10,
169 169
     'armor' => 1600,
170 170
     'attack' => 1,
171
-    'amplify' => array(SHIP_SPY => 500.05, SHIP_SATTELITE_SOLAR => 1050, ),
171
+    'amplify' => array(SHIP_SPY => 500.05, SHIP_SATTELITE_SOLAR => 1050,),
172 172
     'engine' => array(
173 173
       array(
174 174
         'tech' => TECH_ENGINE_CHEMICAL,
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
     'shield' =>  0.01,
197 197
     'armor' => 100,
198 198
     'attack' =>  0.01,
199
-    'amplify' => array( SHIP_SPY => 1,),
199
+    'amplify' => array(SHIP_SPY => 1,),
200 200
     'engine' => array(
201 201
       array(
202 202
         'tech' => TECH_ENGINE_CHEMICAL,
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
       'factor' => 1,
221 221
     ),
222 222
     P_UNIT_PRODUCTION => array(
223
-      RES_ENERGY => function($level, $production_factor, $user, $planet_row) {return ($planet_row["temp_max"] / 4 + 20) * $level * (0.1 * $production_factor);},
223
+      RES_ENERGY => function($level, $production_factor, $user, $planet_row) {return ($planet_row["temp_max"] / 4 + 20) * $level * (0.1 * $production_factor); },
224 224
     ),
225 225
     P_MINING_IS_MANAGED => true,
226 226
 
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
     'shield' => 10,
230 230
     'armor' => 200,
231 231
     'attack' => 1,
232
-    'amplify' => array(SHIP_SPY => 1, ),
232
+    'amplify' => array(SHIP_SPY => 1,),
233 233
     'engine' => array(
234 234
       array(
235 235
         'tech' => TECH_ENGINE_CHEMICAL,
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
     'shield' => 10,
262 262
     'armor' => 400,
263 263
     'attack' => 50,
264
-    'amplify' => array(SHIP_CARGO_SMALL => 16.4, SHIP_SPY => 10.001, SHIP_SATTELITE_SOLAR => 21, ),
264
+    'amplify' => array(SHIP_CARGO_SMALL => 16.4, SHIP_SPY => 10.001, SHIP_SATTELITE_SOLAR => 21,),
265 265
     'engine' => array(
266 266
       array(
267 267
         'tech' => TECH_ENGINE_CHEMICAL,
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
     'shield' => 25,
291 291
     'armor' => 1000,
292 292
     'attack' => 150,
293
-    'amplify' => array(SHIP_CARGO_SMALL => 8.2, SHIP_SPY => 3.33367, SHIP_SATTELITE_SOLAR => 7, ),
293
+    'amplify' => array(SHIP_CARGO_SMALL => 8.2, SHIP_SPY => 3.33367, SHIP_SATTELITE_SOLAR => 7,),
294 294
     'engine' => array(
295 295
       array(
296 296
         'tech' => TECH_ENGINE_ION,
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
     'shield' =>  50,
350 350
     'armor' => 2700,
351 351
     'attack' => 400,
352
-    'amplify' => array(SHIP_SMALL_FIGHTER_LIGHT => 6.15, SHIP_SPY => 1.25013, SHIP_SATTELITE_SOLAR => 2.625, UNIT_DEF_TURRET_MISSILE => 5.5, ),
352
+    'amplify' => array(SHIP_SMALL_FIGHTER_LIGHT => 6.15, SHIP_SPY => 1.25013, SHIP_SATTELITE_SOLAR => 2.625, UNIT_DEF_TURRET_MISSILE => 5.5,),
353 353
     'engine' => array(
354 354
       array(
355 355
         'tech' => TECH_ENGINE_ION,
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
     'shield' =>  200,
409 409
     'armor' =>  6000,
410 410
     'attack' => 1000,
411
-    'amplify' => array(SHIP_SPY => 0.50005, SHIP_SATTELITE_SOLAR => 1.05, UNIT_DEF_TURRET_MISSILE => 1.76, ),
411
+    'amplify' => array(SHIP_SPY => 0.50005, SHIP_SATTELITE_SOLAR => 1.05, UNIT_DEF_TURRET_MISSILE => 1.76,),
412 412
     'engine' => array(
413 413
       array(
414 414
         'tech' => TECH_ENGINE_HYPER,
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
     'shield' =>  500,
505 505
     'armor' => 11000,
506 506
     'attack' => 2000,
507
-    'amplify' => array(SHIP_SPY => 0.25003, SHIP_SATTELITE_SOLAR => 0.525, SHIP_LARGE_BATTLESHIP => 7.4, UNIT_DEF_TURRET_LASER_SMALL => 1.125, ),
507
+    'amplify' => array(SHIP_SPY => 0.25003, SHIP_SATTELITE_SOLAR => 0.525, SHIP_LARGE_BATTLESHIP => 7.4, UNIT_DEF_TURRET_LASER_SMALL => 1.125,),
508 508
     'engine' => array(
509 509
       array(
510 510
         'tech' => TECH_ENGINE_HYPER,
@@ -608,7 +608,7 @@  discard block
 block discarded – undo
608 608
     'shield' => 20,
609 609
     'armor' => 200,
610 610
     'attack' => 80,
611
-    'amplify' => array(SHIP_SPY => 7, ),
611
+    'amplify' => array(SHIP_SPY => 7,),
612 612
   ),
613 613
   UNIT_DEF_TURRET_LASER_SMALL => array(
614 614
     'name' => 'small_laser',
@@ -626,7 +626,7 @@  discard block
 block discarded – undo
626 626
     'shield' => 25,
627 627
     'armor' => 200,
628 628
     'attack' => 100,
629
-    'amplify' => array(SHIP_SPY => 5, ),
629
+    'amplify' => array(SHIP_SPY => 5,),
630 630
   ),
631 631
   UNIT_DEF_TURRET_LASER_BIG => array(
632 632
     'name' => 'big_laser',
@@ -644,7 +644,7 @@  discard block
 block discarded – undo
644 644
     'shield' => 100,
645 645
     'armor' => 800,
646 646
     'attack' => 250,
647
-    'amplify' => array(SHIP_SPY => 2, ),
647
+    'amplify' => array(SHIP_SPY => 2,),
648 648
   ),
649 649
   UNIT_DEF_TURRET_GAUSS => array(
650 650
     'name' => 'gauss_canyon',
@@ -662,7 +662,7 @@  discard block
 block discarded – undo
662 662
     'armor' => 3500,
663 663
     'shield' => 200,
664 664
     'attack' => 1100,
665
-    'amplify' => array(SHIP_SPY => 0.5, ),
665
+    'amplify' => array(SHIP_SPY => 0.5,),
666 666
   ),
667 667
   UNIT_DEF_TURRET_ION => array(
668 668
     'name' => 'ionic_canyon',
@@ -680,7 +680,7 @@  discard block
 block discarded – undo
680 680
     'shield' => 500,
681 681
     'armor' => 800,
682 682
     'attack' => 150,
683
-    'amplify' => array(SHIP_SPY => 3.3, ),
683
+    'amplify' => array(SHIP_SPY => 3.3,),
684 684
   ),
685 685
   UNIT_DEF_TURRET_PLASMA => array(
686 686
     'name' => 'buster_canyon',
@@ -698,7 +698,7 @@  discard block
 block discarded – undo
698 698
     'shield' => 300,
699 699
     'armor' => 10000,
700 700
     'attack' => 3000,
701
-    'amplify' => array(SHIP_SPY => 0.17, ),
701
+    'amplify' => array(SHIP_SPY => 0.17,),
702 702
   ),
703 703
 
704 704
   UNIT_DEF_SHIELD_SMALL => array(
@@ -718,7 +718,7 @@  discard block
 block discarded – undo
718 718
     'shield' => 2000,
719 719
     'armor' => 2000,
720 720
     'attack' => 1,
721
-    'amplify' => array(SHIP_SPY => 500, ),
721
+    'amplify' => array(SHIP_SPY => 500,),
722 722
   ),
723 723
   UNIT_DEF_SHIELD_BIG => array(
724 724
     'name' => 'big_protection_shield',
@@ -737,7 +737,7 @@  discard block
 block discarded – undo
737 737
     'shield' => 2000,
738 738
     'armor' => 10000,
739 739
     'attack' => 1,
740
-    'amplify' => array(SHIP_SPY => 500, ),
740
+    'amplify' => array(SHIP_SPY => 500,),
741 741
   ),
742 742
   UNIT_DEF_SHIELD_PLANET => array(
743 743
     'name'      => 'planet_protector',
Please login to merge, or discard this patch.