We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -30,7 +30,7 @@ |
||
30 | 30 | $query = "SELECT table_name FROM information_schema.tables WHERE table_rows > 0 AND TABLE_SCHEMA='smr_live'"; |
31 | 31 | $rs = self::$conn->query($query); |
32 | 32 | $all = $rs->fetch_all(); |
33 | - array_walk_recursive($all, function ($a) { |
|
33 | + array_walk_recursive($all, function($a) { |
|
34 | 34 | self::$defaultPopulatedTables[] = "'" . $a . "'"; |
35 | 35 | }); |
36 | 36 | } |
@@ -1,14 +1,14 @@ discard block |
||
1 | 1 | <?php declare(strict_types=1); |
2 | 2 | |
3 | 3 | //first create the game |
4 | -$db->query('SELECT game_id FROM game WHERE game_name='.$db->escapeString(Request::get('game_name')).' LIMIT 1'); |
|
4 | +$db->query('SELECT game_id FROM game WHERE game_name=' . $db->escapeString(Request::get('game_name')) . ' LIMIT 1'); |
|
5 | 5 | if ($db->nextRecord()) { |
6 | 6 | create_error('That game name is already taken.'); |
7 | 7 | } |
8 | 8 | |
9 | 9 | $db->query('SELECT game_id FROM game ORDER BY game_id DESC LIMIT 1'); |
10 | 10 | if ($db->nextRecord()) { |
11 | - $newID = $db->getInt('game_id')+1; |
|
11 | + $newID = $db->getInt('game_id') + 1; |
|
12 | 12 | } else { |
13 | 13 | $newID = 1; |
14 | 14 | } |
@@ -18,8 +18,7 @@ discard block |
||
18 | 18 | if ($join === false) { |
19 | 19 | create_error('Join Date is not valid!'); |
20 | 20 | } |
21 | -$start = empty(Request::get('game_start')) ? $join : |
|
22 | - DateTime::createFromFormat('d/m/Y|', Request::get('game_start')); |
|
21 | +$start = empty(Request::get('game_start')) ? $join : DateTime::createFromFormat('d/m/Y|', Request::get('game_start')); |
|
23 | 22 | if ($start === false) { |
24 | 23 | create_error('Start Date is not valid!'); |
25 | 24 | } |
@@ -2,8 +2,7 @@ |
||
2 | 2 | |
3 | 3 | // Get the dates ("|" sets hr/min/sec to 0) |
4 | 4 | $join = DateTime::createFromFormat('d/m/Y|', Request::get('game_join')); |
5 | -$start = empty(Request::get('game_start')) ? $join : |
|
6 | - DateTime::createFromFormat('d/m/Y|', Request::get('game_start')); |
|
5 | +$start = empty(Request::get('game_start')) ? $join : DateTime::createFromFormat('d/m/Y|', Request::get('game_start')); |
|
7 | 6 | $end = DateTime::createFromFormat('d/m/Y|', Request::get('game_end')); |
8 | 7 | |
9 | 8 | $game = SmrGame::getGame($var['game_id']); |
@@ -21,14 +21,14 @@ discard block |
||
21 | 21 | $game_id = $var['delete_game_id']; |
22 | 22 | |
23 | 23 | if ($save) { |
24 | - $db->query('SELECT * FROM alliance WHERE game_id = '.$db->escapeNumber($game_id)); |
|
24 | + $db->query('SELECT * FROM alliance WHERE game_id = ' . $db->escapeNumber($game_id)); |
|
25 | 25 | |
26 | 26 | while ($db->nextRecord()) { |
27 | 27 | $id = $db->getInt('alliance_id'); |
28 | 28 | //we need info for forces |
29 | 29 | //populate alliance list |
30 | 30 | $db2->query('SELECT * FROM player |
31 | - WHERE alliance_id = '.$db2->escapeNumber($id).' |
|
31 | + WHERE alliance_id = '.$db2->escapeNumber($id) . ' |
|
32 | 32 | AND game_id = '.$db2->escapeNumber($game_id)); |
33 | 33 | $list = array(0); |
34 | 34 | while ($db2->nextRecord()) { |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | } |
37 | 37 | $db2->query('SELECT sum(mines) as sum_m, sum(combat_drones) as cds, sum(scout_drones) as sds |
38 | 38 | FROM sector_has_forces |
39 | - WHERE owner_id IN ('.$db2->escapeArray($list).') AND game_id = '.$db2->escapeNumber($game_id)); |
|
39 | + WHERE owner_id IN ('.$db2->escapeArray($list) . ') AND game_id = ' . $db2->escapeNumber($game_id)); |
|
40 | 40 | if ($db2->nextRecord()) { |
41 | 41 | |
42 | 42 | $mines = $db2->getInt('sum_m'); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | $deaths = $db->getInt('alliance_deaths'); |
57 | 57 | // insert into history db |
58 | 58 | $history_db_sql[] = 'INSERT INTO alliance (game_id, alliance_id, leader_id, kills, deaths, alliance_name, mines, cds, sds) ' . |
59 | - 'VALUES ('.$db->escapeNumber($game_id).', '.$db->escapeNumber($id).', '.$db->escapeNumber($leader).', '.$db->escapeNumber($kills).', '.$db->escapeNumber($deaths).', ' . $db->escapeString($name) . ', '.$db->escapeNumber($mines).', '.$db->escapeNumber($cds).', '.$db->escapeNumber($sds).')'; |
|
59 | + 'VALUES (' . $db->escapeNumber($game_id) . ', ' . $db->escapeNumber($id) . ', ' . $db->escapeNumber($leader) . ', ' . $db->escapeNumber($kills) . ', ' . $db->escapeNumber($deaths) . ', ' . $db->escapeString($name) . ', ' . $db->escapeNumber($mines) . ', ' . $db->escapeNumber($cds) . ', ' . $db->escapeNumber($sds) . ')'; |
|
60 | 60 | |
61 | 61 | } |
62 | 62 | |
@@ -65,56 +65,56 @@ discard block |
||
65 | 65 | // these table is nothing worth without the players |
66 | 66 | //$smr_db_sql[] = 'DELETE FROM account_has_logs WHERE game_id = '.$game_id; |
67 | 67 | |
68 | - $smr_db_sql[] = 'UPDATE active_session SET game_id = 0 WHERE game_id = '.$db->escapeNumber($game_id); |
|
69 | - $smr_db_sql[] = 'DELETE FROM alliance WHERE game_id = '.$db->escapeNumber($game_id); |
|
70 | - $smr_db_sql[] = 'DELETE FROM alliance_bank_transactions WHERE game_id = '.$db->escapeNumber($game_id); |
|
71 | - $smr_db_sql[] = 'DELETE FROM alliance_has_roles WHERE game_id = '.$db->escapeNumber($game_id); |
|
72 | - $smr_db_sql[] = 'DELETE FROM alliance_thread WHERE game_id = '.$db->escapeNumber($game_id); |
|
73 | - $smr_db_sql[] = 'DELETE FROM alliance_thread_topic WHERE game_id = '.$db->escapeNumber($game_id); |
|
68 | + $smr_db_sql[] = 'UPDATE active_session SET game_id = 0 WHERE game_id = ' . $db->escapeNumber($game_id); |
|
69 | + $smr_db_sql[] = 'DELETE FROM alliance WHERE game_id = ' . $db->escapeNumber($game_id); |
|
70 | + $smr_db_sql[] = 'DELETE FROM alliance_bank_transactions WHERE game_id = ' . $db->escapeNumber($game_id); |
|
71 | + $smr_db_sql[] = 'DELETE FROM alliance_has_roles WHERE game_id = ' . $db->escapeNumber($game_id); |
|
72 | + $smr_db_sql[] = 'DELETE FROM alliance_thread WHERE game_id = ' . $db->escapeNumber($game_id); |
|
73 | + $smr_db_sql[] = 'DELETE FROM alliance_thread_topic WHERE game_id = ' . $db->escapeNumber($game_id); |
|
74 | 74 | |
75 | 75 | if ($save) { |
76 | 76 | |
77 | - $db->query('SELECT * FROM alliance_vs_alliance WHERE game_id = '.$db->escapeNumber($game_id)); |
|
77 | + $db->query('SELECT * FROM alliance_vs_alliance WHERE game_id = ' . $db->escapeNumber($game_id)); |
|
78 | 78 | while ($db->nextRecord()) { |
79 | 79 | |
80 | 80 | $alliance_1 = $db->getInt('alliance_id_1'); |
81 | 81 | $alliance_2 = $db->getInt('alliance_id_2'); |
82 | 82 | $kills = $db->getInt('kills'); |
83 | 83 | $history_db_sql[] = 'INSERT INTO alliance_vs_alliance (game_id, alliance_id_1, alliance_id_2, kills) ' . |
84 | - 'VALUES ('.$game_id.', '.$alliance_1.', '.$alliance_2.', '.$kills.')'; |
|
84 | + 'VALUES (' . $game_id . ', ' . $alliance_1 . ', ' . $alliance_2 . ', ' . $kills . ')'; |
|
85 | 85 | |
86 | 86 | } |
87 | 87 | |
88 | 88 | } |
89 | 89 | |
90 | 90 | |
91 | - $smr_db_sql[] = 'DELETE FROM alliance_vs_alliance WHERE game_id = '.$db->escapeNumber($game_id); |
|
92 | - $smr_db_sql[] = 'DELETE FROM anon_bank WHERE game_id = '.$db->escapeNumber($game_id); |
|
93 | - $smr_db_sql[] = 'DELETE FROM anon_bank_transactions WHERE game_id = '.$db->escapeNumber($game_id); |
|
94 | - $smr_db_sql[] = 'DELETE FROM bar_tender WHERE game_id = '.$db->escapeNumber($game_id); |
|
95 | - $smr_db_sql[] = 'DELETE FROM blackjack WHERE game_id = '.$db->escapeNumber($game_id); |
|
96 | - $smr_db_sql[] = 'DELETE FROM galactic_post_applications WHERE game_id = '.$db->escapeNumber($game_id); |
|
97 | - $smr_db_sql[] = 'DELETE FROM galactic_post_article WHERE game_id = '.$db->escapeNumber($game_id); |
|
98 | - $smr_db_sql[] = 'DELETE FROM galactic_post_paper WHERE game_id = '.$db->escapeNumber($game_id); |
|
99 | - $smr_db_sql[] = 'DELETE FROM galactic_post_paper_content WHERE game_id = '.$db->escapeNumber($game_id); |
|
100 | - $smr_db_sql[] = 'DELETE FROM galactic_post_writer WHERE game_id = '.$db->escapeNumber($game_id); |
|
101 | - $smr_db_sql[] = 'DELETE FROM game_galaxy WHERE game_id = '.$db->escapeNumber($game_id); |
|
91 | + $smr_db_sql[] = 'DELETE FROM alliance_vs_alliance WHERE game_id = ' . $db->escapeNumber($game_id); |
|
92 | + $smr_db_sql[] = 'DELETE FROM anon_bank WHERE game_id = ' . $db->escapeNumber($game_id); |
|
93 | + $smr_db_sql[] = 'DELETE FROM anon_bank_transactions WHERE game_id = ' . $db->escapeNumber($game_id); |
|
94 | + $smr_db_sql[] = 'DELETE FROM bar_tender WHERE game_id = ' . $db->escapeNumber($game_id); |
|
95 | + $smr_db_sql[] = 'DELETE FROM blackjack WHERE game_id = ' . $db->escapeNumber($game_id); |
|
96 | + $smr_db_sql[] = 'DELETE FROM galactic_post_applications WHERE game_id = ' . $db->escapeNumber($game_id); |
|
97 | + $smr_db_sql[] = 'DELETE FROM galactic_post_article WHERE game_id = ' . $db->escapeNumber($game_id); |
|
98 | + $smr_db_sql[] = 'DELETE FROM galactic_post_paper WHERE game_id = ' . $db->escapeNumber($game_id); |
|
99 | + $smr_db_sql[] = 'DELETE FROM galactic_post_paper_content WHERE game_id = ' . $db->escapeNumber($game_id); |
|
100 | + $smr_db_sql[] = 'DELETE FROM galactic_post_writer WHERE game_id = ' . $db->escapeNumber($game_id); |
|
101 | + $smr_db_sql[] = 'DELETE FROM game_galaxy WHERE game_id = ' . $db->escapeNumber($game_id); |
|
102 | 102 | |
103 | 103 | if ($save) { |
104 | 104 | $game = SmrGame::getGame($game_id); |
105 | 105 | // insert into history db |
106 | 106 | $history_db_sql[] = 'INSERT INTO game (game_id, end_date, start_date, game_name, speed, type) VALUES ' . |
107 | - '('.$db->escapeNumber($game_id).', '.$game->getEndTime().', '.$game->getStartTime().', ' . $db->escapeString($game->getGameName()) . ', '.$game->getGameSpeed().', '.$db->escapeString($game->getGameType()).')'; |
|
107 | + '(' . $db->escapeNumber($game_id) . ', ' . $game->getEndTime() . ', ' . $game->getStartTime() . ', ' . $db->escapeString($game->getGameName()) . ', ' . $game->getGameSpeed() . ', ' . $db->escapeString($game->getGameType()) . ')'; |
|
108 | 108 | } |
109 | 109 | |
110 | - $smr_db_sql[] = 'DELETE FROM location WHERE game_id = '.$db->escapeNumber($game_id); |
|
111 | - $smr_db_sql[] = 'DELETE FROM mb_exceptions WHERE value LIKE '.$db->escapeString($game_id.'%'); |
|
112 | - $smr_db_sql[] = 'DELETE FROM message WHERE game_id = '.$db->escapeNumber($game_id); |
|
113 | - $smr_db_sql[] = 'DELETE FROM message_notify WHERE game_id = '.$db->escapeNumber($game_id); |
|
110 | + $smr_db_sql[] = 'DELETE FROM location WHERE game_id = ' . $db->escapeNumber($game_id); |
|
111 | + $smr_db_sql[] = 'DELETE FROM mb_exceptions WHERE value LIKE ' . $db->escapeString($game_id . '%'); |
|
112 | + $smr_db_sql[] = 'DELETE FROM message WHERE game_id = ' . $db->escapeNumber($game_id); |
|
113 | + $smr_db_sql[] = 'DELETE FROM message_notify WHERE game_id = ' . $db->escapeNumber($game_id); |
|
114 | 114 | |
115 | 115 | if ($save) { |
116 | 116 | |
117 | - $db->query('SELECT * FROM news WHERE game_id = '.$game_id.' AND type = \'regular\''); |
|
117 | + $db->query('SELECT * FROM news WHERE game_id = ' . $game_id . ' AND type = \'regular\''); |
|
118 | 118 | $id = 1; |
119 | 119 | |
120 | 120 | while ($db->nextRecord()) { |
@@ -124,17 +124,17 @@ discard block |
||
124 | 124 | $msg = $db->getField('news_message'); |
125 | 125 | |
126 | 126 | // insert into history db |
127 | - $history_db_sql[] = 'INSERT INTO news (game_id, news_id, time, message) VALUES ('.$game_id.', '.$id.', '.$time.', ' . $db->escapeString($msg) . ')'; |
|
127 | + $history_db_sql[] = 'INSERT INTO news (game_id, news_id, time, message) VALUES (' . $game_id . ', ' . $id . ', ' . $time . ', ' . $db->escapeString($msg) . ')'; |
|
128 | 128 | $id++; |
129 | 129 | |
130 | 130 | } |
131 | 131 | } |
132 | 132 | |
133 | - $smr_db_sql[] = 'DELETE FROM news WHERE game_id = '.$db->escapeNumber($game_id); |
|
133 | + $smr_db_sql[] = 'DELETE FROM news WHERE game_id = ' . $db->escapeNumber($game_id); |
|
134 | 134 | |
135 | 135 | if ($save) { |
136 | 136 | |
137 | - $db->query('SELECT * FROM planet WHERE game_id = '.$db->escapeNumber($game_id)); |
|
137 | + $db->query('SELECT * FROM planet WHERE game_id = ' . $db->escapeNumber($game_id)); |
|
138 | 138 | |
139 | 139 | while ($db->nextRecord()) { |
140 | 140 | |
@@ -142,34 +142,34 @@ discard block |
||
142 | 142 | $sector = $db->getInt('sector_id'); |
143 | 143 | $owner = $db->getInt('owner_id'); |
144 | 144 | |
145 | - $db2->query('SELECT * FROM planet_has_building WHERE game_id = '.$game_id.' AND sector_id = '.$sector.' AND construction_id = 1'); |
|
145 | + $db2->query('SELECT * FROM planet_has_building WHERE game_id = ' . $game_id . ' AND sector_id = ' . $sector . ' AND construction_id = 1'); |
|
146 | 146 | if ($db2->nextRecord()) $gens = $db2->getInt('amount'); |
147 | 147 | else $gens = 0; |
148 | 148 | |
149 | - $db2->query('SELECT * FROM planet_has_building WHERE game_id = '.$game_id.' AND sector_id = '.$sector.' AND construction_id = 2'); |
|
149 | + $db2->query('SELECT * FROM planet_has_building WHERE game_id = ' . $game_id . ' AND sector_id = ' . $sector . ' AND construction_id = 2'); |
|
150 | 150 | if ($db2->nextRecord()) $hangs = $db2->getInt('amount'); |
151 | 151 | else $hangs = 0; |
152 | 152 | |
153 | - $db2->query('SELECT * FROM planet_has_building WHERE game_id = '.$game_id.' AND sector_id = '.$sector.' AND construction_id = 3'); |
|
153 | + $db2->query('SELECT * FROM planet_has_building WHERE game_id = ' . $game_id . ' AND sector_id = ' . $sector . ' AND construction_id = 3'); |
|
154 | 154 | if ($db2->nextRecord()) $turs = $db2->getInt('amount'); |
155 | 155 | else $turs = 0; |
156 | 156 | |
157 | 157 | // insert into history db |
158 | 158 | $history_db_sql[] = 'INSERT INTO planet (game_id, sector_id, owner_id, generators, hangers, turrets) VALUES ' . |
159 | - '('.$game_id.', '.$sector.', '.$owner.', '.$gens.', '.$hangs.', '.$turs.')'; |
|
159 | + '(' . $game_id . ', ' . $sector . ', ' . $owner . ', ' . $gens . ', ' . $hangs . ', ' . $turs . ')'; |
|
160 | 160 | |
161 | 161 | } |
162 | 162 | |
163 | 163 | } |
164 | 164 | |
165 | - $smr_db_sql[] = 'DELETE FROM planet WHERE game_id = '.$db->escapeNumber($game_id); |
|
166 | - $smr_db_sql[] = 'DELETE FROM planet_is_building WHERE game_id = '.$db->escapeNumber($game_id); |
|
167 | - $smr_db_sql[] = 'DELETE FROM planet_has_cargo WHERE game_id = '.$db->escapeNumber($game_id); |
|
168 | - $smr_db_sql[] = 'DELETE FROM planet_has_building WHERE game_id = '.$db->escapeNumber($game_id); |
|
165 | + $smr_db_sql[] = 'DELETE FROM planet WHERE game_id = ' . $db->escapeNumber($game_id); |
|
166 | + $smr_db_sql[] = 'DELETE FROM planet_is_building WHERE game_id = ' . $db->escapeNumber($game_id); |
|
167 | + $smr_db_sql[] = 'DELETE FROM planet_has_cargo WHERE game_id = ' . $db->escapeNumber($game_id); |
|
168 | + $smr_db_sql[] = 'DELETE FROM planet_has_building WHERE game_id = ' . $db->escapeNumber($game_id); |
|
169 | 169 | |
170 | 170 | if ($save) { |
171 | 171 | |
172 | - $db->query('SELECT * FROM player WHERE game_id = '.$game_id); |
|
172 | + $db->query('SELECT * FROM player WHERE game_id = ' . $game_id); |
|
173 | 173 | |
174 | 174 | while ($db->nextRecord()) { |
175 | 175 | |
@@ -187,48 +187,48 @@ discard block |
||
187 | 187 | |
188 | 188 | $amount = 0; |
189 | 189 | $smrCredits = 0; |
190 | - $db2->query('SELECT sum(amount) as bounty_am, sum(smr_credits) as bounty_cred FROM bounty WHERE game_id = '.$game_id.' AND account_id = '.$acc_id.' AND claimer_id = 0'); |
|
190 | + $db2->query('SELECT sum(amount) as bounty_am, sum(smr_credits) as bounty_cred FROM bounty WHERE game_id = ' . $game_id . ' AND account_id = ' . $acc_id . ' AND claimer_id = 0'); |
|
191 | 191 | if ($db2->nextRecord()) { |
192 | 192 | if (is_int($db2->getField('bounty_am'))) $amount = $db2->getInt('bounty_am'); |
193 | 193 | if (is_int($db2->getField('bounty_cred'))) $smrCredits = $db2->getInt('bounty_cred'); |
194 | 194 | |
195 | 195 | } |
196 | 196 | |
197 | - $db2->query('SELECT * FROM ship_has_name WHERE game_id = '.$game_id.' AND account_id = '.$acc_id); |
|
197 | + $db2->query('SELECT * FROM ship_has_name WHERE game_id = ' . $game_id . ' AND account_id = ' . $acc_id); |
|
198 | 198 | if ($db2->nextRecord()) $ship_name = $db2->getField('ship_name'); |
199 | 199 | else $ship_name = 'None'; |
200 | 200 | |
201 | 201 | // insert into history db |
202 | 202 | $history_db_sql[] = 'INSERT INTO player (account_id, game_id, player_name, player_id, experience, ship, race, alignment, alliance_id, kills, deaths, bounty, bounty_cred, ship_name) ' . |
203 | - 'VALUES ('.$acc_id.', '.$game_id.', ' . $db->escapeString($name) . ', '.$id.', '.$exp.', '.$ship.', '.$race.', '.$align.', '.$alli.', '.$kills.', '.$deaths.', '.$amount.','.$smrCredits.', ' . $db->escapeString($ship_name) . ')'; |
|
203 | + 'VALUES (' . $acc_id . ', ' . $game_id . ', ' . $db->escapeString($name) . ', ' . $id . ', ' . $exp . ', ' . $ship . ', ' . $race . ', ' . $align . ', ' . $alli . ', ' . $kills . ', ' . $deaths . ', ' . $amount . ',' . $smrCredits . ', ' . $db->escapeString($ship_name) . ')'; |
|
204 | 204 | |
205 | 205 | } |
206 | 206 | |
207 | 207 | } |
208 | 208 | |
209 | - $smr_db_sql[] = 'DELETE FROM player WHERE game_id = '.$db->escapeNumber($game_id); |
|
210 | - $smr_db_sql[] = 'DELETE FROM bounty WHERE game_id = '.$db->escapeNumber($game_id); |
|
211 | - $smr_db_sql[] = 'DELETE FROM player_has_ticker WHERE game_id = '.$db->escapeNumber($game_id); |
|
212 | - $smr_db_sql[] = 'DELETE FROM player_has_ticket WHERE game_id = '.$db->escapeNumber($game_id); |
|
213 | - $smr_db_sql[] = 'DELETE FROM player_has_alliance_role WHERE game_id = '.$db->escapeNumber($game_id); |
|
214 | - $smr_db_sql[] = 'DELETE FROM player_has_drinks WHERE game_id = '.$db->escapeNumber($game_id); |
|
215 | - $smr_db_sql[] = 'DELETE FROM player_has_relation WHERE game_id = '.$db->escapeNumber($game_id); |
|
216 | - $smr_db_sql[] = 'DELETE FROM player_has_unread_messages WHERE game_id = '.$db->escapeNumber($game_id); |
|
217 | - $smr_db_sql[] = 'DELETE FROM player_plotted_course WHERE game_id = '.$db->escapeNumber($game_id); |
|
218 | - $smr_db_sql[] = 'DELETE FROM player_read_thread WHERE game_id = '.$db->escapeNumber($game_id); |
|
219 | - $smr_db_sql[] = 'DELETE FROM player_visited_port WHERE game_id = '.$db->escapeNumber($game_id); |
|
220 | - $smr_db_sql[] = 'DELETE FROM player_visited_sector WHERE game_id = '.$db->escapeNumber($game_id); |
|
221 | - $smr_db_sql[] = 'DELETE FROM player_votes_pact WHERE game_id = '.$db->escapeNumber($game_id); |
|
222 | - $smr_db_sql[] = 'DELETE FROM player_votes_relation WHERE game_id = '.$db->escapeNumber($game_id); |
|
223 | - $smr_db_sql[] = 'DELETE FROM plot_cache WHERE game_id = '.$db->escapeNumber($game_id); |
|
224 | - $smr_db_sql[] = 'DELETE FROM port WHERE game_id = '.$db->escapeNumber($game_id); |
|
225 | - $smr_db_sql[] = 'DELETE FROM port_has_goods WHERE game_id = '.$db->escapeNumber($game_id); |
|
226 | - $smr_db_sql[] = 'DELETE FROM race_has_relation WHERE game_id = '.$db->escapeNumber($game_id); |
|
227 | - $smr_db_sql[] = 'DELETE FROM race_has_voting WHERE game_id = '.$db->escapeNumber($game_id); |
|
209 | + $smr_db_sql[] = 'DELETE FROM player WHERE game_id = ' . $db->escapeNumber($game_id); |
|
210 | + $smr_db_sql[] = 'DELETE FROM bounty WHERE game_id = ' . $db->escapeNumber($game_id); |
|
211 | + $smr_db_sql[] = 'DELETE FROM player_has_ticker WHERE game_id = ' . $db->escapeNumber($game_id); |
|
212 | + $smr_db_sql[] = 'DELETE FROM player_has_ticket WHERE game_id = ' . $db->escapeNumber($game_id); |
|
213 | + $smr_db_sql[] = 'DELETE FROM player_has_alliance_role WHERE game_id = ' . $db->escapeNumber($game_id); |
|
214 | + $smr_db_sql[] = 'DELETE FROM player_has_drinks WHERE game_id = ' . $db->escapeNumber($game_id); |
|
215 | + $smr_db_sql[] = 'DELETE FROM player_has_relation WHERE game_id = ' . $db->escapeNumber($game_id); |
|
216 | + $smr_db_sql[] = 'DELETE FROM player_has_unread_messages WHERE game_id = ' . $db->escapeNumber($game_id); |
|
217 | + $smr_db_sql[] = 'DELETE FROM player_plotted_course WHERE game_id = ' . $db->escapeNumber($game_id); |
|
218 | + $smr_db_sql[] = 'DELETE FROM player_read_thread WHERE game_id = ' . $db->escapeNumber($game_id); |
|
219 | + $smr_db_sql[] = 'DELETE FROM player_visited_port WHERE game_id = ' . $db->escapeNumber($game_id); |
|
220 | + $smr_db_sql[] = 'DELETE FROM player_visited_sector WHERE game_id = ' . $db->escapeNumber($game_id); |
|
221 | + $smr_db_sql[] = 'DELETE FROM player_votes_pact WHERE game_id = ' . $db->escapeNumber($game_id); |
|
222 | + $smr_db_sql[] = 'DELETE FROM player_votes_relation WHERE game_id = ' . $db->escapeNumber($game_id); |
|
223 | + $smr_db_sql[] = 'DELETE FROM plot_cache WHERE game_id = ' . $db->escapeNumber($game_id); |
|
224 | + $smr_db_sql[] = 'DELETE FROM port WHERE game_id = ' . $db->escapeNumber($game_id); |
|
225 | + $smr_db_sql[] = 'DELETE FROM port_has_goods WHERE game_id = ' . $db->escapeNumber($game_id); |
|
226 | + $smr_db_sql[] = 'DELETE FROM race_has_relation WHERE game_id = ' . $db->escapeNumber($game_id); |
|
227 | + $smr_db_sql[] = 'DELETE FROM race_has_voting WHERE game_id = ' . $db->escapeNumber($game_id); |
|
228 | 228 | |
229 | 229 | if ($save) { |
230 | 230 | |
231 | - $db->query('SELECT * FROM sector WHERE game_id = '.$game_id); |
|
231 | + $db->query('SELECT * FROM sector WHERE game_id = ' . $game_id); |
|
232 | 232 | |
233 | 233 | while ($db->nextRecord()) { |
234 | 234 | |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | $gal_id = $db->getInt('galaxy_id'); |
239 | 239 | |
240 | 240 | $db2->query('SELECT sum(mines) as sum_mines, sum(combat_drones) as cds, sum(scout_drones) as sds FROM sector_has_forces ' . |
241 | - 'WHERE sector_id = '.$sector.' AND game_id = '.$game_id.' GROUP BY sector_id'); |
|
241 | + 'WHERE sector_id = ' . $sector . ' AND game_id = ' . $game_id . ' GROUP BY sector_id'); |
|
242 | 242 | if ($db2->nextRecord()) { |
243 | 243 | |
244 | 244 | $mines = $db2->getInt('sum_mines'); |
@@ -258,32 +258,32 @@ discard block |
||
258 | 258 | |
259 | 259 | // insert into history db |
260 | 260 | $history_db_sql[] = 'INSERT INTO sector (game_id, sector_id, gal_id, mines, kills, combat, scouts) ' . |
261 | - 'VALUES ('.$game_id.','. $sector.','. $gal_id.','. $mines.','. $kills.','. $cds.','. $sds.')'; |
|
261 | + 'VALUES (' . $game_id . ',' . $sector . ',' . $gal_id . ',' . $mines . ',' . $kills . ',' . $cds . ',' . $sds . ')'; |
|
262 | 262 | |
263 | 263 | } |
264 | 264 | |
265 | 265 | } |
266 | 266 | |
267 | - $smr_db_sql[] = 'DELETE FROM sector WHERE game_id = '.$game_id; |
|
268 | - $smr_db_sql[] = 'DELETE FROM sector_has_forces WHERE game_id = '.$game_id; |
|
269 | - $smr_db_sql[] = 'DELETE FROM ship_has_cargo WHERE game_id = '.$game_id; |
|
270 | - $smr_db_sql[] = 'DELETE FROM ship_has_hardware WHERE game_id = '.$game_id; |
|
271 | - $smr_db_sql[] = 'DELETE FROM ship_has_name WHERE game_id = '.$game_id; |
|
272 | - $smr_db_sql[] = 'DELETE FROM ship_has_illusion WHERE game_id = '.$game_id; |
|
273 | - $smr_db_sql[] = 'DELETE FROM ship_has_weapon WHERE game_id = '.$game_id; |
|
274 | - $smr_db_sql[] = 'DELETE FROM ship_is_cloaked WHERE game_id = '.$game_id; |
|
275 | - $smr_db_sql[] = 'UPDATE game SET end_time='.SmrSession::getTime().' WHERE game_id = '.$game_id.' AND end_time > '.SmrSession::getTime(); // Do not delete game placeholder, just make sure game is finished |
|
276 | - $smr_db_sql[] = 'UPDATE active_session SET game_id = 0 WHERE game_id = '.$game_id; |
|
267 | + $smr_db_sql[] = 'DELETE FROM sector WHERE game_id = ' . $game_id; |
|
268 | + $smr_db_sql[] = 'DELETE FROM sector_has_forces WHERE game_id = ' . $game_id; |
|
269 | + $smr_db_sql[] = 'DELETE FROM ship_has_cargo WHERE game_id = ' . $game_id; |
|
270 | + $smr_db_sql[] = 'DELETE FROM ship_has_hardware WHERE game_id = ' . $game_id; |
|
271 | + $smr_db_sql[] = 'DELETE FROM ship_has_name WHERE game_id = ' . $game_id; |
|
272 | + $smr_db_sql[] = 'DELETE FROM ship_has_illusion WHERE game_id = ' . $game_id; |
|
273 | + $smr_db_sql[] = 'DELETE FROM ship_has_weapon WHERE game_id = ' . $game_id; |
|
274 | + $smr_db_sql[] = 'DELETE FROM ship_is_cloaked WHERE game_id = ' . $game_id; |
|
275 | + $smr_db_sql[] = 'UPDATE game SET end_time=' . SmrSession::getTime() . ' WHERE game_id = ' . $game_id . ' AND end_time > ' . SmrSession::getTime(); // Do not delete game placeholder, just make sure game is finished |
|
276 | + $smr_db_sql[] = 'UPDATE active_session SET game_id = 0 WHERE game_id = ' . $game_id; |
|
277 | 277 | |
278 | 278 | // now do the sql stuff |
279 | - foreach($smr_db_sql as $sql) { |
|
279 | + foreach ($smr_db_sql as $sql) { |
|
280 | 280 | |
281 | 281 | $db->query($sql); |
282 | 282 | |
283 | 283 | } |
284 | 284 | |
285 | 285 | $db = new SmrHistoryMySqlDatabase(); |
286 | - foreach($history_db_sql as $sql) { |
|
286 | + foreach ($history_db_sql as $sql) { |
|
287 | 287 | |
288 | 288 | $db->query($sql); |
289 | 289 |
@@ -58,8 +58,8 @@ discard block |
||
58 | 58 | |
59 | 59 | $totalShieldDamage = 0; |
60 | 60 | foreach ($attackers as $attacker) { |
61 | - $playerResults =& $attacker->shootPlanet($planet, false); |
|
62 | - $results['Attackers']['Traders'][$attacker->getAccountID()] =& $playerResults; |
|
61 | + $playerResults = & $attacker->shootPlanet($planet, false); |
|
62 | + $results['Attackers']['Traders'][$attacker->getAccountID()] = & $playerResults; |
|
63 | 63 | $results['Attackers']['TotalDamage'] += $playerResults['TotalDamage']; |
64 | 64 | foreach ($playerResults['Weapons'] as $weapon) { |
65 | 65 | if (isset($weapon['ActualDamage'])) { // Only set if the weapon hits |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | $downgradeDamage = $results['Attackers']['TotalDamage'] - $totalShieldDamage; |
73 | 73 | $results['Attackers']['Downgrades'] = $planet->checkForDowngrade($downgradeDamage); |
74 | 74 | |
75 | -$results['Planet'] =& $planet->shootPlayers($attackers); |
|
75 | +$results['Planet'] = & $planet->shootPlayers($attackers); |
|
76 | 76 | |
77 | 77 | $account->log(LOG_TYPE_PLANET_BUSTING, 'Player attacks planet, the planet does ' . $results['Planet']['TotalDamage'] . ', their team does ' . $results['Attackers']['TotalDamage'] . ' and downgrades: ' . var_export($results['Attackers']['Downgrades'], true), $planet->getSectorID()); |
78 | 78 |
@@ -20,13 +20,13 @@ |
||
20 | 20 | const USER_SCORE_NAME = 'User Score'; |
21 | 21 | $hofTypes = array(DONATION_NAME=>true, USER_SCORE_NAME=>true); |
22 | 22 | while ($db->nextRecord()) { |
23 | - $hof =& $hofTypes; |
|
23 | + $hof = & $hofTypes; |
|
24 | 24 | $typeList = explode(':', $db->getField('type')); |
25 | 25 | foreach ($typeList as $type) { |
26 | 26 | if (!isset($hof[$type])) { |
27 | 27 | $hof[$type] = array(); |
28 | 28 | } |
29 | - $hof =& $hof[$type]; |
|
29 | + $hof = & $hof[$type]; |
|
30 | 30 | } |
31 | 31 | $hof = true; |
32 | 32 | } |
@@ -19,8 +19,7 @@ discard block |
||
19 | 19 | $shareFrom[$fromAccountId] = array( |
20 | 20 | 'Player ID' => $otherPlayer == null ? '-' : $otherPlayer->getPlayerID(), |
21 | 21 | 'Player Name' => $otherPlayer == null ? |
22 | - '<b>Account</b>: ' . SmrAccount::getAccount($fromAccountId)->getHofDisplayName() : |
|
23 | - $otherPlayer->getDisplayName(), |
|
22 | + '<b>Account</b>: ' . SmrAccount::getAccount($fromAccountId)->getHofDisplayName() : $otherPlayer->getDisplayName(), |
|
24 | 23 | 'All Games' => $gameId == 0 ? '<span class="green">YES</span>' : '<span class="red">NO</span>', |
25 | 24 | 'Game ID' => $gameId, |
26 | 25 | ); |
@@ -40,8 +39,7 @@ discard block |
||
40 | 39 | $shareTo[$toAccountId] = array( |
41 | 40 | 'Player ID' => $otherPlayer == null ? '-' : $otherPlayer->getPlayerID(), |
42 | 41 | 'Player Name' => $otherPlayer == null ? |
43 | - '<b>Account</b>: ' . SmrAccount::getAccount($toAccountId)->getHofDisplayName() : |
|
44 | - $otherPlayer->getDisplayName(), |
|
42 | + '<b>Account</b>: ' . SmrAccount::getAccount($toAccountId)->getHofDisplayName() : $otherPlayer->getDisplayName(), |
|
45 | 43 | 'All Games' => $gameId == 0 ? '<span class="green">YES</span>' : '<span class="red">NO</span>', |
46 | 44 | 'Game ID' => $gameId, |
47 | 45 | ); |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | $db3 = MySqlDatabase::getInstance(); |
8 | 8 | |
9 | 9 | // get current entry |
10 | - $db->query('SELECT * FROM manual WHERE topic_id = '.$db->escapeNumber($topic_id)); |
|
10 | + $db->query('SELECT * FROM manual WHERE topic_id = ' . $db->escapeNumber($topic_id)); |
|
11 | 11 | if ($db->nextRecord()) { |
12 | 12 | $parent_topic_id = $db->getInt('parent_topic_id'); |
13 | 13 | $order_id = $db->getInt('order_id'); |
@@ -19,17 +19,17 @@ discard block |
||
19 | 19 | // ************************** |
20 | 20 | // ** PREVIOUS |
21 | 21 | // ************************** |
22 | - $db2->query('SELECT * FROM manual WHERE parent_topic_id = '.$db2->escapeNumber($parent_topic_id).' AND order_id = '.$db2->escapeNumber($order_id - 1)); |
|
22 | + $db2->query('SELECT * FROM manual WHERE parent_topic_id = ' . $db2->escapeNumber($parent_topic_id) . ' AND order_id = ' . $db2->escapeNumber($order_id - 1)); |
|
23 | 23 | |
24 | 24 | // no result? |
25 | 25 | if (!$db2->getNumRows()) |
26 | - $db2->query('SELECT * FROM manual WHERE topic_id = '.$db2->escapeNumber($parent_topic_id)); |
|
26 | + $db2->query('SELECT * FROM manual WHERE topic_id = ' . $db2->escapeNumber($parent_topic_id)); |
|
27 | 27 | |
28 | 28 | echo ('<th width="32">'); |
29 | 29 | if ($db2->nextRecord()) { |
30 | 30 | $previous_topic_id = $db2->getInt('topic_id'); |
31 | 31 | $previous_topic = stripslashes($db2->getField('topic')); |
32 | - echo ('<a href="/manual.php?'.$previous_topic_id.'"><img src="/images/help/previous.jpg" width="32" height="32" border="0"></a>'); |
|
32 | + echo ('<a href="/manual.php?' . $previous_topic_id . '"><img src="/images/help/previous.jpg" width="32" height="32" border="0"></a>'); |
|
33 | 33 | } else |
34 | 34 | echo ('<img src="/images/help/empty.jpg" width="32" height="32">'); |
35 | 35 | echo ('</th>'); |
@@ -37,12 +37,12 @@ discard block |
||
37 | 37 | // ************************** |
38 | 38 | // ** UP |
39 | 39 | // ************************** |
40 | - $db2->query('SELECT * FROM manual WHERE topic_id = '.$db2->escapeNumber($parent_topic_id)); |
|
40 | + $db2->query('SELECT * FROM manual WHERE topic_id = ' . $db2->escapeNumber($parent_topic_id)); |
|
41 | 41 | echo ('<th width="32">'); |
42 | 42 | if ($db2->nextRecord()) { |
43 | 43 | $up_topic_id = $db2->getInt('topic_id'); |
44 | 44 | $up_topic = stripslashes($db2->getField('topic')); |
45 | - echo ('<a href="/manual.php?'.$up_topic_id.'"><img src="/images/help/up.jpg" width="32" height="32" border="0"></a>'); |
|
45 | + echo ('<a href="/manual.php?' . $up_topic_id . '"><img src="/images/help/up.jpg" width="32" height="32" border="0"></a>'); |
|
46 | 46 | } else |
47 | 47 | echo ('<img src="/images/help/empty.jpg" width="32" height="32">'); |
48 | 48 | echo ('</th>'); |
@@ -50,35 +50,35 @@ discard block |
||
50 | 50 | // ************************** |
51 | 51 | // ** NEXT |
52 | 52 | // ************************** |
53 | - $db2->query('SELECT * FROM manual WHERE parent_topic_id = '.$db2->escapeNumber($topic_id).' AND order_id = 1'); |
|
53 | + $db2->query('SELECT * FROM manual WHERE parent_topic_id = ' . $db2->escapeNumber($topic_id) . ' AND order_id = 1'); |
|
54 | 54 | |
55 | 55 | if (!$db2->getNumRows()) |
56 | - $db2->query('SELECT * FROM manual WHERE parent_topic_id = '.$db2->escapeNumber($parent_topic_id).' AND order_id = '.$db2->escapeNumber($order_id + 1)); |
|
56 | + $db2->query('SELECT * FROM manual WHERE parent_topic_id = ' . $db2->escapeNumber($parent_topic_id) . ' AND order_id = ' . $db2->escapeNumber($order_id + 1)); |
|
57 | 57 | |
58 | 58 | $seenParentIDs = array(0); |
59 | 59 | $curr_parent_topic_id = $parent_topic_id; |
60 | 60 | while (!$db2->getNumRows() && !in_array($curr_parent_topic_id, $seenParentIDs)) { |
61 | 61 | $seenParentIDs[] = $curr_parent_topic_id; |
62 | - $db3->query('SELECT * FROM manual WHERE topic_id = '.$db3->escapeNumber($parent_topic_id)); |
|
62 | + $db3->query('SELECT * FROM manual WHERE topic_id = ' . $db3->escapeNumber($parent_topic_id)); |
|
63 | 63 | $db3->nextRecord(); |
64 | 64 | $curr_order_id = $db3->getInt('order_id'); |
65 | 65 | $curr_parent_topic_id = $db3->getInt('parent_topic_id'); |
66 | 66 | |
67 | - $db2->query('SELECT * FROM manual WHERE parent_topic_id = '.$db2->escapeNumber($parent_topic_id).' AND order_id = '.$db2->escapeNumber($curr_order_id + 1)); |
|
67 | + $db2->query('SELECT * FROM manual WHERE parent_topic_id = ' . $db2->escapeNumber($parent_topic_id) . ' AND order_id = ' . $db2->escapeNumber($curr_order_id + 1)); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | echo ('<th width="32">'); |
71 | 71 | if ($db2->nextRecord()) { |
72 | 72 | $next_topic_id = $db2->getInt('topic_id'); |
73 | 73 | $next_topic = stripslashes($db2->getField('topic')); |
74 | - echo ('<a href="/manual.php?'.$next_topic_id.'"><img src="/images/help/next.jpg" width="32" height="32" border="0"></a>'); |
|
74 | + echo ('<a href="/manual.php?' . $next_topic_id . '"><img src="/images/help/next.jpg" width="32" height="32" border="0"></a>'); |
|
75 | 75 | } |
76 | 76 | else { |
77 | 77 | echo ('<img src="/images/help/empty.jpg" width="32" height="32">'); |
78 | 78 | } |
79 | 79 | echo ('</th>'); |
80 | 80 | |
81 | - echo ('<th width="100%" class="center" validn="middle" style="font-size:18pt;font-weight:bold;">' . get_numbering($topic_id) . $topic.'</th>'); |
|
81 | + echo ('<th width="100%" class="center" validn="middle" style="font-size:18pt;font-weight:bold;">' . get_numbering($topic_id) . $topic . '</th>'); |
|
82 | 82 | echo ('<th width="32"><a href="/manual_toc.php"><img src="/images/help/contents.jpg" width="32" height="32" border="0"></a></th>'); |
83 | 83 | |
84 | 84 | echo ('</tr>'); |
@@ -86,11 +86,11 @@ discard block |
||
86 | 86 | echo ('<tr>'); |
87 | 87 | echo ('<td colspan="5">'); |
88 | 88 | if (isset($previous_topic_id) && $previous_topic_id > 0) |
89 | - echo ('<b>Previous:</b> <a href="/manual.php?'.$previous_topic_id.'">' . get_numbering($previous_topic_id) . $previous_topic.'</a> '); |
|
89 | + echo ('<b>Previous:</b> <a href="/manual.php?' . $previous_topic_id . '">' . get_numbering($previous_topic_id) . $previous_topic . '</a> '); |
|
90 | 90 | if (isset($up_topic_id) && $up_topic_id > 0) |
91 | - echo ('<b>Up:</b> <a href="/manual.php?'.$up_topic_id.'">' . get_numbering($up_topic_id) . $up_topic.'</a> '); |
|
91 | + echo ('<b>Up:</b> <a href="/manual.php?' . $up_topic_id . '">' . get_numbering($up_topic_id) . $up_topic . '</a> '); |
|
92 | 92 | if (isset($next_topic_id) && $next_topic_id > 0) |
93 | - echo ('<b>Next:</b> <a href="/manual.php?'.$next_topic_id.'">' . get_numbering($next_topic_id) . $next_topic.'</a>'); |
|
93 | + echo ('<b>Next:</b> <a href="/manual.php?' . $next_topic_id . '">' . get_numbering($next_topic_id) . $next_topic . '</a>'); |
|
94 | 94 | echo ('</tr>'); |
95 | 95 | |
96 | 96 | echo ('</table>'); |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | $db = MySqlDatabase::getInstance(); |
104 | 104 | |
105 | 105 | // get current entry |
106 | - $db->query('SELECT * FROM manual WHERE topic_id = '.$topic_id); |
|
106 | + $db->query('SELECT * FROM manual WHERE topic_id = ' . $topic_id); |
|
107 | 107 | if ($db->nextRecord()) { |
108 | 108 | $parent_topic_id = $db->getInt('parent_topic_id'); |
109 | 109 | $order_id = $db->getInt('order_id'); |
@@ -111,8 +111,8 @@ discard block |
||
111 | 111 | $text = stripslashes($db->getField('text')); |
112 | 112 | |
113 | 113 | echo ('<div id="help_content">'); |
114 | - echo ('<h1>' . get_numbering($topic_id) . $topic.'</h1>'); |
|
115 | - echo ('<p>'.$text.'<p>'); |
|
114 | + echo ('<h1>' . get_numbering($topic_id) . $topic . '</h1>'); |
|
115 | + echo ('<p>' . $text . '<p>'); |
|
116 | 116 | echo ('</div>'); |
117 | 117 | } else |
118 | 118 | echo ('Invalid Topic!'); |
@@ -121,9 +121,9 @@ discard block |
||
121 | 121 | function echo_subsection($topic_id) { |
122 | 122 | // database object |
123 | 123 | $db = MySqlDatabase::getInstance(); |
124 | - $return=''; |
|
124 | + $return = ''; |
|
125 | 125 | // check if there are subsections |
126 | - $db->query('SELECT * FROM manual WHERE parent_topic_id = '.$db->escapeNumber($topic_id).' ORDER BY order_id'); |
|
126 | + $db->query('SELECT * FROM manual WHERE parent_topic_id = ' . $db->escapeNumber($topic_id) . ' ORDER BY order_id'); |
|
127 | 127 | if ($db->getNumRows()) { |
128 | 128 | echo ('<hr noshade width="75%" size="1" class="center"/>'); |
129 | 129 | echo ('<div id="help_menu">'); |
@@ -137,19 +137,19 @@ discard block |
||
137 | 137 | } |
138 | 138 | |
139 | 139 | function echo_menu($topic_id) { |
140 | - $return=''; |
|
140 | + $return = ''; |
|
141 | 141 | // database object |
142 | 142 | $db = MySqlDatabase::getInstance(); |
143 | 143 | |
144 | - $db->query('SELECT * FROM manual WHERE parent_topic_id = '.$db->escapeNumber($topic_id).' ORDER BY order_id'); |
|
144 | + $db->query('SELECT * FROM manual WHERE parent_topic_id = ' . $db->escapeNumber($topic_id) . ' ORDER BY order_id'); |
|
145 | 145 | if ($db->getNumRows()) { |
146 | 146 | echo ('<ul type="disc">'); |
147 | - while($db->nextRecord()) { |
|
147 | + while ($db->nextRecord()) { |
|
148 | 148 | $sub_topic_id = $db->getInt('topic_id'); |
149 | 149 | $order_id = $db->getInt('order_id'); |
150 | 150 | $sub_topic = stripslashes($db->getField('topic')); |
151 | 151 | |
152 | - echo ('<li><a href="/manual.php?'.$sub_topic_id.'">' . get_numbering($sub_topic_id) . $sub_topic.'</a></li>'); |
|
152 | + echo ('<li><a href="/manual.php?' . $sub_topic_id . '">' . get_numbering($sub_topic_id) . $sub_topic . '</a></li>'); |
|
153 | 153 | echo_menu($sub_topic_id); |
154 | 154 | } |
155 | 155 | echo ('</ul>'); |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | function get_numbering($topic_id) { |
161 | 161 | $db = MySqlDatabase::getInstance(); |
162 | 162 | |
163 | - $db->query('SELECT * FROM manual WHERE topic_id = '.$db->escapeNumber($topic_id)); |
|
163 | + $db->query('SELECT * FROM manual WHERE topic_id = ' . $db->escapeNumber($topic_id)); |
|
164 | 164 | if ($db->nextRecord()) { |
165 | 165 | $up_topic_id = $db->getInt('parent_topic_id'); |
166 | 166 | $order_id = $db->getInt('order_id'); |
@@ -72,18 +72,18 @@ |
||
72 | 72 | |
73 | 73 | // If mines are bumped, the forces shoot first. Otherwise player shoots first. |
74 | 74 | if ($bump) { |
75 | - $results['Forces'] =& $forces->shootPlayers($attackers, $bump); |
|
75 | + $results['Forces'] = & $forces->shootPlayers($attackers, $bump); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | $results['Attackers'] = array('TotalDamage' => 0); |
79 | 79 | foreach ($attackers as $attacker) { |
80 | - $playerResults =& $attacker->shootForces($forces); |
|
81 | - $results['Attackers']['Traders'][$attacker->getAccountID()] =& $playerResults; |
|
80 | + $playerResults = & $attacker->shootForces($forces); |
|
81 | + $results['Attackers']['Traders'][$attacker->getAccountID()] = & $playerResults; |
|
82 | 82 | $results['Attackers']['TotalDamage'] += $playerResults['TotalDamage']; |
83 | 83 | } |
84 | 84 | |
85 | 85 | if (!$bump) { |
86 | - $results['Forces'] =& $forces->shootPlayers($attackers, $bump); |
|
86 | + $results['Forces'] = & $forces->shootPlayers($attackers, $bump); |
|
87 | 87 | $forces->updateExpire(); |
88 | 88 | } |
89 | 89 |