mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-11 04:17:48 +00:00
UPnP: COM constructor never returns false anymore
This commit is contained in:
parent
9159e8f002
commit
4d13c48e5c
@ -50,7 +50,7 @@ abstract class UPnP{
|
|||||||
$com = new \COM("HNetCfg.NATUPnP");
|
$com = new \COM("HNetCfg.NATUPnP");
|
||||||
/** @noinspection PhpUndefinedFieldInspection */
|
/** @noinspection PhpUndefinedFieldInspection */
|
||||||
|
|
||||||
if($com === false or !is_object($com->StaticPortMappingCollection)){
|
if(!is_object($com->StaticPortMappingCollection)){
|
||||||
throw new \RuntimeException("Failed to portforward using UPnP. Ensure that network discovery is enabled in Control Panel.");
|
throw new \RuntimeException("Failed to portforward using UPnP. Ensure that network discovery is enabled in Control Panel.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,7 +70,7 @@ abstract class UPnP{
|
|||||||
/** @noinspection PhpUndefinedClassInspection */
|
/** @noinspection PhpUndefinedClassInspection */
|
||||||
$com = new \COM("HNetCfg.NATUPnP");
|
$com = new \COM("HNetCfg.NATUPnP");
|
||||||
/** @noinspection PhpUndefinedFieldInspection */
|
/** @noinspection PhpUndefinedFieldInspection */
|
||||||
if($com === false or !is_object($com->StaticPortMappingCollection)){
|
if(!is_object($com->StaticPortMappingCollection)){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
/** @noinspection PhpUndefinedFieldInspection */
|
/** @noinspection PhpUndefinedFieldInspection */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user