Skip to content
Permalink
Browse files

Bug fix

  • Loading branch information...
sergejey committed Feb 14, 2019
1 parent c60caf1 commit 67bbc511585f11c763c6e71635244d6a53ac08cf
Showing with 0 additions and 24 deletions.
  1. +0 −24 lib/common.class.php
@@ -1399,28 +1399,4 @@ function seekPlayerPosition($host = 'localhost', $time = 0)
} else {
return $player->json['message'];
}
}
function getLocalIP()
{
global $local_ip_address_cached;
if (isset($local_ip_address_cached)) {
$local_ip_address=$local_ip_address_cached;
} else {
$s = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
socket_connect($s, '8.8.8.8', 53); // connecting to a UDP address doesn't send packets
socket_getsockname($s, $local_ip_address, $port);
@socket_shutdown($s, 2);
socket_close($s);
if (!$local_ip_address) {
$main_terminal=getTerminalsByName('MAIN')[0];
if ($main_terminal['HOST']) {
$local_ip_address=$main_terminal['HOST'];
}
}
if ($local_ip_address) {
$local_ip_address_cached=$local_ip_address;
}
}
return $local_ip_address;
}

0 comments on commit 67bbc51

Please sign in to comment.
You can’t perform that action at this time.