@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | * @throws \Exception if the connection is closed |
198 | 198 | * @throws \Exception if sending the command failed |
199 | 199 | * |
200 | - * @return bool Whether sending the command was successful or not |
|
200 | + * @return boolean|null Whether sending the command was successful or not |
|
201 | 201 | */ |
202 | 202 | protected function send($command) |
203 | 203 | { |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | /** |
227 | 227 | * Generates the password's CRC32 data |
228 | 228 | * |
229 | - * @return string |
|
229 | + * @return string[] |
|
230 | 230 | */ |
231 | 231 | private function getAuthCRC() |
232 | 232 | { |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | * |
240 | 240 | * @param string $command The message which will be prepared for being sent to the server |
241 | 241 | * |
242 | - * @return string Message which can be sent to the server |
|
242 | + * @return string[] Message which can be sent to the server |
|
243 | 243 | */ |
244 | 244 | private function getMsgCRC($command) |
245 | 245 | { |
@@ -613,7 +613,7 @@ discard block |
||
613 | 613 | * @author nerdalertdk (https://github.com/nerdalertdk) |
614 | 614 | * @link https://github.com/Nizarii/arma-rcon-class-php/issues/4 The related GitHub issue |
615 | 615 | * |
616 | - * @param $str string |
|
616 | + * @param string $str string |
|
617 | 617 | * |
618 | 618 | * @return string |
619 | 619 | */ |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | throw new \Exception('Failed to send login!'); |
165 | 165 | } |
166 | 166 | $result = fread($this->socket, 16); |
167 | - if (@ord($result[strlen($result)-1]) == 0) { |
|
167 | + if (@ord($result[strlen($result) - 1]) == 0) { |
|
168 | 168 | throw new \Exception('Login failed, wrong password or wrong port!'); |
169 | 169 | } |
170 | 170 | } |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | private function getAuthCRC() |
232 | 232 | { |
233 | 233 | $authCRC = sprintf('%x', crc32(chr(255).chr(00).trim($this->rconPassword))); |
234 | - $authCRC = array(substr($authCRC,-2,2), substr($authCRC,-4,2), substr($authCRC,-6,2), substr($authCRC,0,2)); |
|
234 | + $authCRC = array(substr($authCRC, -2, 2), substr($authCRC, -4, 2), substr($authCRC, -6, 2), substr($authCRC, 0, 2)); |
|
235 | 235 | return $authCRC; |
236 | 236 | } |
237 | 237 | /** |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | private function getMsgCRC($command) |
245 | 245 | { |
246 | 246 | $msgCRC = sprintf('%x', crc32(chr(255).chr(01).chr(hexdec(sprintf('%01b', 0))).$command)); |
247 | - $msgCRC = array(substr($msgCRC,-2,2),substr($msgCRC,-4,2),substr($msgCRC,-6,2),substr($msgCRC,0,2)); |
|
247 | + $msgCRC = array(substr($msgCRC, -2, 2), substr($msgCRC, -4, 2), substr($msgCRC, -6, 2), substr($msgCRC, 0, 2)); |
|
248 | 248 | return $msgCRC; |
249 | 249 | } |
250 | 250 | /** |
@@ -599,9 +599,9 @@ discard block |
||
599 | 599 | // Create return array |
600 | 600 | $result = array(); |
601 | 601 | // Loop true the main arrays, each holding a value |
602 | - foreach($str as $key => $value) { |
|
602 | + foreach ($str as $key => $value) { |
|
603 | 603 | // Combines each main value into new array |
604 | - foreach($value as $keyLine => $line) { |
|
604 | + foreach ($value as $keyLine => $line) { |
|
605 | 605 | $result[$keyLine][$key] = trim($line); |
606 | 606 | } |
607 | 607 | } |
@@ -11,13 +11,13 @@ |
||
11 | 11 | $reason = clean((isset($_POST['REASON'])) ? $_POST['REASON'] : 0, "int"); |
12 | 12 | |
13 | 13 | |
14 | - $sql = "SELECT * FROM `servers` WHERE `use_sq` = 1 AND `sid` = " . $sid . ";"; |
|
14 | + $sql = "SELECT * FROM `servers` WHERE `use_sq` = 1 AND `sid` = ".$sid.";"; |
|
15 | 15 | $result_of_query = $db_connection->query($sql); |
16 | 16 | if ($result_of_query->num_rows == 1) { |
17 | 17 | $server = $result_of_query->fetch_object(); |
18 | 18 | try |
19 | 19 | { |
20 | - $rcon = new \Nizarii\ARC(decrypt($server->sq_ip), decrypt($server->rcon_pass), (int)decrypt($server->sq_port)); |
|
20 | + $rcon = new \Nizarii\ARC(decrypt($server->sq_ip), decrypt($server->rcon_pass), (int) decrypt($server->sq_port)); |
|
21 | 21 | $answer = $rcon->banPlayer($rid, $reason, $time); |
22 | 22 | } |
23 | 23 | catch (Exception $e) |
@@ -19,8 +19,7 @@ |
||
19 | 19 | { |
20 | 20 | $rcon = new \Nizarii\ARC(decrypt($server->sq_ip), decrypt($server->rcon_pass), (int)decrypt($server->sq_port)); |
21 | 21 | $answer = $rcon->banPlayer($rid, $reason, $time); |
22 | - } |
|
23 | - catch (Exception $e) |
|
22 | + } catch (Exception $e) |
|
24 | 23 | { |
25 | 24 | echo $e->getMessage( ); |
26 | 25 | } |
@@ -20,8 +20,7 @@ |
||
20 | 20 | { |
21 | 21 | $rcon = new \Nizarii\ARC(decrypt($server->sq_ip), decrypt($server->rcon_pass), (int)decrypt($server->sq_port)); |
22 | 22 | $answer = $rcon->command($cmd); |
23 | - } |
|
24 | - catch (Exception $e) |
|
23 | + } catch (Exception $e) |
|
25 | 24 | { |
26 | 25 | echo $e->getMessage( ); |
27 | 26 | } |
@@ -11,13 +11,13 @@ |
||
11 | 11 | $sid = clean($_POST['sid'], "int"); |
12 | 12 | $cmd = clean($_POST['command'], "string"); |
13 | 13 | |
14 | - $sql = "SELECT * FROM `servers` WHERE `use_sq` = 1 AND `sid` = " . $sid . ";"; |
|
14 | + $sql = "SELECT * FROM `servers` WHERE `use_sq` = 1 AND `sid` = ".$sid.";"; |
|
15 | 15 | $result_of_query = $db_connection->query($sql); |
16 | 16 | if ($result_of_query->num_rows == 1) { |
17 | 17 | $server = $result_of_query->fetch_object(); |
18 | 18 | try |
19 | 19 | { |
20 | - $rcon = new \Nizarii\ARC(decrypt($server->sq_ip), decrypt($server->rcon_pass), (int)decrypt($server->sq_port)); |
|
20 | + $rcon = new \Nizarii\ARC(decrypt($server->sq_ip), decrypt($server->rcon_pass), (int) decrypt($server->sq_port)); |
|
21 | 21 | $answer = $rcon->command($cmd); |
22 | 22 | } |
23 | 23 | catch (Exception $e) |
@@ -16,8 +16,7 @@ |
||
16 | 16 | |
17 | 17 | echo json_encode($answer); |
18 | 18 | |
19 | - } |
|
20 | - catch (Exception $e) |
|
19 | + } catch (Exception $e) |
|
21 | 20 | { |
22 | 21 | echo $e->getMessage( ); |
23 | 22 | var_dump($e); |
@@ -5,13 +5,13 @@ |
||
5 | 5 | if (isset($_GET['sid'])) { |
6 | 6 | $sid = clean($_GET['sid'], "int"); |
7 | 7 | $db_connection = masterConnect(); |
8 | - $sql = "SELECT `sq_ip`,`sq_port`,`rcon_pass` FROM `servers` WHERE `use_sq` = 1 AND `sid` = " . $sid . ";"; |
|
8 | + $sql = "SELECT `sq_ip`,`sq_port`,`rcon_pass` FROM `servers` WHERE `use_sq` = 1 AND `sid` = ".$sid.";"; |
|
9 | 9 | $result_of_query = $db_connection->query($sql); |
10 | 10 | if ($result_of_query->num_rows == 1) { |
11 | 11 | $server = $result_of_query->fetch_object(); |
12 | 12 | try |
13 | 13 | { |
14 | - $rcon = new \Nizarii\ARC(decrypt($server->sq_ip), decrypt($server->rcon_pass), (int)decrypt($server->sq_port)); |
|
14 | + $rcon = new \Nizarii\ARC(decrypt($server->sq_ip), decrypt($server->rcon_pass), (int) decrypt($server->sq_port)); |
|
15 | 15 | $answer = $rcon->getPlayersArray(); |
16 | 16 | |
17 | 17 | echo json_encode($answer); |
@@ -1,12 +1,12 @@ discard block |
||
1 | 1 | <?php |
2 | -$sql = "SELECT `sid` FROM `servers` WHERE `use_sq` = 1 AND `sid` = " . $sid . ";"; |
|
2 | +$sql = "SELECT `sid` FROM `servers` WHERE `use_sq` = 1 AND `sid` = ".$sid.";"; |
|
3 | 3 | $result_of_query = $db_connection->query($sql); |
4 | 4 | if ($result_of_query->num_rows == 1) { ?> |
5 | 5 | <div class="row"> |
6 | 6 | <div class="col-lg-12"> |
7 | 7 | <h1 class="page-header"> |
8 | 8 | <?php echo $lang['players']; ?> |
9 | - <small><?php echo " " . $lang['overview']; ?></small> |
|
9 | + <small><?php echo " ".$lang['overview']; ?></small> |
|
10 | 10 | </h1> |
11 | 11 | </div> |
12 | 12 | </div> |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | } |
29 | 29 | function getPlayers() { |
30 | 30 | $.ajax({ |
31 | - url: "<?php echo $settings['url'] . 'hooks/rcon_players.php?sid=' . $sid ?>", |
|
31 | + url: "<?php echo $settings['url'].'hooks/rcon_players.php?sid='.$sid ?>", |
|
32 | 32 | dataType: 'json', |
33 | 33 | complete: function(data) { |
34 | 34 | var txt = ''; |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | <div class="content-panel"> |
54 | 54 | <table class="table table-striped table-advance table-hover"> |
55 | 55 | <h4> |
56 | - <i class="fa fa-child fa-fw"></i><?php echo " " . $lang['players']; ?> |
|
56 | + <i class="fa fa-child fa-fw"></i><?php echo " ".$lang['players']; ?> |
|
57 | 57 | <div style="float:right; padding-right: 20px;" id="count"></div> |
58 | 58 | </h4> |
59 | 59 | <hr> |
@@ -724,16 +724,16 @@ discard block |
||
724 | 724 | echo '<h4>'.$lang['cop'].': '; |
725 | 725 | echo "<select id='player_coplvl' name='player_coplvl'>"; |
726 | 726 | for ($lvl = 0; |
727 | - $lvl <= $settings['maxLevels']['cop']; |
|
728 | - ++$lvl) { |
|
727 | + $lvl <= $settings['maxLevels']['cop']; |
|
728 | + ++$lvl) { |
|
729 | 729 | echo '<option value="'.$lvl.'"'.select($lvl, $player->coplevel).'>'.$lvl.'</option>'; |
730 | 730 | } |
731 | 731 | echo '</select>'; |
732 | 732 | echo '<h4>'.$lang['medic'].': '; |
733 | 733 | echo "<select id='player_medlvl' name='player_medlvl'>"; |
734 | 734 | for ($lvl = 0; |
735 | - $lvl <= $settings['maxLevels']['medic']; |
|
736 | - ++$lvl) { |
|
735 | + $lvl <= $settings['maxLevels']['medic']; |
|
736 | + ++$lvl) { |
|
737 | 737 | echo '<option value="'.$lvl.'"'.select($lvl, $player->mediclevel).'>'.$lvl.'</option>'; |
738 | 738 | } |
739 | 739 | echo '</select>'; |
@@ -742,16 +742,16 @@ discard block |
||
742 | 742 | echo '<h4>'.$lang['admin'].': '; |
743 | 743 | echo "<select id='player_adminlvl' name='player_adminlvl'>"; |
744 | 744 | for ($lvl = 0; |
745 | - $lvl <= $settings['maxLevels']['admin']; |
|
746 | - ++$lvl) { |
|
745 | + $lvl <= $settings['maxLevels']['admin']; |
|
746 | + ++$lvl) { |
|
747 | 747 | echo '<option value="'.$lvl.'"'.select($lvl, $player->adminlevel).'>'.$lvl.'</option>'; |
748 | 748 | } |
749 | 749 | echo '</select>'; |
750 | 750 | echo '<h4>'.$lang['donator'].': '; |
751 | 751 | echo "<select id='player_donlvl' name='player_donlvl'>"; |
752 | 752 | for ($lvl = 0; |
753 | - $lvl <= $settings['maxLevels']['donator']; |
|
754 | - ++$lvl) { |
|
753 | + $lvl <= $settings['maxLevels']['donator']; |
|
754 | + ++$lvl) { |
|
755 | 755 | echo '<option value="'.$lvl.'"'.select($lvl, $player->$settings['donorFormat']).'>'.$lvl.'</option>'; |
756 | 756 | } |
757 | 757 | echo '</select>'; |
@@ -777,31 +777,31 @@ discard block |
||
777 | 777 | <script> |
778 | 778 | $(document).ready(function () { |
779 | 779 | <?php if ($_SESSION['permissions']['edit']['licences']) { |
780 | - ?> |
|
780 | + ?> |
|
781 | 781 | $(".license").click(function () { |
782 | 782 | $(this).toggleClass('btn-success btn-theme01'); |
783 | 783 | $.post("<?php echo $settings['url'] ?>hooks/license.php", {id: this.id, player: "<?php echo $uID ?>"}); |
784 | 784 | }); |
785 | 785 | <?php |
786 | - } |
|
787 | - if ($_SESSION['permissions']['edit']['player']) { |
|
788 | - ?> |
|
786 | + } |
|
787 | + if ($_SESSION['permissions']['edit']['player']) { |
|
788 | + ?> |
|
789 | 789 | $(".arrest").click(function () { |
790 | 790 | $(this).toggleClass('btn-success btn-theme01'); |
791 | 791 | $.post("<?php echo $settings['url'] ?>hooks/arrest.php", {id: this.id, player: "<?php echo $uID ?>"}); |
792 | 792 | }); |
793 | 793 | <?php |
794 | - } |
|
795 | - if ($_SESSION['permissions']['edit']['wanted']) { |
|
796 | - ?> |
|
794 | + } |
|
795 | + if ($_SESSION['permissions']['edit']['wanted']) { |
|
796 | + ?> |
|
797 | 797 | $(".wanted").click(function () { |
798 | 798 | $(this).toggleClass('btn-success btn-theme01'); |
799 | 799 | $.post("<?php echo $settings['url'] ?>hooks/wanted.php", {id: this.id, player: "<?php echo $uID ?>"}); |
800 | 800 | }); |
801 | 801 | <?php |
802 | - } |
|
803 | - if (($_SESSION['permissions']['view']['steam'] || $player->playerid == $_SESSION['playerid']) && $settings['vacTest']) { |
|
804 | - ?> |
|
802 | + } |
|
803 | + if (($_SESSION['permissions']['view']['steam'] || $player->playerid == $_SESSION['playerid']) && $settings['vacTest']) { |
|
804 | + ?> |
|
805 | 805 | $.ajax({ |
806 | 806 | url: "https://steamrep.com/api/beta3/reputation/<?php echo $player->playerid ?>?json=1&extended=1", |
807 | 807 | dataType: 'json', |
@@ -812,9 +812,9 @@ discard block |
||
812 | 812 | } |
813 | 813 | }); |
814 | 814 | <?php |
815 | - } |
|
816 | - if ($_SESSION['permissions']['view']['steam'] && $settings['vacTest']) { |
|
817 | - ?> |
|
815 | + } |
|
816 | + if ($_SESSION['permissions']['view']['steam'] && $settings['vacTest']) { |
|
817 | + ?> |
|
818 | 818 | $.ajax({ |
819 | 819 | url: "http://bans.itsyuka.tk/api/bans/player/id/6e96f18ddaaa2dadcc32482b2d6a0593/format/json/key/<?php echo $settings['communityBansAPI'] ?>", |
820 | 820 | dataType: 'json', |
@@ -825,7 +825,7 @@ discard block |
||
825 | 825 | } |
826 | 826 | }); |
827 | 827 | <?php |
828 | - } ?> |
|
828 | + } ?> |
|
829 | 829 | }); |
830 | 830 | </script> |
831 | 831 |