Network->registerInterface() now returns whether the registration succeeded or not

This commit is contained in:
Dylan K. Taylor 2020-12-02 16:16:04 +00:00
parent 807474b3fb
commit 6001f69d52

View File

@ -91,7 +91,7 @@ class Network{
$this->sessionManager->tick();
}
public function registerInterface(NetworkInterface $interface) : void{
public function registerInterface(NetworkInterface $interface) : bool{
$ev = new NetworkInterfaceRegisterEvent($interface);
$ev->call();
if(!$ev->isCancelled()){
@ -105,7 +105,9 @@ class Network{
}
}
$interface->setName($this->name);
return true;
}
return false;
}
/**