Completed
Push — work-fleets ( aedb07...3b3d1f )
by SuperNova.WS
05:31
created
includes/includes/market_trader.inc 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if((!defined('SN_IN_MARKET') || SN_IN_MARKET !== true) && (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true)) {
3
+if ((!defined('SN_IN_MARKET') || SN_IN_MARKET !== true) && (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true)) {
4 4
   $debug->error("Attempt to call market page mode {$mode} directly - not from market.php", 'Forbidden', 403);
5 5
 }
6 6
 
@@ -27,12 +27,12 @@  discard block
 block discarded – undo
27 27
 
28 28
   // $dm_db_name = pname_resource_name(RES_DARK_MATTER);
29 29
   $exchangeTo = in_array($exchangeTo = sys_get_param_int('exchangeTo'), sn_get_groups('resources_trader')) ? $exchangeTo : 0;
30
-  if($exchangeTo && is_array($tradeList = $_POST['spend'])) {
30
+  if ($exchangeTo && is_array($tradeList = $_POST['spend'])) {
31 31
     $value = 0;
32 32
     $qry = array();
33 33
 
34 34
     sn_db_transaction_start();
35
-    if($planetrow['id_owner']) {
35
+    if ($planetrow['id_owner']) {
36 36
       $global_data = sys_o_get_updated($user, $planetrow, SN_TIME_NOW);
37 37
       $planetrow = $global_data['planet'];
38 38
     }
@@ -41,27 +41,27 @@  discard block
 block discarded – undo
41 41
       $user = db_user_by_id($user['id'], true);
42 42
     }
43 43
 
44
-    foreach(sn_get_groups('resources_trader') as $resource_id) {
44
+    foreach (sn_get_groups('resources_trader') as $resource_id) {
45 45
       $amount = floatval($tradeList[$resource_id]);
46
-      if($amount < 0) {
46
+      if ($amount < 0) {
47 47
         $debug->error('Trying to supply negative resource amount on Black Market Page', 'Hack Attempt', 305);
48 48
       }
49 49
 
50
-      if($resource_id == RES_DARK_MATTER && $exchangeTo == RES_DARK_MATTER) {
50
+      if ($resource_id == RES_DARK_MATTER && $exchangeTo == RES_DARK_MATTER) {
51 51
         continue;
52 52
       }
53 53
 
54 54
       $resource_db_name = pname_resource_name($resource_id);
55
-      if($exchangeTo == RES_DARK_MATTER) {
55
+      if ($exchangeTo == RES_DARK_MATTER) {
56 56
         $sign = '+';
57 57
         $amount = floor($tradeList[RES_DARK_MATTER] / 3 * $rates[RES_DARK_MATTER] / $rates[$resource_id]);
58 58
         $value += $amount;
59 59
       } else {
60 60
         $value += floor($amount * $rates[$resource_id] / $rates[$exchangeTo]);
61
-        if($resource_id == RES_DARK_MATTER) {
61
+        if ($resource_id == RES_DARK_MATTER) {
62 62
           $amount = 0;
63 63
         } else {
64
-          if(mrc_get_level($user, $planetrow, $resource_id, true) < $amount) {
64
+          if (mrc_get_level($user, $planetrow, $resource_id, true) < $amount) {
65 65
             $intError = MARKET_NO_RESOURCES;
66 66
             break;
67 67
           }
@@ -70,12 +70,12 @@  discard block
 block discarded – undo
70 70
         }
71 71
       }
72 72
 
73
-      if($amount) {
73
+      if ($amount) {
74 74
         $qry[] = "`{$resource_db_name}` = `{$resource_db_name}` {$sign} {$amount}";
75 75
       }
76 76
     }
77 77
 
78
-    if($exchangeTo != RES_DARK_MATTER) {
78
+    if ($exchangeTo != RES_DARK_MATTER) {
79 79
       $amount = floor($value);
80 80
       $exchange_to_db_name = pname_resource_name($exchangeTo);
81 81
       $qry[] = "`{$exchange_to_db_name}` = `{$exchange_to_db_name}` + {$amount}";
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     $intError = $value <= 0 ? MARKET_ZERO_DEAL : $intError;
87 87
     $intError = mrc_get_level($user, null, RES_DARK_MATTER) < $operation_cost ? MARKET_NO_DM : $intError;
88 88
 
89
-    if($intError == MARKET_DEAL) {
89
+    if ($intError == MARKET_DEAL) {
90 90
       $qry = implode(', ', $qry);
91 91
       $table = $planetrow['id_owner'] ? 'planets' : 'users';
92 92
 
@@ -111,8 +111,8 @@  discard block
 block discarded – undo
111 111
     'EXCHANGE_TO_RESOURCE_ID' => $exchangeTo,
112 112
   ));
113 113
 
114
-  foreach(sn_get_groups('resources_trader') as $resource_id) {
115
-    if($resource_id == RES_DARK_MATTER) {
114
+  foreach (sn_get_groups('resources_trader') as $resource_id) {
115
+    if ($resource_id == RES_DARK_MATTER) {
116 116
       $amount = floor(mrc_get_level($user, null, RES_DARK_MATTER) - $config->rpg_cost_trader);
117 117
     } else {
118 118
       $amount = floor(mrc_get_level($user, $planetrow, $resource_id));
Please login to merge, or discard this patch.
includes/includes/user_birthday_celebrate.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 
9 9
   $query = db_user_list_to_celebrate($config->user_birthday_range);
10 10
 
11
-  while($row = db_fetch($query))
11
+  while ($row = db_fetch($query))
12 12
   {
13 13
     $row['username'] = db_escape($row['username']);
14 14
     rpg_points_change($row['id'], RPG_BIRTHDAY, $config->user_birthday_gift, "Birthday gift for user {$row['username']} ID {$row['id']} on his birthday on {$row['user_birthday']}. Gift last gaved at {$row['user_birthday_celebrated']}");
Please login to merge, or discard this patch.
includes/includes/flt_page1.inc 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -4,18 +4,18 @@  discard block
 block discarded – undo
4 4
 // @version 1.0
5 5
 // @copyright 2008 by Chlorel for XNova
6 6
 
7
-if(SN_IN_FLEET !== true) {
7
+if (SN_IN_FLEET !== true) {
8 8
   $debug->error("Attempt to call FLEET page mode {$mode} directly - not from fleet.php", 'Forbidden', 403);
9 9
 }
10 10
 
11 11
 $template = gettemplate('fleet1', true);
12 12
 
13 13
 $ships = sys_get_param('ships', array());
14
-if(!is_array($ships)) {
14
+if (!is_array($ships)) {
15 15
   $ships = array();
16 16
 }
17 17
 
18
-foreach(array(PT_PLANET, PT_DEBRIS, PT_MOON) as $possible_planet_type_id) {
18
+foreach (array(PT_PLANET, PT_DEBRIS, PT_MOON) as $possible_planet_type_id) {
19 19
   $template->assign_block_vars('possible_planet_type_id', array(
20 20
     'ID' => $possible_planet_type_id,
21 21
     'NAME' => $lang['sys_planet_type_sh'][$possible_planet_type_id],
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
   'START_NAME'         => $planetrow['name'],
29 29
 );
30 30
 
31
-if(!empty($TargetPlanet)) {
31
+if (!empty($TargetPlanet)) {
32 32
   $template_route += array(
33 33
     'END_TYPE_TEXT_SH' => $lang['sys_planet_type_sh'][$TargetPlanet['planet_type']],
34 34
     'END_COORDS'       => uni_render_coordinates($TargetPlanet),
@@ -39,10 +39,10 @@  discard block
 block discarded – undo
39 39
 $template->assign_block_vars('fleets', $template_route);
40 40
 
41 41
 $sn_groups_fleet = sn_get_groups('fleet');
42
-foreach($ships as $ship_id => $ship_count) {
43
-  if(in_array($ship_id, $sn_groups_fleet) && $ship_count) {
42
+foreach ($ships as $ship_id => $ship_count) {
43
+  if (in_array($ship_id, $sn_groups_fleet) && $ship_count) {
44 44
     $ship_info = get_unit_param($ship_id);
45
-    if($ship_count > mrc_get_level($user, $planetrow, $ship_id, false, true)) {
45
+    if ($ship_count > mrc_get_level($user, $planetrow, $ship_id, false, true)) {
46 46
       $page .= $lang['fl_noenought'];
47 47
     } else {
48 48
       $fleet['fleetarray'][$ship_id]  = $ship_count;
@@ -61,13 +61,13 @@  discard block
 block discarded – undo
61 61
   }
62 62
 }
63 63
 
64
-if(empty($fleet['fleetarray'])) {
64
+if (empty($fleet['fleetarray'])) {
65 65
   message($lang['fl_err_no_ships'], $lang['fl_error'], 'fleet' . DOT_PHP_EX, 5);
66 66
 }
67 67
 
68 68
 // Building list of shortcuts
69 69
 $query = doquery("SELECT * FROM {{notes}} WHERE `owner` = {$user['id']} AND `galaxy` <> 0 AND `system` <> 0 AND `planet` <> 0 ORDER BY `priority` DESC, `galaxy`, `system`, `planet`, `planet_type`;");
70
-while($shortcut = db_fetch($query)) {
70
+while ($shortcut = db_fetch($query)) {
71 71
   $template->assign_block_vars('shortcut', array(
72 72
     'NAME'       => $shortcut['title'],
73 73
     'GALAXY'     => $shortcut['galaxy'],
@@ -81,10 +81,10 @@  discard block
 block discarded – undo
81 81
 }
82 82
 
83 83
 // Building list of own planets & moons
84
-$colonies = db_planet_list_sorted ( $user );
85
-if(count($colonies) > 1) {
84
+$colonies = db_planet_list_sorted($user);
85
+if (count($colonies) > 1) {
86 86
   // while($row = db_fetch($colonies))
87
-  foreach($colonies as $row) {
87
+  foreach ($colonies as $row) {
88 88
     $template->assign_block_vars('colonies', array(
89 89
       'NAME'       => $row['name'],
90 90
       'GALAXY'     => $row['galaxy'],
@@ -99,9 +99,9 @@  discard block
 block discarded – undo
99 99
 //ACS Start
100 100
 //Need to look for acs attacks.
101 101
 $aks_madnessred = doquery('SELECT * FROM {{aks}};');
102
-while($row = db_fetch($aks_madnessred)) {
102
+while ($row = db_fetch($aks_madnessred)) {
103 103
   $members = explode(',', $row['eingeladen']);
104
-  foreach($members as $a => $b) {
104
+  foreach ($members as $a => $b) {
105 105
     if ($b == $user['id']) {
106 106
       $template->assign_block_vars('acss', array(
107 107
         'ID'         => $row['id'],
Please login to merge, or discard this patch.
includes/includes/ube_zi_helpers.php 1 patch
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($debug_unit_crossfire_result as $key => $value)
64
+  foreach ($debug_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.
includes/includes/mrc_mercenary.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -7,16 +7,16 @@  discard block
 block discarded – undo
7 7
   global $config;
8 8
 
9 9
   $mercenary_info = get_unit_param($mercenary_id);
10
-  if($config->empire_mercenary_temporary || $mercenary_info[P_UNIT_TYPE] == UNIT_PLANS)
10
+  if ($config->empire_mercenary_temporary || $mercenary_info[P_UNIT_TYPE] == UNIT_PLANS)
11 11
   {
12 12
     return true;
13 13
   }
14 14
 
15
-  if(isset($mercenary_info[P_REQUIRE]))
15
+  if (isset($mercenary_info[P_REQUIRE]))
16 16
   {
17
-    foreach($mercenary_info[P_REQUIRE] as $unit_id => $unit_level)
17
+    foreach ($mercenary_info[P_REQUIRE] as $unit_id => $unit_level)
18 18
     {
19
-      if(mrc_get_level($user, null, $unit_id) < $unit_level)
19
+      if (mrc_get_level($user, null, $unit_id) < $unit_level)
20 20
       {
21 21
         return false;
22 22
       }
@@ -33,35 +33,35 @@  discard block
 block discarded – undo
33 33
     $is_permanent = $mode == UNIT_PLANS || !$config->empire_mercenary_temporary;
34 34
     $cost_alliance_multiplyer = (SN_IN_ALLY === true && $mode == UNIT_PLANS ? $config->ali_bonus_members : 1);
35 35
     $cost_alliance_multiplyer = $cost_alliance_multiplyer >= 1 ? $cost_alliance_multiplyer : 1;
36
-    if(!in_array($mercenary_id, sn_get_groups($mode == UNIT_PLANS ? 'plans' : 'mercenaries'))) {
36
+    if (!in_array($mercenary_id, sn_get_groups($mode == UNIT_PLANS ? 'plans' : 'mercenaries'))) {
37 37
       throw new Exception($lang['mrc_msg_error_wrong_mercenary'], ERR_ERROR);
38 38
     }
39 39
 
40
-    if(!mrc_officer_accessible($user, $mercenary_id)) {
40
+    if (!mrc_officer_accessible($user, $mercenary_id)) {
41 41
       throw new Exception($lang['mrc_msg_error_requirements'], ERR_ERROR);
42 42
     }
43 43
 
44 44
     $mercenary_level = sys_get_param_int('mercenary_level');
45
-    if($mercenary_level < 0 || $mercenary_level > get_unit_param($mercenary_id, P_MAX_STACK)) {
45
+    if ($mercenary_level < 0 || $mercenary_level > get_unit_param($mercenary_id, P_MAX_STACK)) {
46 46
       throw new Exception($lang['mrc_msg_error_wrong_level'], ERR_ERROR);
47 47
     }
48 48
 
49
-    if($mercenary_level && !array_key_exists($mercenary_period = sys_get_param_int('mercenary_period'), $sn_powerup_buy_discounts)) {
49
+    if ($mercenary_level && !array_key_exists($mercenary_period = sys_get_param_int('mercenary_period'), $sn_powerup_buy_discounts)) {
50 50
       throw new Exception($lang['mrc_msg_error_wrong_period'], ERR_ERROR);
51 51
     }
52 52
 
53 53
     sn_db_transaction_start();
54 54
 
55 55
     $mercenary_level_old = mrc_get_level($user, $planetrow, $mercenary_id, true, true);
56
-    if($config->empire_mercenary_temporary && $mercenary_level_old && $mercenary_level) {
56
+    if ($config->empire_mercenary_temporary && $mercenary_level_old && $mercenary_level) {
57 57
       throw new Exception($lang['mrc_msg_error_already_hired'], ERR_ERROR); // Can't hire already hired temp mercenary - dismiss first
58
-    } elseif($config->empire_mercenary_temporary && !$mercenary_level_old && !$mercenary_level) {
58
+    } elseif ($config->empire_mercenary_temporary && !$mercenary_level_old && !$mercenary_level) {
59 59
       throw new Exception('', ERR_NONE); // Can't dismiss (!$mercenary_level) not hired (!$mercenary_level_old) temp mercenary. But no error
60 60
     }
61 61
 
62
-    if($mercenary_level) {
62
+    if ($mercenary_level) {
63 63
       $darkmater_cost = eco_get_total_cost($mercenary_id, $mercenary_level);
64
-      if(!$config->empire_mercenary_temporary && $mercenary_level_old) {
64
+      if (!$config->empire_mercenary_temporary && $mercenary_level_old) {
65 65
        $darkmater_cost_old = eco_get_total_cost($mercenary_id, $mercenary_level_old);
66 66
        $darkmater_cost[BUILD_CREATE][RES_DARK_MATTER] -= $darkmater_cost_old[BUILD_CREATE][RES_DARK_MATTER];
67 67
       }
@@ -71,13 +71,13 @@  discard block
 block discarded – undo
71 71
     }
72 72
     $darkmater_cost *= $cost_alliance_multiplyer;
73 73
 
74
-    if(mrc_get_level($user, null, RES_DARK_MATTER) < $darkmater_cost) {
74
+    if (mrc_get_level($user, null, RES_DARK_MATTER) < $darkmater_cost) {
75 75
       throw new Exception($lang['mrc_msg_error_no_resource'], ERR_ERROR);
76 76
     }
77 77
 
78
-    if(($darkmater_cost && $mercenary_level) || !$is_permanent) {
78
+    if (($darkmater_cost && $mercenary_level) || !$is_permanent) {
79 79
       $unit_row = db_unit_by_location($user['id'], LOC_USER, $user['id'], $mercenary_id);
80
-      if(is_array($unit_row) && ($dismiss_left_days = floor((strtotime($unit_row['unit_time_finish']) - SN_TIME_NOW) / PERIOD_DAY))) {
80
+      if (is_array($unit_row) && ($dismiss_left_days = floor((strtotime($unit_row['unit_time_finish']) - SN_TIME_NOW) / PERIOD_DAY))) {
81 81
         $dismiss_full_cost = eco_get_total_cost($mercenary_id, $unit_row['unit_level']);
82 82
         $dismiss_full_cost = $dismiss_full_cost[BUILD_CREATE][RES_DARK_MATTER];
83 83
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
       db_unit_list_delete($user['id'], LOC_USER, $user['id'], $mercenary_id);
96 96
     }
97 97
 
98
-    if($darkmater_cost && $mercenary_level) {
98
+    if ($darkmater_cost && $mercenary_level) {
99 99
       db_unit_set_insert(
100 100
         "unit_player_id = {$user['id']},
101 101
         unit_location_type = " . LOC_USER . ",
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
   $mode = in_array($mode, array(UNIT_MERCENARIES, UNIT_PLANS)) ? $mode : UNIT_MERCENARIES;
131 131
   $is_permanent = $mode == UNIT_PLANS || !$config->empire_mercenary_temporary;
132 132
 
133
-  if($mercenary_id = sys_get_param_int('mercenary_id'))
133
+  if ($mercenary_id = sys_get_param_int('mercenary_id'))
134 134
   {
135 135
     $operation_result = mrc_mercenary_hire($mode, $user, $mercenary_id);
136 136
   }
@@ -139,12 +139,12 @@  discard block
 block discarded – undo
139 139
 
140 140
   $template = gettemplate('mrc_mercenary_hire', true);
141 141
 
142
-  if(!empty($operation_result))
142
+  if (!empty($operation_result))
143 143
   {
144 144
     $template->assign_block_vars('result', $operation_result);
145 145
   }
146 146
 
147
-  foreach($sn_powerup_buy_discounts as $hire_period => $hire_discount)
147
+  foreach ($sn_powerup_buy_discounts as $hire_period => $hire_discount)
148 148
   {
149 149
     $template->assign_block_vars('period', array(
150 150
       'LENGTH'   => $hire_period,
@@ -157,13 +157,13 @@  discard block
 block discarded – undo
157 157
   $user_dark_matter = mrc_get_level($user, '', RES_DARK_MATTER);
158 158
   $cost_alliance_multiplyer = (SN_IN_ALLY === true && $mode == UNIT_PLANS ? $config->ali_bonus_members : 1);
159 159
   $cost_alliance_multiplyer = $cost_alliance_multiplyer >= 1 ? $cost_alliance_multiplyer : 1;
160
-  foreach(sn_get_groups($mode == UNIT_PLANS ? 'plans' : 'mercenaries') as $mercenary_id)
160
+  foreach (sn_get_groups($mode == UNIT_PLANS ? 'plans' : 'mercenaries') as $mercenary_id)
161 161
   {
162 162
     {
163 163
       $mercenary = get_unit_param($mercenary_id);
164 164
       $mercenary_bonus = $mercenary['bonus'];
165 165
       $mercenary_bonus = $mercenary_bonus >= 0 ? "+{$mercenary_bonus}" : "{$mercenary_bonus}";
166
-      switch($mercenary['bonus_type'])
166
+      switch ($mercenary['bonus_type'])
167 167
       {
168 168
         case BONUS_PERCENT:
169 169
           $mercenary_bonus = "{$mercenary_bonus}% ";
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
       $mercenary_level = mrc_get_level($user, null, $mercenary_id, false, true);
182 182
       $mercenary_level_bonus = max(0, mrc_get_level($user, null, $mercenary_id) - $mercenary_level);
183 183
       $total_cost_old = 0;
184
-      if($is_permanent)
184
+      if ($is_permanent)
185 185
       {
186 186
         $total_cost_old = eco_get_total_cost($mercenary_id, $mercenary_level);
187 187
         $total_cost_old = $total_cost_old[BUILD_CREATE][RES_DARK_MATTER] * $cost_alliance_multiplyer;
@@ -205,13 +205,13 @@  discard block
 block discarded – undo
205 205
         'BONUS_TYPE'  => $mercenary['bonus_type'],
206 206
         'HIRE_END'    => $mercenary_time_finish && $mercenary_time_finish >= SN_TIME_NOW ? date(FMT_DATE_TIME, $mercenary_time_finish) : '',
207 207
         'HIRE_LEFT_PERCENT'    => $mercenary_time_finish && $mercenary_time_finish >= SN_TIME_NOW
208
-          ? round(($mercenary_time_finish - SN_TIME_NOW)/($mercenary_time_finish - $mercenary_time_start) * 100, 1)
208
+          ? round(($mercenary_time_finish - SN_TIME_NOW) / ($mercenary_time_finish - $mercenary_time_start) * 100, 1)
209 209
           : 0,
210 210
         'CAN_BUY'     => mrc_officer_accessible($user, $mercenary_id),
211 211
       ));
212 212
 
213 213
       $upgrade_cost = 1;
214
-      for($i = $config->empire_mercenary_temporary ? 1 : $mercenary_level + 1; $mercenary['max'] ? ($i <= $mercenary['max']) : $upgrade_cost <= $user_dark_matter; $i++)
214
+      for ($i = $config->empire_mercenary_temporary ? 1 : $mercenary_level + 1; $mercenary['max'] ? ($i <= $mercenary['max']) : $upgrade_cost <= $user_dark_matter; $i++)
215 215
       {
216 216
         $total_cost = eco_get_total_cost($mercenary_id, $i);
217 217
         $total_cost[BUILD_CREATE][RES_DARK_MATTER] *= $cost_alliance_multiplyer;
Please login to merge, or discard this patch.
includes/includes/sys_avatar.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -9,28 +9,28 @@  discard block
 block discarded – undo
9 9
     $avatar_filename = $fullsize_filename = SN_ROOT_PHYSICAL . 'images/avatar/' . $prefix . '_' . $subject_id;
10 10
     $avatar_filename .= '.png';
11 11
     $fullsize_filename .= '_full.png';
12
-    if(sys_get_param_int('avatar_remove'))
12
+    if (sys_get_param_int('avatar_remove'))
13 13
     {
14
-      if(file_exists($avatar_filename) && !unlink($avatar_filename))
14
+      if (file_exists($avatar_filename) && !unlink($avatar_filename))
15 15
       {
16 16
         throw new Exception($lang['opt_msg_avatar_error_delete'], ERR_ERROR);
17 17
       }
18 18
       $avatar_field = 0;
19 19
       throw new Exception($lang['opt_msg_avatar_removed'], ERR_NONE);
20 20
     }
21
-    elseif($_FILES['avatar']['size'])
21
+    elseif ($_FILES['avatar']['size'])
22 22
     {
23
-      if(!in_array($_FILES['avatar']['type'], array('image/gif', 'image/jpeg', 'image/jpg', 'image/pjpeg', 'image/png')) || $_FILES['avatar']['size'] > 204800)
23
+      if (!in_array($_FILES['avatar']['type'], array('image/gif', 'image/jpeg', 'image/jpg', 'image/pjpeg', 'image/png')) || $_FILES['avatar']['size'] > 204800)
24 24
       {
25 25
         throw new Exception($lang['opt_msg_avatar_error_unsupported'], ERR_WARNING);
26 26
       }
27 27
 
28
-      if($_FILES['avatar']['error'])
28
+      if ($_FILES['avatar']['error'])
29 29
       {
30 30
         throw new Exception(sprintf($lang['opt_msg_avatar_error_upload'], $_FILES['avatar']['error']), ERR_ERROR);
31 31
       }
32 32
 
33
-      if(!($avatar_image = imagecreatefromstring(file_get_contents($_FILES['avatar']['tmp_name']))))
33
+      if (!($avatar_image = imagecreatefromstring(file_get_contents($_FILES['avatar']['tmp_name']))))
34 34
       {
35 35
         throw new Exception($lang['opt_msg_avatar_error_unsupported'], ERR_WARNING);
36 36
       }
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
       $avatar_size = getimagesize($_FILES['avatar']['tmp_name']);
39 39
       $avatar_max_width  = $config-> avatar_max_width;
40 40
       $avatar_max_height = $config-> avatar_max_height;
41
-      if($avatar_size[0] > $avatar_max_width || $avatar_size[1] > $avatar_max_height)
41
+      if ($avatar_size[0] > $avatar_max_width || $avatar_size[1] > $avatar_max_height)
42 42
       {
43 43
         $aspect_ratio = min($avatar_max_width / $avatar_size[0], $avatar_max_height / $avatar_size[1]);
44 44
         $avatar_image_new = imagecreatetruecolor($avatar_size[0] * $aspect_ratio, $avatar_size[0] * $aspect_ratio);
@@ -47,12 +47,12 @@  discard block
 block discarded – undo
47 47
         $avatar_image = $avatar_image_new;
48 48
       }
49 49
 
50
-      if(file_exists($avatar_filename) && !unlink($avatar_filename))
50
+      if (file_exists($avatar_filename) && !unlink($avatar_filename))
51 51
       {
52 52
         throw new Exception($lang['opt_msg_avatar_error_delete'], ERR_ERROR);
53 53
       }
54 54
 
55
-      if(!imagepng($avatar_image, $avatar_filename, 9))
55
+      if (!imagepng($avatar_image, $avatar_filename, 9))
56 56
       {
57 57
         throw new Exception($lang['opt_msg_avatar_error_writing'], ERR_ERROR);
58 58
       }
Please login to merge, or discard this patch.
includes/classes/RequestInfo.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -89,15 +89,15 @@  discard block
 block discarded – undo
89 89
     // Инфа об устройстве и браузере - общая для всех
90 90
     sn_db_transaction_start();
91 91
     $this->device_cypher = $_COOKIE[SN_COOKIE_D];
92
-    if($this->device_cypher) {
92
+    if ($this->device_cypher) {
93 93
       $cypher_safe = db_escape($this->device_cypher);
94 94
       $device_id = doquery("SELECT `device_id` FROM {{security_device}} WHERE `device_cypher` = '{$cypher_safe}' LIMIT 1 FOR UPDATE", true);
95
-      if(!empty($device_id['device_id'])) {
95
+      if (!empty($device_id['device_id'])) {
96 96
         $this->device_id = $device_id['device_id'];
97 97
       }
98 98
     }
99 99
 
100
-    if($this->device_id <= 0) {
100
+    if ($this->device_id <= 0) {
101 101
       do {
102 102
         $cypher_safe = db_escape($this->device_cypher = sys_random_string());
103 103
         $row = doquery("SELECT `device_id` FROM {{security_device}} WHERE `device_cypher` = '{$cypher_safe}' LIMIT 1 FOR UPDATE", true);
@@ -118,10 +118,10 @@  discard block
 block discarded – undo
118 118
     $this->page_address_id = db_get_set_unique_id_value($this->page_address, 'url_id', 'security_url', 'url_string');
119 119
     sn_db_transaction_commit();
120 120
 
121
-    if($this->write_full_url) {
121
+    if ($this->write_full_url) {
122 122
       sn_db_transaction_start();
123 123
       $this->page_url = substr($_SERVER['REQUEST_URI'], strlen(SN_ROOT_RELATIVE));
124
-      if(strpos($_SERVER['REQUEST_URI'], '/simulator.php') === 0) {
124
+      if (strpos($_SERVER['REQUEST_URI'], '/simulator.php') === 0) {
125 125
         $this->page_url = '/simulator.php';
126 126
       }
127 127
       $this->page_url_id = db_get_set_unique_id_value($this->page_url, 'url_id', 'security_url', 'url_string');
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
    */
145 145
   public function db_security_entry_insert($user_id_unsafe) {
146 146
     // TODO $user_id = !empty(self::$user['id']) ? self::$user['id'] : 'NULL';
147
-    if(empty($user_id_unsafe)) {
147
+    if (empty($user_id_unsafe)) {
148 148
       // self::flog('Нет ИД пользователя');
149 149
       return true;
150 150
     }
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
   public function db_counter_insert($user_id_unsafe) {
168 168
     global $config, $sys_stop_log_hit, $is_watching;
169 169
 
170
-    if($sys_stop_log_hit || !$config->game_counter) {
170
+    if ($sys_stop_log_hit || !$config->game_counter) {
171 171
       return;
172 172
     }
173 173
 
@@ -183,14 +183,14 @@  discard block
 block discarded – undo
183 183
 //      $this->ip_v4_int . ", '{$proxy_safe}', " . $this->page_address_id . ", " . $this->page_url_id . ");");
184 184
     doquery(
185 185
       "INSERT INTO {{counter}} SET
186
-        `visit_time` = '" . SN_TIME_SQL. "',
186
+        `visit_time` = '" . SN_TIME_SQL . "',
187 187
         `user_id` = {$user_id_safe},
188 188
         `device_id` = {$this->device_id},
189 189
         `browser_id` = {$this->browser_id},
190 190
         `user_ip` = {$this->ip_v4_int},
191 191
         `user_proxy` = '{$proxy_safe}',
192 192
         `page_url_id` = {$this->page_address_id}" .
193
-        ($this->write_full_url ? ", `plain_url_id` = {$this->page_url_id}" : '' ).
193
+        ($this->write_full_url ? ", `plain_url_id` = {$this->page_url_id}" : '') .
194 194
       ";");
195 195
 
196 196
     $is_watching = false;
Please login to merge, or discard this patch.
includes/classes/core_classes.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -38,8 +38,8 @@  discard block
 block discarded – undo
38 38
     !is_array($offset) ? $offset = array($offset) : false;
39 39
 
40 40
     $current_leaf = $this->__get(reset($offset));
41
-    while(($leaf_index = next($offset)) !== false) {
42
-      if(!isset($current_leaf) || !is_array($current_leaf) || !isset($current_leaf[$leaf_index])) {
41
+    while (($leaf_index = next($offset)) !== false) {
42
+      if (!isset($current_leaf) || !is_array($current_leaf) || !isset($current_leaf[$leaf_index])) {
43 43
         unset($current_leaf);
44 44
         break;
45 45
       }
@@ -64,9 +64,9 @@  discard block
 block discarded – undo
64 64
 
65 65
     !is_array($offset) ? $offset = array($offset) : false;
66 66
 
67
-    if($this->offsetExists($offset)) {
67
+    if ($this->offsetExists($offset)) {
68 68
       $result = $this->__get(reset($offset));
69
-      while(($leaf_index = next($offset)) !== false) {
69
+      while (($leaf_index = next($offset)) !== false) {
70 70
         $result = $result[$leaf_index];
71 71
       }
72 72
     }
@@ -91,12 +91,12 @@  discard block
 block discarded – undo
91 91
    */
92 92
   public function offsetSet($offset, $value = null) {
93 93
     // Если нет никакого индекса - значит нечего записывать
94
-    if(!isset($offset) || (is_array($offset) && empty($offset))) {
94
+    if (!isset($offset) || (is_array($offset) && empty($offset))) {
95 95
       return;
96 96
     }
97 97
 
98 98
     // Если в массиве индекса только один элемент - значит это просто индекс
99
-    if(is_array($offset) && count($offset) == 1) {
99
+    if (is_array($offset) && count($offset) == 1) {
100 100
       // Разворачиваем его в индекс
101 101
       $offset = array(reset($offset) => $value);
102 102
       unset($value);
@@ -104,20 +104,20 @@  discard block
 block discarded – undo
104 104
     }
105 105
 
106 106
     // Адресация многомерного массива через массив индексов в $option
107
-    if(is_array($offset) && isset($value)) {
107
+    if (is_array($offset) && isset($value)) {
108 108
       // TODO - а не переделать ли это всё на __isset() ??
109 109
 //pdump($offset, '$offset');
110 110
 //pdump($value, '$value');
111 111
       // Вытаскиваем корневой элемент
112 112
       $root = $this->__get(reset($offset));
113 113
       $current_leaf = &$root;
114
-      while(($leaf_index = next($offset)) !== false) {
114
+      while (($leaf_index = next($offset)) !== false) {
115 115
         !is_array($current_leaf[$leaf_index]) ? $current_leaf[$leaf_index] = array() : false;
116 116
         $current_leaf = &$current_leaf[$leaf_index];
117 117
       }
118 118
 //pdump($current_leaf, '$current_leaf');
119 119
 //pdump($value, '$value');
120
-      if($current_leaf != $value) {
120
+      if ($current_leaf != $value) {
121 121
         $current_leaf = $value;
122 122
 //pdump(reset($offset), 'reset($offset)');
123 123
 //pdump($root, '$root');
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
       // Пакетная запись из массива ключ -> значение
129 129
       !is_array($offset) ? $offset = array($offset => $value) : false;
130 130
 
131
-      foreach($offset as $key => $value) {
131
+      foreach ($offset as $key => $value) {
132 132
         $this->__get($key) !== $value ? $this->__set($key, $value) : false;
133 133
       }
134 134
     }
@@ -149,13 +149,13 @@  discard block
 block discarded – undo
149 149
    */
150 150
   public function offsetUnset($offset) {
151 151
     // Если нет никакого индекса - значит нечего записывать
152
-    if(!isset($offset) || (is_array($offset) && empty($offset))) {
152
+    if (!isset($offset) || (is_array($offset) && empty($offset))) {
153 153
       return;
154 154
     }
155 155
 
156 156
     !is_array($offset) ? $offset = array($offset) : false;
157 157
 
158
-    if($this->offsetExists($offset)) {
158
+    if ($this->offsetExists($offset)) {
159 159
 //pdump($offset);
160 160
       // Перематываем массив в конец
161 161
       $key_to_delete = end($offset);
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 //pdump($key_to_delete, '$key_to_delete');
164 164
       $parent_offset = $offset;
165 165
       array_pop($parent_offset);
166
-      if(!count($parent_offset)) {
166
+      if (!count($parent_offset)) {
167 167
         // В массиве был один элемент - мы удаляем в корне. Просто удаляем элемент
168 168
         $this->__unset($key_to_delete);
169 169
       } else {
Please login to merge, or discard this patch.
includes/classes/cache.php 1 patch
Spacing   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -13,8 +13,8 @@  discard block
 block discarded – undo
13 13
 * Defining some constants
14 14
 */
15 15
 define('CACHER_NOT_INIT', -1);
16
-define('CACHER_NO_CACHE',  0);
17
-define('CACHER_XCACHE'  ,  1);
16
+define('CACHER_NO_CACHE', 0);
17
+define('CACHER_XCACHE', 1);
18 18
 
19 19
 define('CACHER_LOCK_WAIT', 5); // maximum cacher wait for table unlock in seconds. Can be float
20 20
 
@@ -46,19 +46,19 @@  discard block
 block discarded – undo
46 46
   protected static $cacheObject;
47 47
 
48 48
   public function __construct($prefIn = 'CACHE_', $init_mode = false) {
49
-    if( !($init_mode === false || $init_mode === CACHER_NO_CACHE || ($init_mode === CACHER_XCACHE && extension_loaded('xcache')) )) {
49
+    if (!($init_mode === false || $init_mode === CACHER_NO_CACHE || ($init_mode === CACHER_XCACHE && extension_loaded('xcache')))) {
50 50
       throw new UnexpectedValueException('Wrong work mode or current mode does not supported on your server');
51 51
     }
52 52
 
53 53
     $this->prefix = $prefIn;
54
-    if(extension_loaded('xcache') && ($init_mode === CACHER_XCACHE || $init_mode === false)) {
55
-      if(self::$mode === CACHER_NOT_INIT) {
54
+    if (extension_loaded('xcache') && ($init_mode === CACHER_XCACHE || $init_mode === false)) {
55
+      if (self::$mode === CACHER_NOT_INIT) {
56 56
         self::$mode = CACHER_XCACHE;
57 57
       }
58 58
     } else {
59
-      if(self::$mode === CACHER_NOT_INIT) {
59
+      if (self::$mode === CACHER_NOT_INIT) {
60 60
         self::$mode = CACHER_NO_CACHE;
61
-        if(!self::$data) {
61
+        if (!self::$data) {
62 62
          self::$data = array();
63 63
         }
64 64
       }
@@ -94,11 +94,11 @@  discard block
 block discarded – undo
94 94
       default:
95 95
         switch (self::$mode) {
96 96
           case CACHER_NO_CACHE:
97
-            self::$data[$this->prefix.$name] = $value;
97
+            self::$data[$this->prefix . $name] = $value;
98 98
           break;
99 99
 
100 100
           case CACHER_XCACHE:
101
-            xcache_set($this->prefix.$name, $value);
101
+            xcache_set($this->prefix . $name, $value);
102 102
           break;
103 103
         }
104 104
       break;
@@ -118,11 +118,11 @@  discard block
 block discarded – undo
118 118
       default:
119 119
         switch (self::$mode) {
120 120
           case CACHER_NO_CACHE:
121
-            return self::$data[$this->prefix.$name];
121
+            return self::$data[$this->prefix . $name];
122 122
           break;
123 123
 
124 124
           case CACHER_XCACHE:
125
-            return xcache_get($this->prefix.$name);
125
+            return xcache_get($this->prefix . $name);
126 126
           break;
127 127
 
128 128
         }
@@ -135,11 +135,11 @@  discard block
 block discarded – undo
135 135
   public function __isset($name) {
136 136
     switch (self::$mode) {
137 137
       case CACHER_NO_CACHE:
138
-        return isset(self::$data[$this->prefix.$name]);
138
+        return isset(self::$data[$this->prefix . $name]);
139 139
       break;
140 140
 
141 141
       case CACHER_XCACHE:
142
-        return xcache_isset($this->prefix.$name) && ($this->__get($name) !== null);
142
+        return xcache_isset($this->prefix . $name) && ($this->__get($name) !== null);
143 143
       break;
144 144
     }
145 145
 
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 
161 161
   public function unset_by_prefix($prefix_unset = '') {
162 162
     static $array_clear;
163
-    !$array_clear ? $array_clear = function(&$v,$k,$p) {
163
+    !$array_clear ? $array_clear = function(&$v, $k, $p) {
164 164
       strpos($k, $p) === 0 ? $v = NULL : false;
165 165
     } : false;
166 166
 
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
       break;
173 173
 
174 174
       case CACHER_XCACHE:
175
-        if(!function_exists('xcache_unset_by_prefix')) {
175
+        if (!function_exists('xcache_unset_by_prefix')) {
176 176
           return false;
177 177
         }
178 178
         return xcache_unset_by_prefix($this->prefix . $prefix_unset);
@@ -188,13 +188,13 @@  discard block
 block discarded – undo
188 188
   protected function make_element_name($args, $diff = 0) {
189 189
     $num_args = count($args);
190 190
 
191
-    if($num_args < 1) {
191
+    if ($num_args < 1) {
192 192
       return false;
193 193
     }
194 194
 
195 195
     $name = '';
196 196
     $aName = array();
197
-    for($i = 0; $i <= $num_args - 1 - $diff; $i++) {
197
+    for ($i = 0; $i <= $num_args - 1 - $diff; $i++) {
198 198
       $name .= "[{$args[$i]}]";
199 199
       array_unshift($aName, $name);
200 200
     }
@@ -206,15 +206,15 @@  discard block
 block discarded – undo
206 206
     $args = func_get_args();
207 207
     $name = $this->make_element_name($args, 1);
208 208
 
209
-    if(!$name) {
209
+    if (!$name) {
210 210
       return NULL;
211 211
     }
212 212
 
213
-    if($this->$name[0] === NULL) {
214
-      for($i = count($name) - 1; $i > 0; $i--) {
213
+    if ($this->$name[0] === NULL) {
214
+      for ($i = count($name) - 1; $i > 0; $i--) {
215 215
         $cName = "{$name[$i]}_COUNT";
216
-        $cName1 = "{$name[$i-1]}_COUNT";
217
-        if($this->$cName1 == NULL || $i == 1) {
216
+        $cName1 = "{$name[$i - 1]}_COUNT";
217
+        if ($this->$cName1 == NULL || $i == 1) {
218 218
           $this->$cName++;
219 219
         }
220 220
       }
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 
227 227
   public function array_get() {
228 228
     $name = $this->make_element_name(func_get_args());
229
-    if(!$name) {
229
+    if (!$name) {
230 230
       return NULL;
231 231
     }
232 232
     return $this->$name[0];
@@ -234,12 +234,12 @@  discard block
 block discarded – undo
234 234
 
235 235
   public function array_count() {
236 236
     $name = $this->make_element_name(func_get_args());
237
-    if(!$name) {
237
+    if (!$name) {
238 238
       return 0;
239 239
     }
240 240
     $cName = "{$name[0]}_COUNT";
241 241
     $retVal = $this->$cName;
242
-    if(!$retVal) {
242
+    if (!$retVal) {
243 243
       $retVal = NULL;
244 244
     }
245 245
     return $retVal;
@@ -248,18 +248,18 @@  discard block
 block discarded – undo
248 248
   public function array_unset() {
249 249
     $name = $this->make_element_name(func_get_args());
250 250
 
251
-    if(!$name) {
251
+    if (!$name) {
252 252
       return false;
253 253
     }
254 254
     $this->unset_by_prefix($name[0]);
255 255
 
256
-    for($i = 1; $i < count($name); $i++) {
256
+    for ($i = 1; $i < count($name); $i++) {
257 257
       $cName = "{$name[$i]}_COUNT";
258
-      $cName1 = "{$name[$i-1]}_COUNT";
258
+      $cName1 = "{$name[$i - 1]}_COUNT";
259 259
 
260
-      if($i == 1 || $this->$cName1 === NULL) {
260
+      if ($i == 1 || $this->$cName1 === NULL) {
261 261
         $this->$cName--;
262
-        if($this->$cName <= 0) {
262
+        if ($this->$cName <= 0) {
263 263
           unset($this->$cName);
264 264
         }
265 265
       }
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
     $this->sql_index_field = "{$table_name}_name";
320 320
     $this->sql_value_field = "{$table_name}_value";
321 321
 
322
-    if(!$this->_DB_LOADED) {
322
+    if (!$this->_DB_LOADED) {
323 323
       $this->db_loadAll();
324 324
     }
325 325
   }
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
 
335 335
   public function db_loadItem($index) {
336 336
     $result = null;
337
-    if($index) {
337
+    if ($index) {
338 338
       $index_safe = db_escape($index);
339 339
       $result = doquery("SELECT `{$this->sql_value_field}` FROM `{{{$this->table_name}}}` WHERE `{$this->sql_index_field}` = '{$index_safe}' FOR UPDATE", true);
340 340
       // В две строки - что бы быть уверенным в порядке выполнения
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
     $this->loadDefaults();
349 349
 
350 350
     $query = doquery("SELECT * FROM {{{$this->table_name}}} FOR UPDATE;");
351
-    while($row = db_fetch($query)) {
351
+    while ($row = db_fetch($query)) {
352 352
       $this->$row[$this->sql_index_field] = $row[$this->sql_value_field];
353 353
     }
354 354
 
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
   }
357 357
 
358 358
   public function loadDefaults() {
359
-    foreach($this->defaults as $defName => $defValue) {
359
+    foreach ($this->defaults as $defName => $defValue) {
360 360
       $this->$defName = $defValue;
361 361
     }
362 362
   }
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
   }
373 373
 
374 374
   public function db_saveItem($item_list, $value = NULL) {
375
-    if(empty($item_list)) {
375
+    if (empty($item_list)) {
376 376
       return;
377 377
     }
378 378
 
@@ -380,8 +380,8 @@  discard block
 block discarded – undo
380 380
 
381 381
     // Сначала записываем данные в базу - что бы поймать все блокировки
382 382
     $qry = array();
383
-    foreach($item_list as $item_name => $item_value) {
384
-      if($item_name) {
383
+    foreach ($item_list as $item_name => $item_value) {
384
+      if ($item_name) {
385 385
         $item_value = db_escape($item_value === NULL ? $this->$item_name : $item_value);
386 386
         $item_name = db_escape($item_name);
387 387
         $qry[] = "('{$item_name}', '{$item_value}')";
@@ -390,8 +390,8 @@  discard block
 block discarded – undo
390 390
     doquery("REPLACE INTO `{{" . $this->table_name . "}}` (`{$this->sql_index_field}`, `{$this->sql_value_field}`) VALUES " . implode(',', $qry) . ";");
391 391
 
392 392
     // И только после взятия блокировок - меняем значения в кэше
393
-    foreach($item_list as $item_name => $item_value) {
394
-      if($item_name && $item_value !== NULL) {
393
+    foreach ($item_list as $item_name => $item_value) {
394
+      if ($item_name && $item_value !== NULL) {
395 395
         $this->$item_name = $item_value;
396 396
       }
397 397
     }
@@ -419,9 +419,9 @@  discard block
 block discarded – undo
419 419
     'advGoogleLeftMenuCode'        => '(Place here code for banner)',
420 420
 
421 421
     // Alliance bonus calculations
422
-    'ali_bonus_algorithm'          => 0,  // Bonus calculation algorithm
422
+    'ali_bonus_algorithm'          => 0, // Bonus calculation algorithm
423 423
     'ali_bonus_brackets'           => 10, // Brackets count for ALI_BONUS_BY_RANK
424
-    'ali_bonus_brackets_divisor'   => 10,// Bonus divisor for ALI_BONUS_BY_RANK
424
+    'ali_bonus_brackets_divisor'   => 10, // Bonus divisor for ALI_BONUS_BY_RANK
425 425
     'ali_bonus_divisor'            => 10000000, // Rank divisor for ALI_BONUS_BY_POINTS
426 426
     'ali_bonus_members'            => 10, // Minumum alliace size to start using bonus
427 427
 
@@ -452,25 +452,25 @@  discard block
 block discarded – undo
452 452
     'deuterium_basic_income'       => 0,
453 453
     'eco_scale_storage'            => 1,
454 454
     'eco_stockman_fleet'           => '', // Black Market - Starting amount of s/h ship merchant to sell
455
-    'eco_stockman_fleet_populate'  => 1,  // Populate empty Stockman fleet with ships or not
455
+    'eco_stockman_fleet_populate'  => 1, // Populate empty Stockman fleet with ships or not
456 456
     'empire_mercenary_base_period' => PERIOD_MONTH, // Base
457 457
     'empire_mercenary_temporary'   => 0, // Temporary empire-wide mercenaries
458 458
     'energy_basic_income'          => 0,
459 459
 
460 460
     // Bashing protection settings
461
-    'fleet_bashing_attacks'        => 3,      // Max amount of attack per wave - 3 by default
462
-    'fleet_bashing_interval'       => 1800,   // Maximum interval between attacks when they still count as one wave - 30m by default
463
-    'fleet_bashing_scope'          => 86400,  // Interval on which bashing waves counts - 24h by default
464
-    'fleet_bashing_war_delay'      => 43200,  // Delay before start bashing after declaring war to alliance - 12h by default
465
-    'fleet_bashing_waves'          => 3,      // Max amount of waves per day - 3 by default
461
+    'fleet_bashing_attacks'        => 3, // Max amount of attack per wave - 3 by default
462
+    'fleet_bashing_interval'       => 1800, // Maximum interval between attacks when they still count as one wave - 30m by default
463
+    'fleet_bashing_scope'          => 86400, // Interval on which bashing waves counts - 24h by default
464
+    'fleet_bashing_war_delay'      => 43200, // Delay before start bashing after declaring war to alliance - 12h by default
465
+    'fleet_bashing_waves'          => 3, // Max amount of waves per day - 3 by default
466 466
 
467 467
     'Fleet_Cdr'                    => 30,
468 468
     'fleet_speed'                  => 1,
469 469
 
470 470
     'fleet_update_interval'        => 4,
471 471
 
472
-    'game_adminEmail'              => 'root@localhost',    // Admin's email to show to users
473
-    'game_counter'                 => 0,  // Does built-in page hit counter is on?
472
+    'game_adminEmail'              => 'root@localhost', // Admin's email to show to users
473
+    'game_counter'                 => 0, // Does built-in page hit counter is on?
474 474
     // Defaults
475 475
     'game_default_language'        => 'ru',
476 476
     'game_default_skin'            => 'skins/EpicBlue/',
@@ -484,13 +484,13 @@  discard block
 block discarded – undo
484 484
     'game_maxSystem'               => 199,
485 485
     'game_maxPlanet'               => 15,
486 486
     // Game global settings
487
-    'game_mode'                    => 0,           // 0 - SuperNova, 1 - oGame
487
+    'game_mode'                    => 0, // 0 - SuperNova, 1 - oGame
488 488
     'game_name'                    => 'SuperNova', // Server name (would be on banners and on top of left menu)
489 489
 
490 490
     'game_news_actual'             => 259200, // How long announcement would be marked as "New". In seconds. Default - 3 days
491
-    'game_news_overview'           => 3,    // How much last news to show in Overview page
491
+    'game_news_overview'           => 3, // How much last news to show in Overview page
492 492
     // Noob protection
493
-    'game_noob_factor'             => 5,    // Multiplier to divide "stronger" and "weaker" users
493
+    'game_noob_factor'             => 5, // Multiplier to divide "stronger" and "weaker" users
494 494
     'game_noob_points'             => 5000, // Below this point user threated as noob. 0 to disable
495 495
 
496 496
     'game_multiaccount_enabled'    => 0, // 1 - allow interactions for players with same IP (multiaccounts)
@@ -539,8 +539,8 @@  discard block
 block discarded – undo
539 539
     'payment_currency_exchange_wmu' => 30,
540 540
     'payment_currency_exchange_wmz' => 1,
541 541
 
542
-    'payment_lot_price'             => 1,     // Lot price in default currency
543
-    'payment_lot_size'              => 2500,  // Lot size. Also service as minimum amount of DM that could be bought with one transaction
542
+    'payment_lot_price'             => 1, // Lot price in default currency
543
+    'payment_lot_size'              => 2500, // Lot size. Also service as minimum amount of DM that could be bought with one transaction
544 544
 
545 545
     'planet_teleport_cost'         => 50000, // 
546 546
     'planet_teleport_timeout'      => 86400, // 
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
     'resource_multiplier'          => 1,
559 559
 
560 560
     //Roleplay system
561
-    'rpg_bonus_divisor'            => 10,    // Amount of DM referral shoud get for partner have 1 DM bonus
561
+    'rpg_bonus_divisor'            => 10, // Amount of DM referral shoud get for partner have 1 DM bonus
562 562
     'rpg_bonus_minimum'            => 10000, // Minimum DM ammount for starting paying bonuses to affiliate
563 563
 
564 564
     // Black Market - General
@@ -644,7 +644,7 @@  discard block
 block discarded – undo
644 644
   }
645 645
 
646 646
   public static function getInstance($gamePrefix = 'sn_', $table_name = 'config') {
647
-    if(!isset(self::$cacheObject)) {
647
+    if (!isset(self::$cacheObject)) {
648 648
       $className = get_class();
649 649
       self::$cacheObject = new $className($gamePrefix, $table_name);
650 650
     }
Please login to merge, or discard this patch.