Updated RakLib, tick inside thread instead of depending on main thread

This commit is contained in:
Shoghi Cervantes 2015-05-03 23:40:36 +02:00
parent 563f7404fe
commit f718d06a7d
No known key found for this signature in database
GPG Key ID: 78464DB0A7837F89
2 changed files with 6 additions and 12 deletions

View File

@ -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