We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -33,12 +33,24 @@ |
||
33 | 33 | $template->assign('HardwareHREF', SmrSession::getNewHREF($container)); |
34 | 34 | |
35 | 35 | $hardware = []; |
36 | -if ($ship->canHaveScanner()) $hardware[] = 'Scanner'; |
|
37 | -if ($ship->canHaveIllusion()) $hardware[] = 'Illusion Generator'; |
|
38 | -if ($ship->canHaveCloak()) $hardware[] = 'Cloaking Device'; |
|
39 | -if ($ship->canHaveJump()) $hardware[] = 'Jump Drive'; |
|
40 | -if ($ship->canHaveDCS()) $hardware[] = 'Drone Scrambler'; |
|
41 | -if (empty($hardware)) $hardware[] = 'none'; |
|
36 | +if ($ship->canHaveScanner()) { |
|
37 | + $hardware[] = 'Scanner'; |
|
38 | +} |
|
39 | +if ($ship->canHaveIllusion()) { |
|
40 | + $hardware[] = 'Illusion Generator'; |
|
41 | +} |
|
42 | +if ($ship->canHaveCloak()) { |
|
43 | + $hardware[] = 'Cloaking Device'; |
|
44 | +} |
|
45 | +if ($ship->canHaveJump()) { |
|
46 | + $hardware[] = 'Jump Drive'; |
|
47 | +} |
|
48 | +if ($ship->canHaveDCS()) { |
|
49 | + $hardware[] = 'Drone Scrambler'; |
|
50 | +} |
|
51 | +if (empty($hardware)) { |
|
52 | + $hardware[] = 'none'; |
|
53 | +} |
|
42 | 54 | $template->assign('Hardware', $hardware); |
43 | 55 | |
44 | 56 | $db->query('SELECT level_name,requirement FROM level WHERE requirement>' . $db->escapeNumber($player->getExperience()) . ' ORDER BY requirement ASC LIMIT 1'); |
@@ -19,8 +19,8 @@ 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)->getHofName() : |
|
23 | - $otherPlayer->getPlayerName(), |
|
22 | + '<b>Account</b>: ' . SmrAccount::getAccount($fromAccountId)->getHofName() : |
|
23 | + $otherPlayer->getPlayerName(), |
|
24 | 24 | 'All Games' => $gameId == 0 ? '<span class="green">YES</span>' : '<span class="red">NO</span>', |
25 | 25 | 'Game ID' => $gameId, |
26 | 26 | ); |
@@ -40,8 +40,8 @@ discard block |
||
40 | 40 | $shareTo[$toAccountId] = array( |
41 | 41 | 'Player ID' => $otherPlayer == null ? '-' : $otherPlayer->getPlayerID(), |
42 | 42 | 'Player Name' => $otherPlayer == null ? |
43 | - '<b>Account</b>: ' . SmrAccount::getAccount($toAccountId)->getHofName() : |
|
44 | - $otherPlayer->getPlayerName(), |
|
43 | + '<b>Account</b>: ' . SmrAccount::getAccount($toAccountId)->getHofName() : |
|
44 | + $otherPlayer->getPlayerName(), |
|
45 | 45 | 'All Games' => $gameId == 0 ? '<span class="green">YES</span>' : '<span class="red">NO</span>', |
46 | 46 | 'Game ID' => $gameId, |
47 | 47 | ); |
@@ -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)->getHofName() : |
|
23 | - $otherPlayer->getPlayerName(), |
|
22 | + '<b>Account</b>: ' . SmrAccount::getAccount($fromAccountId)->getHofName() : $otherPlayer->getPlayerName(), |
|
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)->getHofName() : |
|
44 | - $otherPlayer->getPlayerName(), |
|
42 | + '<b>Account</b>: ' . SmrAccount::getAccount($toAccountId)->getHofName() : $otherPlayer->getPlayerName(), |
|
45 | 43 | 'All Games' => $gameId == 0 ? '<span class="green">YES</span>' : '<span class="red">NO</span>', |
46 | 44 | 'Game ID' => $gameId, |
47 | 45 | ); |
@@ -22,16 +22,18 @@ discard block |
||
22 | 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 | - if (!$db2->getNumRows()) |
|
26 | - $db2->query('SELECT * FROM manual WHERE topic_id = '.$db2->escapeNumber($parent_topic_id)); |
|
25 | + if (!$db2->getNumRows()) { |
|
26 | + $db2->query('SELECT * FROM manual WHERE topic_id = '.$db2->escapeNumber($parent_topic_id)); |
|
27 | + } |
|
27 | 28 | |
28 | 29 | echo ('<th width="32">'); |
29 | 30 | if ($db2->nextRecord()) { |
30 | 31 | $previous_topic_id = $db2->getField('topic_id'); |
31 | 32 | $previous_topic = stripslashes($db2->getField('topic')); |
32 | 33 | echo ('<a href="/manual.php?'.$previous_topic_id.'"><img src="/images/help/previous.jpg" width="32" height="32" border="0"></a>'); |
33 | - } else |
|
34 | - echo ('<img src="/images/help/empty.jpg" width="32" height="32">'); |
|
34 | + } else { |
|
35 | + echo ('<img src="/images/help/empty.jpg" width="32" height="32">'); |
|
36 | + } |
|
35 | 37 | echo ('</th>'); |
36 | 38 | |
37 | 39 | // ************************** |
@@ -43,8 +45,9 @@ discard block |
||
43 | 45 | $up_topic_id = $db2->getInt('topic_id'); |
44 | 46 | $up_topic = stripslashes($db2->getField('topic')); |
45 | 47 | echo ('<a href="/manual.php?'.$up_topic_id.'"><img src="/images/help/up.jpg" width="32" height="32" border="0"></a>'); |
46 | - } else |
|
47 | - echo ('<img src="/images/help/empty.jpg" width="32" height="32">'); |
|
48 | + } else { |
|
49 | + echo ('<img src="/images/help/empty.jpg" width="32" height="32">'); |
|
50 | + } |
|
48 | 51 | echo ('</th>'); |
49 | 52 | |
50 | 53 | // ************************** |
@@ -52,8 +55,9 @@ discard block |
||
52 | 55 | // ************************** |
53 | 56 | $db2->query('SELECT * FROM manual WHERE parent_topic_id = '.$db2->escapeNumber($topic_id).' AND order_id = 1'); |
54 | 57 | |
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)); |
|
58 | + if (!$db2->getNumRows()) { |
|
59 | + $db2->query('SELECT * FROM manual WHERE parent_topic_id = '.$db2->escapeNumber($parent_topic_id).' AND order_id = '.$db2->escapeNumber($order_id + 1)); |
|
60 | + } |
|
57 | 61 | |
58 | 62 | $seenParentIDs = array(0); |
59 | 63 | $curr_parent_topic_id = $parent_topic_id; |
@@ -72,8 +76,7 @@ discard block |
||
72 | 76 | $next_topic_id = $db2->getInt('topic_id'); |
73 | 77 | $next_topic = stripslashes($db2->getField('topic')); |
74 | 78 | echo ('<a href="/manual.php?'.$next_topic_id.'"><img src="/images/help/next.jpg" width="32" height="32" border="0"></a>'); |
75 | - } |
|
76 | - else { |
|
79 | + } else { |
|
77 | 80 | echo ('<img src="/images/help/empty.jpg" width="32" height="32">'); |
78 | 81 | } |
79 | 82 | echo ('</th>'); |
@@ -85,18 +88,22 @@ discard block |
||
85 | 88 | |
86 | 89 | echo ('<tr>'); |
87 | 90 | echo ('<td colspan="5">'); |
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> '); |
|
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> '); |
|
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>'); |
|
91 | + if (isset($previous_topic_id) && $previous_topic_id > 0) { |
|
92 | + echo ('<b>Previous:</b> <a href="/manual.php?'.$previous_topic_id.'">' . get_numbering($previous_topic_id) . $previous_topic.'</a> '); |
|
93 | + } |
|
94 | + if (isset($up_topic_id) && $up_topic_id > 0) { |
|
95 | + echo ('<b>Up:</b> <a href="/manual.php?'.$up_topic_id.'">' . get_numbering($up_topic_id) . $up_topic.'</a> '); |
|
96 | + } |
|
97 | + if (isset($next_topic_id) && $next_topic_id > 0) { |
|
98 | + echo ('<b>Next:</b> <a href="/manual.php?'.$next_topic_id.'">' . get_numbering($next_topic_id) . $next_topic.'</a>'); |
|
99 | + } |
|
94 | 100 | echo ('</tr>'); |
95 | 101 | |
96 | 102 | echo ('</table>'); |
97 | - } else |
|
98 | - echo ('Invalid Topic!'); |
|
99 | -} |
|
103 | + } else { |
|
104 | + echo ('Invalid Topic!'); |
|
105 | + } |
|
106 | + } |
|
100 | 107 | |
101 | 108 | function echo_content($topic_id) { |
102 | 109 | // database object |
@@ -114,9 +121,10 @@ discard block |
||
114 | 121 | echo ('<h1>' . get_numbering($topic_id) . $topic.'</h1>'); |
115 | 122 | echo ('<p>'.$text.'<p>'); |
116 | 123 | echo ('</div>'); |
117 | - } else |
|
118 | - echo ('Invalid Topic!'); |
|
119 | -} |
|
124 | + } else { |
|
125 | + echo ('Invalid Topic!'); |
|
126 | + } |
|
127 | + } |
|
120 | 128 | |
121 | 129 | function echo_subsection($topic_id) { |
122 | 130 | // database object |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | $db3 = new SmrMySqlDatabase(); |
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->getField('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->getField('order_id'); |
65 | 65 | $curr_parent_topic_id = $db3->getField('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 = new SmrMySqlDatabase(); |
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 = new SmrMySqlDatabase(); |
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 = new SmrMySqlDatabase(); |
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 = new SmrMySqlDatabase(); |
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'); |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | $publishedGames = array(); |
18 | 18 | while ($db->nextRecord()) { |
19 | 19 | $publishedGames[] = array('game_name' => $db->getField('game_name'), |
20 | - 'game_id' => $db->getInt('game_id')); |
|
20 | + 'game_id' => $db->getInt('game_id')); |
|
21 | 21 | } |
22 | 22 | $template->assign('PublishedGames', $publishedGames); |
23 | 23 | |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $container['back'] = true; |
32 | 32 | |
33 | 33 | $pastEditions[] = array('title' => $db->getField('title'), |
34 | - 'online_since' => $db->getField('online_since'), |
|
35 | - 'href' => SmrSession::getNewHREF($container)); |
|
34 | + 'online_since' => $db->getField('online_since'), |
|
35 | + 'href' => SmrSession::getNewHREF($container)); |
|
36 | 36 | } |
37 | 37 | $template->assign('PastEditions', $pastEditions); |
@@ -15,4 +15,4 @@ |
||
15 | 15 | } |
16 | 16 | |
17 | 17 | $template->assign('AllClaims', array($player->getClaimableBounties('HQ'), |
18 | - $player->getClaimableBounties('UG'))); |
|
18 | + $player->getClaimableBounties('UG'))); |
@@ -17,21 +17,23 @@ discard block |
||
17 | 17 | // iterate over all forces in the target sector |
18 | 18 | foreach ($scanSector->getForces() as $scanSectorForces) { |
19 | 19 | // decide if it's a friendly or enemy stack |
20 | - if ($player->sameAlliance($scanSectorForces->getOwner())) |
|
21 | - $friendly_forces += $scanSectorForces->getMines() * 3 + $scanSectorForces->getCDs() * 2 + $scanSectorForces->getSDs(); |
|
22 | - else |
|
23 | - $enemy_forces += $scanSectorForces->getMines() * 3 + $scanSectorForces->getCDs() * 2 + $scanSectorForces->getSDs(); |
|
24 | -} |
|
20 | + if ($player->sameAlliance($scanSectorForces->getOwner())) { |
|
21 | + $friendly_forces += $scanSectorForces->getMines() * 3 + $scanSectorForces->getCDs() * 2 + $scanSectorForces->getSDs(); |
|
22 | + } else { |
|
23 | + $enemy_forces += $scanSectorForces->getMines() * 3 + $scanSectorForces->getCDs() * 2 + $scanSectorForces->getSDs(); |
|
24 | + } |
|
25 | + } |
|
25 | 26 | |
26 | 27 | foreach ($scanSector->getOtherTraders($player) as $scanSectorPlayer) { |
27 | 28 | $scanSectorShip = $scanSectorPlayer->getShip(); |
28 | 29 | |
29 | 30 | // he's a friend if he's in our alliance (and we are not in a 0 alliance |
30 | - if ($player->traderMAPAlliance($scanSectorPlayer)) |
|
31 | - $friendly_vessel += $scanSectorShip->getAttackRating(); |
|
32 | - else |
|
33 | - $enemy_vessel += $scanSectorShip->getDefenseRating() * 10; |
|
34 | -} |
|
31 | + if ($player->traderMAPAlliance($scanSectorPlayer)) { |
|
32 | + $friendly_vessel += $scanSectorShip->getAttackRating(); |
|
33 | + } else { |
|
34 | + $enemy_vessel += $scanSectorShip->getDefenseRating() * 10; |
|
35 | + } |
|
36 | + } |
|
35 | 37 | |
36 | 38 | $template->assign('FriendlyVessel', $friendly_vessel); |
37 | 39 | $template->assign('FriendlyForces', $friendly_forces); |
@@ -39,10 +41,11 @@ discard block |
||
39 | 41 | $template->assign('EnemyForces', $enemy_forces); |
40 | 42 | |
41 | 43 | // is it a warp or a normal move? |
42 | -if ($sector->getWarp() == $var['target_sector']) |
|
44 | +if ($sector->getWarp() == $var['target_sector']) { |
|
43 | 45 | $turns = TURNS_PER_WARP; |
44 | -else |
|
46 | +} else { |
|
45 | 47 | $turns = TURNS_PER_SECTOR; |
48 | +} |
|
46 | 49 | |
47 | 50 | $template->assign('ScanSector', $scanSector); |
48 | 51 | $template->assign('Turns', $turns); |
@@ -17,7 +17,7 @@ |
||
17 | 17 | $announcements = []; |
18 | 18 | while ($db->nextRecord()) { |
19 | 19 | $announcements[] = ['Time' => $db->getInt('time'), |
20 | - 'Msg' => $db->getField('msg')]; |
|
20 | + 'Msg' => $db->getField('msg')]; |
|
21 | 21 | } |
22 | 22 | $template->assign('Announcements', $announcements); |
23 | 23 |
@@ -9,10 +9,11 @@ discard block |
||
9 | 9 | $realAttackers = array(); |
10 | 10 | $attackers = array(); |
11 | 11 | $i=1; |
12 | -if(isset($_POST['attackers'])) |
|
12 | +if(isset($_POST['attackers'])) { |
|
13 | 13 | foreach($_POST['attackers'] as $attackerName) { |
14 | 14 | if($attackerName=='none') |
15 | 15 | continue; |
16 | +} |
|
16 | 17 | if(isset($usedNames[$attackerName])) { |
17 | 18 | $duplicates = true; |
18 | 19 | continue; |
@@ -24,17 +25,19 @@ discard block |
||
24 | 25 | ++$i; |
25 | 26 | } |
26 | 27 | |
27 | -for(;$i<=10;++$i) |
|
28 | +for(;$i<=10;++$i) { |
|
28 | 29 | $attackers[$i] = null; |
30 | +} |
|
29 | 31 | $template->assign('Attackers',$attackers); |
30 | 32 | |
31 | 33 | $i=1; |
32 | 34 | $realDefenders = array(); |
33 | 35 | $defenders = array(); |
34 | -if(isset($_POST['defenders'])) |
|
36 | +if(isset($_POST['defenders'])) { |
|
35 | 37 | foreach($_POST['defenders'] as $defenderName) { |
36 | 38 | if($defenderName=='none') |
37 | 39 | continue; |
40 | +} |
|
38 | 41 | if(isset($usedNames[$defenderName])) { |
39 | 42 | $duplicates = true; |
40 | 43 | continue; |
@@ -46,8 +49,9 @@ discard block |
||
46 | 49 | ++$i; |
47 | 50 | } |
48 | 51 | |
49 | -for(;$i<=10;++$i) |
|
52 | +for(;$i<=10;++$i) { |
|
50 | 53 | $defenders[$i] = null; |
54 | +} |
|
51 | 55 | $template->assign('Defenders',$defenders); |
52 | 56 | |
53 | 57 | $template->assign('Duplicates',$duplicates); |
@@ -62,12 +66,14 @@ discard block |
||
62 | 66 | while(count($realAttackers)>0 && count($realDefenders)>0) { |
63 | 67 | runAnAttack($realAttackers,$realDefenders); |
64 | 68 | foreach($realAttackers as $key => &$teamPlayer) { |
65 | - if($teamPlayer->isDead()) |
|
66 | - unset($realAttackers[$key]); |
|
69 | + if($teamPlayer->isDead()) { |
|
70 | + unset($realAttackers[$key]); |
|
71 | + } |
|
67 | 72 | } unset($teamPlayer); |
68 | 73 | foreach($realDefenders as $key => &$teamPlayer) { |
69 | - if($teamPlayer->isDead()) |
|
70 | - unset($realDefenders[$key]); |
|
74 | + if($teamPlayer->isDead()) { |
|
75 | + unset($realDefenders[$key]); |
|
76 | + } |
|
71 | 77 | } unset($teamPlayer); |
72 | 78 | } |
73 | 79 | } |
@@ -1,91 +1,91 @@ |
||
1 | 1 | <?php |
2 | -$template->assign('PageTopic','Combat Simulator'); |
|
2 | +$template->assign('PageTopic', 'Combat Simulator'); |
|
3 | 3 | |
4 | -$template->assign('EditDummysLink',SmrSession::getNewHREF(create_container('skeleton.php','edit_dummys.php'))); |
|
4 | +$template->assign('EditDummysLink', SmrSession::getNewHREF(create_container('skeleton.php', 'edit_dummys.php'))); |
|
5 | 5 | $template->assign('DummyNames', DummyPlayer::getDummyPlayerNames()); |
6 | 6 | |
7 | 7 | $duplicates = false; |
8 | 8 | $usedNames = array(); |
9 | 9 | $realAttackers = array(); |
10 | 10 | $attackers = array(); |
11 | -$i=1; |
|
12 | -if(isset($_POST['attackers'])) |
|
13 | - foreach($_POST['attackers'] as $attackerName) { |
|
14 | - if($attackerName=='none') |
|
11 | +$i = 1; |
|
12 | +if (isset($_POST['attackers'])) |
|
13 | + foreach ($_POST['attackers'] as $attackerName) { |
|
14 | + if ($attackerName == 'none') |
|
15 | 15 | continue; |
16 | - if(isset($usedNames[$attackerName])) { |
|
16 | + if (isset($usedNames[$attackerName])) { |
|
17 | 17 | $duplicates = true; |
18 | 18 | continue; |
19 | 19 | } |
20 | 20 | $usedNames[$attackerName] = true; |
21 | - $attackers[$i] =& DummyPlayer::getCachedDummyPlayer($attackerName); |
|
21 | + $attackers[$i] = & DummyPlayer::getCachedDummyPlayer($attackerName); |
|
22 | 22 | $attackers[$i]->setAllianceID(1); |
23 | - $realAttackers[$i] =& $attackers[$i]; |
|
23 | + $realAttackers[$i] = & $attackers[$i]; |
|
24 | 24 | ++$i; |
25 | 25 | } |
26 | 26 | |
27 | -for(;$i<=10;++$i) |
|
27 | +for (;$i <= 10; ++$i) |
|
28 | 28 | $attackers[$i] = null; |
29 | -$template->assign('Attackers',$attackers); |
|
29 | +$template->assign('Attackers', $attackers); |
|
30 | 30 | |
31 | -$i=1; |
|
31 | +$i = 1; |
|
32 | 32 | $realDefenders = array(); |
33 | 33 | $defenders = array(); |
34 | -if(isset($_POST['defenders'])) |
|
35 | - foreach($_POST['defenders'] as $defenderName) { |
|
36 | - if($defenderName=='none') |
|
34 | +if (isset($_POST['defenders'])) |
|
35 | + foreach ($_POST['defenders'] as $defenderName) { |
|
36 | + if ($defenderName == 'none') |
|
37 | 37 | continue; |
38 | - if(isset($usedNames[$defenderName])) { |
|
38 | + if (isset($usedNames[$defenderName])) { |
|
39 | 39 | $duplicates = true; |
40 | 40 | continue; |
41 | 41 | } |
42 | 42 | $usedNames[$attackerName] = true; |
43 | - $defenders[$i] =& DummyPlayer::getCachedDummyPlayer($defenderName); |
|
43 | + $defenders[$i] = & DummyPlayer::getCachedDummyPlayer($defenderName); |
|
44 | 44 | $defenders[$i]->setAllianceID(2); |
45 | - $realDefenders[$i] =& $defenders[$i]; |
|
45 | + $realDefenders[$i] = & $defenders[$i]; |
|
46 | 46 | ++$i; |
47 | 47 | } |
48 | 48 | |
49 | -for(;$i<=10;++$i) |
|
49 | +for (;$i <= 10; ++$i) |
|
50 | 50 | $defenders[$i] = null; |
51 | -$template->assign('Defenders',$defenders); |
|
51 | +$template->assign('Defenders', $defenders); |
|
52 | 52 | |
53 | -$template->assign('Duplicates',$duplicates); |
|
53 | +$template->assign('Duplicates', $duplicates); |
|
54 | 54 | |
55 | -$template->assign('CombatSimHREF',SmrSession::getNewHREF(create_container('skeleton.php','combat_simulator.php'))); |
|
55 | +$template->assign('CombatSimHREF', SmrSession::getNewHREF(create_container('skeleton.php', 'combat_simulator.php'))); |
|
56 | 56 | |
57 | 57 | if (!empty($realAttackers) && !empty($realDefenders)) { |
58 | - if(isset($_REQUEST['run'])) { |
|
59 | - runAnAttack($realAttackers,$realDefenders); |
|
58 | + if (isset($_REQUEST['run'])) { |
|
59 | + runAnAttack($realAttackers, $realDefenders); |
|
60 | 60 | } |
61 | - if(isset($_REQUEST['death_run'])) { |
|
62 | - while(count($realAttackers)>0 && count($realDefenders)>0) { |
|
63 | - runAnAttack($realAttackers,$realDefenders); |
|
64 | - foreach($realAttackers as $key => &$teamPlayer) { |
|
65 | - if($teamPlayer->isDead()) |
|
61 | + if (isset($_REQUEST['death_run'])) { |
|
62 | + while (count($realAttackers) > 0 && count($realDefenders) > 0) { |
|
63 | + runAnAttack($realAttackers, $realDefenders); |
|
64 | + foreach ($realAttackers as $key => &$teamPlayer) { |
|
65 | + if ($teamPlayer->isDead()) |
|
66 | 66 | unset($realAttackers[$key]); |
67 | 67 | } unset($teamPlayer); |
68 | - foreach($realDefenders as $key => &$teamPlayer) { |
|
69 | - if($teamPlayer->isDead()) |
|
68 | + foreach ($realDefenders as $key => &$teamPlayer) { |
|
69 | + if ($teamPlayer->isDead()) |
|
70 | 70 | unset($realDefenders[$key]); |
71 | 71 | } unset($teamPlayer); |
72 | 72 | } |
73 | 73 | } |
74 | 74 | } |
75 | 75 | |
76 | -function runAnAttack($realAttackers,$realDefenders) { |
|
76 | +function runAnAttack($realAttackers, $realDefenders) { |
|
77 | 77 | global $template; |
78 | 78 | $results = array('Attackers' => array('Traders' => array(), 'TotalDamage' => 0), |
79 | 79 | 'Defenders' => array('Traders' => array(), 'TotalDamage' => 0)); |
80 | 80 | foreach ($realAttackers as $accountID => $teamPlayer) { |
81 | - $playerResults =& $teamPlayer->shootPlayers($realDefenders); |
|
82 | - $results['Attackers']['Traders'][] =& $playerResults; |
|
81 | + $playerResults = & $teamPlayer->shootPlayers($realDefenders); |
|
82 | + $results['Attackers']['Traders'][] = & $playerResults; |
|
83 | 83 | $results['Attackers']['TotalDamage'] += $playerResults['TotalDamage']; |
84 | 84 | } |
85 | 85 | foreach ($realDefenders as $accountID => $teamPlayer) { |
86 | - $playerResults =& $teamPlayer->shootPlayers($realAttackers); |
|
87 | - $results['Defenders']['Traders'][] =& $playerResults; |
|
86 | + $playerResults = & $teamPlayer->shootPlayers($realAttackers); |
|
87 | + $results['Defenders']['Traders'][] = & $playerResults; |
|
88 | 88 | $results['Defenders']['TotalDamage'] += $playerResults['TotalDamage']; |
89 | 89 | } |
90 | - $template->assign('TraderCombatResults',$results); |
|
90 | + $template->assign('TraderCombatResults', $results); |
|
91 | 91 | } |
@@ -30,8 +30,8 @@ |
||
30 | 30 | $leader = SmrPlayer::getPlayer($db->getInt('leader_account_id'), $player->getGameID()); |
31 | 31 | $pickedPlayer = SmrPlayer::getPlayer($db->getInt('picked_account_id'), $player->getGameID()); |
32 | 32 | $history[] = array('Leader' => $leader, |
33 | - 'Player' => $pickedPlayer, |
|
34 | - 'Time' => $db->getInt('time')); |
|
33 | + 'Player' => $pickedPlayer, |
|
34 | + 'Time' => $db->getInt('time')); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | $template->assign('History', $history); |