mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-17 11:18:52 +00:00
Updated RakLib, tick inside thread instead of depending on main thread
This commit is contained in:
parent
563f7404fe
commit
f718d06a7d
@ -75,16 +75,6 @@ class RakLibInterface implements ServerInstance, AdvancedSourceInterface{
|
||||
$this->network = $network;
|
||||
}
|
||||
|
||||
public function doTick(){
|
||||
if(!$this->rakLib->isTerminated()){
|
||||
$this->interface->sendTick();
|
||||
}else{
|
||||
$info = $this->rakLib->getTerminationInfo();
|
||||
$this->network->unregisterInterface($this);
|
||||
\ExceptionHandler::handler(E_ERROR, "RakLib Thread crashed [".$info["scope"]."]: " . (isset($info["message"]) ? $info["message"] : ""), $info["file"], $info["line"]);
|
||||
}
|
||||
}
|
||||
|
||||
public function process(){
|
||||
$work = false;
|
||||
if($this->interface->handlePacket()){
|
||||
@ -93,7 +83,11 @@ class RakLibInterface implements ServerInstance, AdvancedSourceInterface{
|
||||
}
|
||||
}
|
||||
|
||||
$this->doTick();
|
||||
if($this->rakLib->isTerminated()){
|
||||
$info = $this->rakLib->getTerminationInfo();
|
||||
$this->network->unregisterInterface($this);
|
||||
\ExceptionHandler::handler(E_ERROR, "RakLib Thread crashed [".$info["scope"]."]: " . (isset($info["message"]) ? $info["message"] : ""), $info["file"], $info["line"]);
|
||||
}
|
||||
|
||||
return $work;
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit caa379e570dca9382d9619843ef93d753267cafa
|
||||
Subproject commit 675c7b0c98645c1c63505bcb94e8556412124e67
|
Loading…
x
Reference in New Issue
Block a user