Fixed internal IP detection (#2711), closes #2702

This commit is contained in:
Dylan T
2019-01-29 12:51:53 +00:00
committed by GitHub
parent 3a18bdd6a0
commit 71d17c50d6
3 changed files with 38 additions and 5 deletions

View File

@ -29,9 +29,7 @@ namespace pocketmine\network\upnp;
use pocketmine\utils\Internet;
use pocketmine\utils\Utils;
use function class_exists;
use function gethostbyname;
use function is_object;
use function trim;
abstract class UPnP{
@ -46,7 +44,7 @@ abstract class UPnP{
throw new \RuntimeException("UPnP requires the com_dotnet extension");
}
$myLocalIP = gethostbyname(trim(`hostname`));
$myLocalIP = Internet::getInternalIP();
/** @noinspection PhpUndefinedClassInspection */
$com = new \COM("HNetCfg.NATUPnP");