@@ -2,31 +2,31 @@ discard block |
||
2 | 2 | |
3 | 3 | $classLocale = classLocale::$lang; |
4 | 4 | |
5 | -if(!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) { |
|
5 | +if (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) { |
|
6 | 6 | classSupernova::$debug->error("Attempt to call ALLIANCE page mode {$mode} directly - not from alliance.php", 'Forbidden', 403); |
7 | 7 | } |
8 | 8 | |
9 | 9 | // Changing rank for single user |
10 | 10 | $id_user = sys_get_param_id('id_user'); |
11 | -if(isset($_GET['id_rank'])) { |
|
11 | +if (isset($_GET['id_rank'])) { |
|
12 | 12 | $id_rank = sys_get_param_int('id_rank'); |
13 | 13 | } |
14 | -if($id_user && isset($id_rank) && $user_admin) { |
|
14 | +if ($id_user && isset($id_rank) && $user_admin) { |
|
15 | 15 | DBStaticUser::db_user_set_by_id($id_user, "`ally_rank_id` = {$id_rank}"); |
16 | 16 | } |
17 | 17 | |
18 | 18 | $id_kick = sys_get_param_id('kick'); |
19 | 19 | |
20 | -if($id_kick && $user_can_kick) { |
|
20 | +if ($id_kick && $user_can_kick) { |
|
21 | 21 | $u = DBStaticUser::db_user_by_id($id_kick, true); |
22 | - if($u['ally_id'] == $ally['id'] && $u['id'] != $ally['ally_owner']) { |
|
22 | + if ($u['ally_id'] == $ally['id'] && $u['id'] != $ally['ally_owner']) { |
|
23 | 23 | DBStaticUser::db_user_set_by_id($id_kick, '`ally_id`= null, `ally_name` = null, `ally_tag` = null, ally_register_time = 0, ally_rank_id = 0'); |
24 | 24 | db_ally_update_member_decrease($ally); |
25 | 25 | } |
26 | 26 | } |
27 | 27 | |
28 | 28 | $sort2 = sys_get_param_int('sort2'); |
29 | -if($sort2) { |
|
29 | +if ($sort2) { |
|
30 | 30 | $sort2s = "DESC"; |
31 | 31 | $sort2 = 0; |
32 | 32 | } else { |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | } |
36 | 36 | |
37 | 37 | $sort1 = sys_get_param_int('sort1'); |
38 | -if($sort1 > 5 || $sort1 < 0) { |
|
38 | +if ($sort1 > 5 || $sort1 < 0) { |
|
39 | 39 | $sort1 = 0; |
40 | 40 | } |
41 | 41 | $sort1s = array( |
@@ -49,28 +49,28 @@ discard block |
||
49 | 49 | |
50 | 50 | $template = gettemplate('ali_members', true); |
51 | 51 | |
52 | -$userList = DBStaticUser::db_user_list("`ally_id`= {$user['ally_id']} ORDER BY " . sprintf($sort1s[$sort1], $sort2s), false, |
|
52 | +$userList = DBStaticUser::db_user_list("`ally_id`= {$user['ally_id']} ORDER BY ".sprintf($sort1s[$sort1], $sort2s), false, |
|
53 | 53 | 'id, username, galaxy, system, planet, onlinetime, ally_rank_id, ally_register_time, total_points'); |
54 | 54 | |
55 | 55 | // while ($userRow = db_fetch($userList)) |
56 | -foreach($userList as $userRow) { |
|
56 | +foreach ($userList as $userRow) { |
|
57 | 57 | $i++; |
58 | - if(!isset($ranks[$userRow['ally_rank_id']])) { |
|
58 | + if (!isset($ranks[$userRow['ally_rank_id']])) { |
|
59 | 59 | $userRow['ally_rank_id'] = 0; |
60 | 60 | } |
61 | 61 | |
62 | - if($ally['ally_owner'] == $userRow['id']) { |
|
62 | + if ($ally['ally_owner'] == $userRow['id']) { |
|
63 | 63 | $ally_range = ($ally['ally_owner_range']) ? $ally['ally_owner_range'] : classLocale::$lang['Founder']; |
64 | 64 | } else { |
65 | - if($user_admin) { |
|
66 | - $ally_range = '<select onchange="window.location=\'alliance.php?mode=admin&edit=members&id_user=' . $userRow['id'] . '&id_rank=\' + this.value">'; |
|
65 | + if ($user_admin) { |
|
66 | + $ally_range = '<select onchange="window.location=\'alliance.php?mode=admin&edit=members&id_user='.$userRow['id'].'&id_rank=\' + this.value">'; |
|
67 | 67 | |
68 | - foreach($ranks as $rankID => $rankArray) { |
|
69 | - $ally_range .= '<option value="' . $rankID . '"'; |
|
70 | - if($rankID == $userRow['ally_rank_id']) { |
|
68 | + foreach ($ranks as $rankID => $rankArray) { |
|
69 | + $ally_range .= '<option value="'.$rankID.'"'; |
|
70 | + if ($rankID == $userRow['ally_rank_id']) { |
|
71 | 71 | $ally_range .= " selected"; |
72 | 72 | } |
73 | - $ally_range .= '>' . $rankArray['name']; |
|
73 | + $ally_range .= '>'.$rankArray['name']; |
|
74 | 74 | $ally_range .= '</option>'; |
75 | 75 | } |
76 | 76 | $ally_range .= '</select>'; |
@@ -80,20 +80,20 @@ discard block |
||
80 | 80 | } |
81 | 81 | |
82 | 82 | $last_active = time() - $userRow["onlinetime"]; |
83 | - if($user_admin) { |
|
84 | - if($last_active < 60) { |
|
83 | + if ($user_admin) { |
|
84 | + if ($last_active < 60) { |
|
85 | 85 | $tmp = "lime>{$classLocale['On']}"; |
86 | - } elseif($last_active < 60 * 60) { |
|
86 | + } elseif ($last_active < 60 * 60) { |
|
87 | 87 | $last_active = round($last_active / 60); |
88 | 88 | $tmp = "lime>{$last_active} {$classLocale['sys_min_short']}"; |
89 | - } elseif($last_active < 60 * 60 * 24) { |
|
89 | + } elseif ($last_active < 60 * 60 * 24) { |
|
90 | 90 | $last_active = round($last_active / (60 * 60)); |
91 | 91 | $tmp = "green>{$last_active} {$classLocale['sys_hrs_short']}"; |
92 | 92 | } else { |
93 | 93 | $last_active = round($last_active / (60 * 60 * 24)); |
94 | - if($last_active < 7) { |
|
94 | + if ($last_active < 7) { |
|
95 | 95 | $tmp = "yellow"; |
96 | - } elseif($last_active < 30) { |
|
96 | + } elseif ($last_active < 30) { |
|
97 | 97 | $tmp = "orange"; |
98 | 98 | } else { |
99 | 99 | $tmp = "red"; |
@@ -101,10 +101,10 @@ discard block |
||
101 | 101 | $tmp .= ">{$last_active} {$classLocale['sys_day_short']}"; |
102 | 102 | } |
103 | 103 | } else { |
104 | - if($user_onlinestatus) { |
|
105 | - if($last_active < 60 * 5) { |
|
104 | + if ($user_onlinestatus) { |
|
105 | + if ($last_active < 60 * 5) { |
|
106 | 106 | $tmp = "lime>{$classLocale['On']}"; |
107 | - } elseif($last_active < 60 * 15) { |
|
107 | + } elseif ($last_active < 60 * 15) { |
|
108 | 108 | $tmp = "yellow>{$classLocale['ali_lessThen15min']}"; |
109 | 109 | } else { |
110 | 110 | $tmp = "red>{$classLocale['Off']}"; |
@@ -124,21 +124,21 @@ discard block |
||
124 | 124 | 'SYSTEM' => $userRow['system'], |
125 | 125 | 'PLANET' => $userRow['planet'], |
126 | 126 | 'POINTS' => pretty_number($userRow['total_points']), |
127 | - 'ONLINE' => '<font color=' . $tmp . '</font>', |
|
127 | + 'ONLINE' => '<font color='.$tmp.'</font>', |
|
128 | 128 | 'RANK' => $ally_range, |
129 | 129 | 'REGISTER_TIME' => date(FMT_DATE_TIME, $userRow['ally_register_time']), |
130 | 130 | 'SHOW_KICK' => $user['id'] != $userRow['id'] && $ally['ally_owner'] != $userRow['id'], |
131 | 131 | )); |
132 | 132 | } |
133 | 133 | |
134 | -if($i != $ally['ally_members']) { |
|
134 | +if ($i != $ally['ally_members']) { |
|
135 | 135 | db_ally_update_member_set($i, $ally); |
136 | 136 | } |
137 | 137 | |
138 | 138 | $template->assign_vars(array( |
139 | - 'mode' => $mode . ($edit ? "&edit=" . $edit : ''), |
|
139 | + 'mode' => $mode.($edit ? "&edit=".$edit : ''), |
|
140 | 140 | 'ADMIN_MODE' => $user_can_kick, |
141 | - 'dpath' => SN_ROOT_VIRTUAL . $dpath, |
|
141 | + 'dpath' => SN_ROOT_VIRTUAL.$dpath, |
|
142 | 142 | 'onlineMessage' => $user_admin ? classLocale::$lang['ali_sys_lastActive'] : classLocale::$lang['Online'], |
143 | 143 | 'memberCount' => count($userList), |
144 | 144 | 'memberslist' => $page_list, |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | $unit_level = $artifact_level_old = mrc_get_level($user, null, $unit_id, true); |
14 | 14 | if ($unit_level > 0) { |
15 | 15 | $db_changeset = array(); |
16 | - switch($unit_id) { |
|
16 | + switch ($unit_id) { |
|
17 | 17 | case ART_LHC: |
18 | 18 | case ART_HOOK_SMALL: |
19 | 19 | case ART_HOOK_MEDIUM: |
@@ -133,6 +133,6 @@ discard block |
||
133 | 133 | |
134 | 134 | sn_db_transaction_commit(); |
135 | 135 | message($message, "{$classLocale['tech'][UNIT_ARTIFACTS]} - {$classLocale['tech'][$unit_id]}", |
136 | - ($request_uri = sys_get_param_str_unsafe('REQUEST_URI')) ? $request_uri : ('artifacts' . DOT_PHP_EX . '#' . $unit_id), |
|
136 | + ($request_uri = sys_get_param_str_unsafe('REQUEST_URI')) ? $request_uri : ('artifacts'.DOT_PHP_EX.'#'.$unit_id), |
|
137 | 137 | 5); |
138 | 138 | } |
@@ -19,15 +19,11 @@ discard block |
||
19 | 19 | // ------------------------------------------------------------------ |
20 | 20 | function flt_flyingFleetsSort($a, $b) { |
21 | 21 | // Сравниваем время флотов - кто раньше, тот и первый обрабатывается |
22 | - return $a['fleet_time'] > $b['fleet_time'] ? 1 : ($a['fleet_time'] < $b['fleet_time'] ? -1 : |
|
23 | - // Если время - одинаковое, сравниваем события флотов |
|
22 | + return $a['fleet_time'] > $b['fleet_time'] ? 1 : ($a['fleet_time'] < $b['fleet_time'] ? -1 : // Если время - одинаковое, сравниваем события флотов |
|
24 | 23 | // Если события - одинаковые, то флоты равны |
25 | - ($a['fleet_event'] == $b['fleet_event'] ? 0 : |
|
26 | - // Если события разные - первыми считаем прибывающие флоты |
|
27 | - ($a['fleet_event'] == EVENT_FLT_ARRIVE ? 1 : ($b['fleet_event'] == EVENT_FLT_ARRIVE ? -1 : |
|
28 | - // Если нет прибывающих флотов - дальше считаем флоты, которые закончили миссию |
|
29 | - ($a['fleet_event'] == EVENT_FLT_ACOMPLISH ? 1 : ($b['fleet_event'] == EVENT_FLT_ACOMPLISH ? -1 : |
|
30 | - // Если нет флотов, закончивших задание - остались возвращающиеся флоты, которые равны между собой |
|
24 | + ($a['fleet_event'] == $b['fleet_event'] ? 0 : // Если события разные - первыми считаем прибывающие флоты |
|
25 | + ($a['fleet_event'] == EVENT_FLT_ARRIVE ? 1 : ($b['fleet_event'] == EVENT_FLT_ARRIVE ? -1 : // Если нет прибывающих флотов - дальше считаем флоты, которые закончили миссию |
|
26 | + ($a['fleet_event'] == EVENT_FLT_ACOMPLISH ? 1 : ($b['fleet_event'] == EVENT_FLT_ACOMPLISH ? -1 : // Если нет флотов, закончивших задание - остались возвращающиеся флоты, которые равны между собой |
|
31 | 27 | // TODO: Добавить еще проверку по ID флота и/или времени запуска - что бы обсчитывать их в порядке запуска |
32 | 28 | ( |
33 | 29 | 0 // Вообще сюда доходить не должно - будет отсекаться на равенстве событий |
@@ -45,13 +41,13 @@ discard block |
||
45 | 41 | $handler = fopen('event.log', 'a+'); |
46 | 42 | } |
47 | 43 | |
48 | - fwrite($handler, date(FMT_DATE_TIME_SQL, time()) . ' ' . $msg . "\r\n"); |
|
44 | + fwrite($handler, date(FMT_DATE_TIME_SQL, time()).' '.$msg."\r\n"); |
|
49 | 45 | } |
50 | 46 | |
51 | 47 | // ------------------------------------------------------------------ |
52 | 48 | function flt_flying_fleet_handler($skip_fleet_update = false) { |
53 | 49 | if (true) { |
54 | - if(!defined('IN_AJAX')) { |
|
50 | + if (!defined('IN_AJAX')) { |
|
55 | 51 | print('<div style="color: red; font-size: 300%">Fleet handler is disabled</div>'); |
56 | 52 | pdump('Fleet handler is disabled'); |
57 | 53 | } |
@@ -177,7 +173,7 @@ discard block |
||
177 | 173 | MT_EXPLORE => 'flt_mission_explore', |
178 | 174 | ); |
179 | 175 | foreach ($missions_used as $mission_id => $cork) { |
180 | - require_once(SN_ROOT_PHYSICAL . "includes/includes/{$mission_files[$mission_id]}" . DOT_PHP_EX); |
|
176 | + require_once(SN_ROOT_PHYSICAL."includes/includes/{$mission_files[$mission_id]}".DOT_PHP_EX); |
|
181 | 177 | } |
182 | 178 | |
183 | 179 | //log_file('Обработка миссий'); |
@@ -45,8 +45,8 @@ |
||
45 | 45 | */ |
46 | 46 | protected function quoteStringAsFieldByRef(&$string) { |
47 | 47 | $string = $this->stringEscape($string); |
48 | - if ((string)$string && '*' != $string) { |
|
49 | - $string = '`' . $string . '`'; |
|
48 | + if ((string) $string && '*' != $string) { |
|
49 | + $string = '`'.$string.'`'; |
|
50 | 50 | } |
51 | 51 | } |
52 | 52 |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | * @return $this |
32 | 32 | */ |
33 | 33 | public function literal($value) { |
34 | - $this->literal = (string)$value; |
|
34 | + $this->literal = (string) $value; |
|
35 | 35 | |
36 | 36 | return $this; |
37 | 37 | } |
@@ -64,10 +64,10 @@ discard block |
||
64 | 64 | $alias = $this->aliasFromField($functionName, $field); |
65 | 65 | } |
66 | 66 | |
67 | - $this->literal = strtoupper($functionName) . '(' . $this->quoteField($field) . ')'; |
|
67 | + $this->literal = strtoupper($functionName).'('.$this->quoteField($field).')'; |
|
68 | 68 | |
69 | 69 | if (self::SQL_LITERAL_ALIAS_NONE !== $alias && !empty($alias)) { |
70 | - $this->literal .= ' AS `' . $alias . '`'; |
|
70 | + $this->literal .= ' AS `'.$alias.'`'; |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | return $this; |
@@ -124,10 +124,10 @@ discard block |
||
124 | 124 | $alias = $this->aliasFromField($functionName, $field); |
125 | 125 | } |
126 | 126 | |
127 | - $this->literal = $this->quoteField($field) . ' IS NULL'; |
|
127 | + $this->literal = $this->quoteField($field).' IS NULL'; |
|
128 | 128 | |
129 | 129 | if (!empty($alias)) { |
130 | - $this->literal .= ' AS `' . $alias . '`'; |
|
130 | + $this->literal .= ' AS `'.$alias.'`'; |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | return $this; |
@@ -15,13 +15,13 @@ |
||
15 | 15 | * @return string |
16 | 16 | */ |
17 | 17 | public static function quoteComment($comment) { |
18 | - if($comment == '') { |
|
18 | + if ($comment == '') { |
|
19 | 19 | return ''; |
20 | 20 | } |
21 | 21 | |
22 | - $comment = str_replace(array('/*', '*/'), '__',$comment); |
|
22 | + $comment = str_replace(array('/*', '*/'), '__', $comment); |
|
23 | 23 | |
24 | - return "\r\n/*" . $comment . "*/"; |
|
24 | + return "\r\n/*".$comment."*/"; |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | } |
@@ -77,8 +77,8 @@ discard block |
||
77 | 77 | $crystal += $destroyed * $unit_info[P_COST][RES_CRYSTAL] / 4; |
78 | 78 | } |
79 | 79 | |
80 | - $return['structures'] = $structures; // Structures left after attack |
|
81 | - $return['metal'] = floor($metal); // Metal scraps |
|
80 | + $return['structures'] = $structures; // Structures left after attack |
|
81 | + $return['metal'] = floor($metal); // Metal scraps |
|
82 | 82 | $return['crystal'] = floor($crystal); // Crystal scraps |
83 | 83 | |
84 | 84 | return $return; |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | } |
149 | 149 | |
150 | 150 | if (!empty($message)) { |
151 | - $message = classLocale::$lang['mip_defense_destroyed'] . $message . "{$classLocale['mip_recycled']}{$classLocale['Metal']}: {$attackResult['metal']}, {$classLocale['Crystal']}: {$attackResult['crystal']}<br>"; |
|
151 | + $message = classLocale::$lang['mip_defense_destroyed'].$message."{$classLocale['mip_recycled']}{$classLocale['Metal']}: {$attackResult['metal']}, {$classLocale['Crystal']}: {$attackResult['crystal']}<br>"; |
|
152 | 152 | |
153 | 153 | DBStaticPlanet::db_planet_set_by_id($target_planet_row['id'], "`metal` = `metal` + {$attackResult['metal']}, `crystal` = `crystal` + {$attackResult['crystal']}"); |
154 | 154 | } |
@@ -165,8 +165,8 @@ discard block |
||
165 | 165 | |
166 | 166 | empty($message) ? $message = classLocale::$lang['mip_no_defense'] : false; |
167 | 167 | |
168 | - DBStaticMessages::msg_send_simple_message($fleetRow['fleet_owner'], '', SN_TIME_NOW, MSG_TYPE_SPY, classLocale::$lang['mip_sender_amd'], classLocale::$lang['mip_subject_amd'], $message_vorlage . $message); |
|
169 | - DBStaticMessages::msg_send_simple_message($fleetRow['fleet_target_owner'], '', SN_TIME_NOW, MSG_TYPE_SPY, classLocale::$lang['mip_sender_amd'], classLocale::$lang['mip_subject_amd'], $message_vorlage . $message); |
|
168 | + DBStaticMessages::msg_send_simple_message($fleetRow['fleet_owner'], '', SN_TIME_NOW, MSG_TYPE_SPY, classLocale::$lang['mip_sender_amd'], classLocale::$lang['mip_subject_amd'], $message_vorlage.$message); |
|
169 | + DBStaticMessages::msg_send_simple_message($fleetRow['fleet_target_owner'], '', SN_TIME_NOW, MSG_TYPE_SPY, classLocale::$lang['mip_sender_amd'], classLocale::$lang['mip_subject_amd'], $message_vorlage.$message); |
|
170 | 170 | } |
171 | 171 | DBStaticFleetMissile::db_missile_delete($fleetRow); |
172 | 172 | } |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
3 | +include('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
4 | 4 | |
5 | 5 | $template = gettemplate('viewreport', true); |
6 | 6 | $template->assign_var('PAGE_HINT', classLocale::$lang['cr_view_hint']); |
@@ -1,15 +1,15 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
3 | +include('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
4 | 4 | |
5 | 5 | global $user; |
6 | 6 | |
7 | -if($user['authlevel'] < AUTH_LEVEL_DEVELOPER) { |
|
7 | +if ($user['authlevel'] < AUTH_LEVEL_DEVELOPER) { |
|
8 | 8 | $error_message = classSupernova::$config->game_mode == GAME_BLITZ ? 'sys_blitz_page_disabled' : ( |
9 | 9 | !classSupernova::$config->game_blitz_register ? 'sys_blitz_registration_disabled' : '' |
10 | 10 | ); |
11 | 11 | |
12 | - if($error_message) { |
|
12 | + if ($error_message) { |
|
13 | 13 | message(classLocale::$lang[$error_message], classLocale::$lang['sys_error'], 'overview.php', 10); |
14 | 14 | die(); |
15 | 15 | } |
@@ -18,16 +18,16 @@ discard block |
||
18 | 18 | $current_round = intval(classSupernova::$config->db_loadItem('game_blitz_register_round')); |
19 | 19 | $current_price = intval(classSupernova::$config->db_loadItem('game_blitz_register_price')); |
20 | 20 | |
21 | -if(classSupernova::$config->db_loadItem('game_blitz_register') == BLITZ_REGISTER_OPEN && (sys_get_param_str('register_me') || sys_get_param_str('register_me_not'))) { |
|
21 | +if (classSupernova::$config->db_loadItem('game_blitz_register') == BLITZ_REGISTER_OPEN && (sys_get_param_str('register_me') || sys_get_param_str('register_me_not'))) { |
|
22 | 22 | sn_db_transaction_start(); |
23 | 23 | $user = DBStaticUser::db_user_by_id($user['id'], true); |
24 | 24 | $is_registered = db_blitz_reg_get_id_by_player_and_round($user, $current_round); |
25 | - if(sys_get_param_str('register_me')) { |
|
26 | - if(empty($is_registered) && mrc_get_level($user, null, RES_METAMATTER) >= $current_price) { |
|
25 | + if (sys_get_param_str('register_me')) { |
|
26 | + if (empty($is_registered) && mrc_get_level($user, null, RES_METAMATTER) >= $current_price) { |
|
27 | 27 | db_blitz_reg_insert($user, $current_round); |
28 | 28 | classSupernova::$auth->account->metamatter_change(RPG_BLITZ_REGISTRATION, -$current_price, "Регистрация в раунде {$current_round} Блица"); |
29 | 29 | } |
30 | - } elseif(sys_get_param_str('register_me_not') && !empty($is_registered)) { |
|
30 | + } elseif (sys_get_param_str('register_me_not') && !empty($is_registered)) { |
|
31 | 31 | db_blitz_reg_delete($user, $current_round); |
32 | 32 | classSupernova::$auth->account->metamatter_change(RPG_BLITZ_REGISTRATION_CANCEL, $current_price, "Отмена регистрации в раунде {$current_round} Блица"); |
33 | 33 | } |
@@ -42,17 +42,17 @@ discard block |
||
42 | 42 | $blitz_players = 0; |
43 | 43 | $blitz_prize_dark_matter = 0; |
44 | 44 | $blitz_prize_places = 0; |
45 | -if($user['authlevel'] >= AUTH_LEVEL_DEVELOPER) { |
|
46 | - if(sys_get_param_str('generate')) { |
|
45 | +if ($user['authlevel'] >= AUTH_LEVEL_DEVELOPER) { |
|
46 | + if (sys_get_param_str('generate')) { |
|
47 | 47 | $next_id = 0; |
48 | 48 | $query = db_blitz_reg_get_random_id($current_round); |
49 | - while($row = db_fetch($query)) { |
|
49 | + while ($row = db_fetch($query)) { |
|
50 | 50 | $next_id++; |
51 | - $blitz_name = 'Игрок' . $next_id; |
|
51 | + $blitz_name = 'Игрок'.$next_id; |
|
52 | 52 | $blitz_password = sys_random_string(8); |
53 | 53 | db_blitz_reg_update_with_name_and_password($blitz_name, $blitz_password, $row, $current_round); |
54 | 54 | } |
55 | - } elseif(sys_get_param_str('import_generated')) { |
|
55 | + } elseif (sys_get_param_str('import_generated')) { |
|
56 | 56 | // ЭТО НА БЛИЦЕ!!! |
57 | 57 | DBStaticUser::db_player_list_blitz_delete_players(); |
58 | 58 | DBStaticPlanet::db_planets_purge(); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | $system = $system_step; |
75 | 75 | $planet = round(Vector::$knownPlanets / 2); |
76 | 76 | |
77 | - foreach($imported_string as &$string_data) { |
|
77 | + foreach ($imported_string as &$string_data) { |
|
78 | 78 | $string_data = explode(',', $string_data); |
79 | 79 | $username_safe = $string_data[0]; |
80 | 80 | |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | |
95 | 95 | $moon_row = uni_create_moon($galaxy, $system, $planet, $user_new['id'], 30, '', false); |
96 | 96 | |
97 | - if(($system += $system_step) >= Vector::$knownSystems) { |
|
97 | + if (($system += $system_step) >= Vector::$knownSystems) { |
|
98 | 98 | $galaxy++; |
99 | 99 | $system = $system_step; |
100 | 100 | } |
@@ -104,13 +104,13 @@ discard block |
||
104 | 104 | classSupernova::$config->db_saveItem('users_amount', classSupernova::$config->users_amount + $new_players); |
105 | 105 | // pdump($imported_string); |
106 | 106 | // generated_string |
107 | - } elseif(sys_get_param_str('import_result') && ($blitz_result_string = sys_get_param_str('blitz_result_string'))) { |
|
107 | + } elseif (sys_get_param_str('import_result') && ($blitz_result_string = sys_get_param_str('blitz_result_string'))) { |
|
108 | 108 | $blitz_result = explode(';', $blitz_result_string); |
109 | 109 | $blitz_last_update = $blitz_result[0]; // Пока не используется |
110 | 110 | unset($blitz_result[0]); |
111 | - foreach($blitz_result as $blitz_result_data) { |
|
111 | + foreach ($blitz_result as $blitz_result_data) { |
|
112 | 112 | $blitz_result_data = explode(',', $blitz_result_data); |
113 | - if(count($blitz_result_data) == 5) { |
|
113 | + if (count($blitz_result_data) == 5) { |
|
114 | 114 | $blitz_result_data[1] = db_escape($blitz_result_data[1]); |
115 | 115 | db_blitz_reg_update_results($blitz_result_data, $current_round); |
116 | 116 | } |
@@ -118,14 +118,14 @@ discard block |
||
118 | 118 | $blitz_result = array(); |
119 | 119 | } |
120 | 120 | |
121 | - if(classSupernova::$config->game_mode == GAME_BLITZ) { |
|
121 | + if (classSupernova::$config->game_mode == GAME_BLITZ) { |
|
122 | 122 | $blitz_result = array(classSupernova::$config->db_loadItem('var_stat_update')); |
123 | - foreach(DBStaticUser::db_player_list_export_blitz_info() as $row) { |
|
123 | + foreach (DBStaticUser::db_player_list_export_blitz_info() as $row) { |
|
124 | 124 | $blitz_result[] = "{$row['id']},{$row['username']},{$row['onlinetime']},{$row['total_rank']},{$row['total_points']}"; |
125 | 125 | } |
126 | 126 | } else { |
127 | 127 | $query = db_blitz_reg_get_player_list($current_round); |
128 | - while($row = db_fetch($query)) { |
|
128 | + while ($row = db_fetch($query)) { |
|
129 | 129 | $blitz_generated[] = "{$row['blitz_name']},{$row['blitz_password']}"; |
130 | 130 | $row['blitz_online'] ? $blitz_prize_players_active++ : false; |
131 | 131 | $blitz_players++; |
@@ -133,13 +133,13 @@ discard block |
||
133 | 133 | $blitz_prize_dark_matter = $blitz_prize_players_active * 20000; |
134 | 134 | $blitz_prize_places = ceil($blitz_prize_players_active / 5); |
135 | 135 | |
136 | - if(sys_get_param_str('prize_calculate') && $blitz_prize_players_active && ($blitz_prize_dark_matter_actual = sys_get_param_int('blitz_prize_dark_matter'))) { |
|
136 | + if (sys_get_param_str('prize_calculate') && $blitz_prize_players_active && ($blitz_prize_dark_matter_actual = sys_get_param_int('blitz_prize_dark_matter'))) { |
|
137 | 137 | // $blitz_prize_dark_matter_actual = sys_get_param_int('blitz_prize_dark_matter'); |
138 | 138 | $blitz_prize_places_actual = sys_get_param_int('blitz_prize_places'); |
139 | 139 | sn_db_transaction_start(); |
140 | 140 | $query = db_blitz_reg_get_player_list_order_by_place($current_round); |
141 | - while($row = db_fetch($query)) { |
|
142 | - if(!$row['blitz_place']) { |
|
141 | + while ($row = db_fetch($query)) { |
|
142 | + if (!$row['blitz_place']) { |
|
143 | 143 | continue; |
144 | 144 | } |
145 | 145 | |
@@ -148,14 +148,14 @@ discard block |
||
148 | 148 | |
149 | 149 | $reward = $blitz_prize_dark_matter_actual - $row['blitz_reward_dark_matter']; |
150 | 150 | pdump("{{$row['id']}} {$row['blitz_name']}, Place {$row['blitz_place']}, Prize places {$blitz_prize_places_actual}, Prize {$reward}", $row['id']); |
151 | - if($reward) { |
|
151 | + if ($reward) { |
|
152 | 152 | rpg_points_change($row['user_id'], RPG_BLITZ, $reward, sprintf( |
153 | 153 | classLocale::$lang['sys_blitz_reward_log_message'], $row['blitz_place'], $row['blitz_name'] |
154 | 154 | )); |
155 | 155 | db_blitz_reg_update_apply_results($reward, $row, $current_round); |
156 | 156 | } |
157 | 157 | |
158 | - if(!$blitz_prize_places_actual || $blitz_prize_dark_matter_actual < 1000) { |
|
158 | + if (!$blitz_prize_places_actual || $blitz_prize_dark_matter_actual < 1000) { |
|
159 | 159 | break; |
160 | 160 | } |
161 | 161 | } |
@@ -170,12 +170,12 @@ discard block |
||
170 | 170 | |
171 | 171 | $player_registered = false; |
172 | 172 | $query = db_blitz_reg_get_player_list_and_users($current_round); |
173 | -while($row = db_fetch($query)) { |
|
173 | +while ($row = db_fetch($query)) { |
|
174 | 174 | $tpl_player_data = array( |
175 | 175 | 'NAME' => player_nick_render_to_html($row, array('icons' => true, 'color' => true, 'ally' => true)), |
176 | 176 | ); |
177 | 177 | |
178 | - if(classSupernova::$config->game_blitz_register == BLITZ_REGISTER_DISCLOSURE_NAMES) { |
|
178 | + if (classSupernova::$config->game_blitz_register == BLITZ_REGISTER_DISCLOSURE_NAMES) { |
|
179 | 179 | // Вот так хитро, что бы не было не единого шанса попадания на страницу данных об игроках Блиц-сервера до закрытия раунда |
180 | 180 | $tpl_player_data = array_merge($tpl_player_data, array( |
181 | 181 | 'ID' => $row['id'], |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | } |
189 | 189 | |
190 | 190 | $template->assign_block_vars('registrations', $tpl_player_data); |
191 | - if($row['id'] == $user['id']) { |
|
191 | + if ($row['id'] == $user['id']) { |
|
192 | 192 | $player_registered = $row; |
193 | 193 | } |
194 | 194 | } |