SourceInterface: removed redundant return value from process()

This commit is contained in:
Dylan K. Taylor 2018-05-05 15:30:46 +01:00
parent 38c3f00ef7
commit f497e43db3
2 changed files with 4 additions and 11 deletions

View File

@ -65,9 +65,9 @@ interface SourceInterface{
public function setName(string $name); public function setName(string $name);
/** /**
* @return bool * Called every tick to process events on the interface.
*/ */
public function process() : bool; public function process() : void;
public function shutdown(); public function shutdown();

View File

@ -89,19 +89,12 @@ class RakLibInterface implements ServerInstance, AdvancedSourceInterface{
$this->network = $network; $this->network = $network;
} }
public function process() : bool{ public function process() : void{
$work = false; while($this->interface->handlePacket()){}
if($this->interface->handlePacket()){
$work = true;
while($this->interface->handlePacket()){
}
}
if(!$this->rakLib->isRunning() and !$this->rakLib->isShutdown()){ if(!$this->rakLib->isRunning() and !$this->rakLib->isShutdown()){
throw new \Exception("RakLib Thread crashed"); throw new \Exception("RakLib Thread crashed");
} }
return $work;
} }
public function closeSession(string $identifier, string $reason) : void{ public function closeSession(string $identifier, string $reason) : void{