mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-11 05:55:33 +00:00
Network->registerInterface() now returns whether the registration succeeded or not
This commit is contained in:
parent
807474b3fb
commit
6001f69d52
@ -91,7 +91,7 @@ class Network{
|
|||||||
$this->sessionManager->tick();
|
$this->sessionManager->tick();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function registerInterface(NetworkInterface $interface) : void{
|
public function registerInterface(NetworkInterface $interface) : bool{
|
||||||
$ev = new NetworkInterfaceRegisterEvent($interface);
|
$ev = new NetworkInterfaceRegisterEvent($interface);
|
||||||
$ev->call();
|
$ev->call();
|
||||||
if(!$ev->isCancelled()){
|
if(!$ev->isCancelled()){
|
||||||
@ -105,7 +105,9 @@ class Network{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$interface->setName($this->name);
|
$interface->setName($this->name);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user