Skip to content

Commit

Permalink
Merge pull request #54 from leojonathanoh/fix/web-admintasks-fix-exce…
Browse files Browse the repository at this point in the history
…ptions-in-tools-perlcontrol-and-tools-synchronize

Fix (web/admintasks): Fix exceptions in `tools_perlcontrol` and `tools_synchronize`
  • Loading branch information
leojonathanoh committed Feb 4, 2024
2 parents 442a398 + 37cc746 commit ae8eea0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/web/pages/admintasks/tools_perlcontrol.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@
$answer = "";
$packets = 0;
$read = array($socket);
while (socket_select($read, $write = NULL, $except = NULL, $timeout) > 0) {
$write = NULL;
$except = NULL;
while (socket_select($read, $write, $except, $timeout) > 0) {
$recv_bytes += socket_recvfrom($socket, $buffer, 2000, 0, $host, $port);
$answer .= $buffer;
$buffer = "";
Expand Down Expand Up @@ -160,4 +162,4 @@

<?php
}
?>
?>
4 changes: 3 additions & 1 deletion src/web/pages/admintasks/tools_synchronize.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ function hide_cheaters($query) {
$answer = "";
$packets = 0;
$read = array($socket);
while (socket_select($read, $write = NULL, $except = NULL, &$timeout) > 0) {
$write = NULL;
$except = NULL;
while (socket_select($read, $write, $except, &$timeout) > 0) {
$recv_bytes += socket_recvfrom($socket, &$buffer, 2000, 0, &$host, &$port);
if (($buffer[0] == chr(255)) && ($buffer[1] == chr(255)) && ($buffer[2] == "Z") && ($buffer[3] == chr(255)) &&
($buffer[4] == "1") && ($buffer[5] == ".") && ($buffer[6] == "0") && ($buffer[7] == "0") && ($buffer[8] == chr(255))) {
Expand Down

0 comments on commit ae8eea0

Please sign in to comment.